from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.responses.get(response_id="resp_get123", include=[
"file_search_call.results",
"message.output_text.logprobs",
], include_obfuscation=False, starting_after=42, stream=False)
with res as event_stream:
for event in event_stream:
# handle event
print(event, flush=True){
"id": "resp_get123",
"object": "response",
"created_at": 1735689600,
"completed_at": 1735689601,
"status": "completed",
"error": null,
"incomplete_details": null,
"background": false,
"instructions": null,
"max_output_tokens": null,
"max_tool_calls": 30,
"metadata": {},
"model": "meetkai:functionary-urdu-mini-pak",
"output": [
{
"type": "message",
"id": "msg_abc123",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "The capital of France is Paris.",
"annotations": []
}
],
"status": "completed"
}
],
"output_text": "The capital of France is Paris.",
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"service_tier": "auto",
"store": true,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"truncation": "auto",
"usage": {
"input_tokens": 8,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 7,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 15
},
"user": null
}Retrieves a previously created agent response by its unique ID. When stream=true, returns Server-Sent Events for real-time updates on in-progress background responses.
from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.responses.get(response_id="resp_get123", include=[
"file_search_call.results",
"message.output_text.logprobs",
], include_obfuscation=False, starting_after=42, stream=False)
with res as event_stream:
for event in event_stream:
# handle event
print(event, flush=True){
"id": "resp_get123",
"object": "response",
"created_at": 1735689600,
"completed_at": 1735689601,
"status": "completed",
"error": null,
"incomplete_details": null,
"background": false,
"instructions": null,
"max_output_tokens": null,
"max_tool_calls": 30,
"metadata": {},
"model": "meetkai:functionary-urdu-mini-pak",
"output": [
{
"type": "message",
"id": "msg_abc123",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "The capital of France is Paris.",
"annotations": []
}
],
"status": "completed"
}
],
"output_text": "The capital of France is Paris.",
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"service_tier": "auto",
"store": true,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"truncation": "auto",
"usage": {
"input_tokens": 8,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 7,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 15
},
"user": null
}Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
The unique identifier of the response, formatted as 'resp_' or 'resp-' followed by alphanumeric characters.
^resp[-_][a-zA-Z0-9]+$Additional fields to include in the response. Allows requesting specific nested data like web search sources, code interpreter outputs, computer screenshots, file search results, input images, output logprobs, or reasoning content. These fields may have performance or cost implications.
web_search_call.action.sources, code_interpreter_call.outputs, computer_call_output.output.image_url, file_search_call.results, message.input_image.image_url, message.output_text.logprobs, reasoning.encrypted_content [
"file_search_call.results",
"message.output_text.logprobs"
]When true, stream obfuscation will be enabled for privacy and security purposes.
false
The sequence number of the event after which to start streaming. Used for resuming streaming from a specific point.
-9007199254740991 <= x <= 900719925474099142
If set to true, the model response data will be streamed using Server-Sent Events (SSE) for real-time updates as the agent generates the response.
false
Successful response - returns either streaming events (SSE) when stream=true or a complete response object (JSON) when stream=false or omitted
The overall status of the response generation. 'completed' means successfully finished, 'failed' means error occurred, 'in_progress' means currently processing, 'cancelled' means user-cancelled, 'queued' means waiting to start, 'incomplete' means partial completion.
completed, failed, in_progress, cancelled, queued, incomplete Show child attributes
Show child attributes
-9007199254740991 <= x <= 9007199254740991null
-9007199254740991 <= x <= 9007199254740991Show child attributes
Input message item: A message with role and content. Use this for user, assistant, system, or developer turns in structured inputs.
Show child attributes
Show child attributes
Tool choice mode: Selects how the model decides tool usage. Use none, auto, or required.
none, auto, required Function tool definition: Defines a callable function tool. Provide a tool name and parameters schema, with optional description and deferred loading.
Show child attributes
auto, disabled Show child attributes
Show child attributes
Show child attributes
Show child attributes
auto, default, flex, priority 0 <= x <= 20 <= x <= 200 <= x <= 1Show child attributes
Was this page helpful?