curl --request POST \
--url https://api.example.com/api/v2/projects/{project_id}/sessions/{session_id}/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>",
"role": "system"
}
],
"inputs": null,
"media_inputs": null,
"tool_schema": [
{
"type": "<string>",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {}
}
}
],
"session_info": {
"custom_metadata": null
},
"trace_info": {
"trace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"prompt_info": {
"prompt_template_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment": null
},
"call_info": {
"start_time": null,
"end_time": null,
"model": null,
"provider": null,
"provider_info": null,
"llm_parameters": null,
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123
},
"api_style": "batch"
},
"test_run_info": {
"test_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"test_case_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"eval_results": null,
"response_info": {
"function_call_response": {
"name": "<string>",
"arguments": "<string>"
}
},
"completion_id": null,
"parent_id": null,
"output_schema": null
}
'{
"completion_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Log an LLM completion with its prompt, response, and metadata. This is the primary endpoint for observability. See SDK method.
Sessions are created implicitly—just generate a session_id client-side (UUID v4). Optionally provide your own completion_id too to avoid waiting for Freeplay’s response.
curl --request POST \
--url https://api.example.com/api/v2/projects/{project_id}/sessions/{session_id}/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>",
"role": "system"
}
],
"inputs": null,
"media_inputs": null,
"tool_schema": [
{
"type": "<string>",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {}
}
}
],
"session_info": {
"custom_metadata": null
},
"trace_info": {
"trace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"prompt_info": {
"prompt_template_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment": null
},
"call_info": {
"start_time": null,
"end_time": null,
"model": null,
"provider": null,
"provider_info": null,
"llm_parameters": null,
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123
},
"api_style": "batch"
},
"test_run_info": {
"test_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"test_case_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"eval_results": null,
"response_info": {
"function_call_response": {
"name": "<string>",
"arguments": "<string>"
}
},
"completion_id": null,
"parent_id": null,
"output_schema": null
}
'{
"completion_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
RecordCompletionInfo(completion_id: uuid.UUID = FieldInfo(annotation=NoneType, required=True, description='The session entry ID'))
The session entry ID