import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.responses.cancel({
responseId: "resp_cancel123",
});
console.log(result);
}
run();{
"id": "resp_cancel123",
"object": "response",
"created_at": 1735689600,
"status": "cancelled",
"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": [],
"output_text": "",
"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": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
},
"user": null
}Cancels an agent response that is currently processing in the background.
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.responses.cancel({
responseId: "resp_cancel123",
});
console.log(result);
}
run();{
"id": "resp_cancel123",
"object": "response",
"created_at": 1735689600,
"status": "cancelled",
"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": [],
"output_text": "",
"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": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
},
"user": null
}Authenticate with your MKA1 API key at the API gateway: Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, also send X-On-Behalf-Of to identify the end user making the request.
Optional external user identifier for multi-user server-side integrations. Use this when acting on behalf of one of your end users.
The unique identifier of the response, formatted as 'resp_' or 'resp-' followed by alphanumeric characters.
^resp[-_][a-zA-Z0-9]+$The response object after cancellation.
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
A message input item with a role and content. Represents a single turn in the conversation from a user, assistant, system, or developer.
Show child attributes
Show child attributes
none, auto, required 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 <= 1Was this page helpful?