🎉 Kimi K2.6 has been released with improved long-context coding stability.
curl --request POST \
--url https://api.moonshot.ai/v1/batches/{batch_id}/cancel \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"object": "batch",
"endpoint": "<string>",
"input_file_id": "<string>",
"completion_window": "<string>",
"created_at": 123,
"request_counts": {
"completed": 123,
"failed": 123,
"total": 123
},
"output_file_id": "<string>",
"error_file_id": "<string>",
"in_progress_at": 123,
"expires_at": 123,
"finalizing_at": 123,
"completed_at": 123,
"failed_at": 123,
"cancelling_at": 123,
"cancelled_at": 123,
"metadata": {}
}Cancel an in-progress batch task. The status will change to cancelling and then to cancelled. Only tasks in validating, in_progress, or finalizing status can be cancelled.
curl --request POST \
--url https://api.moonshot.ai/v1/batches/{batch_id}/cancel \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"object": "batch",
"endpoint": "<string>",
"input_file_id": "<string>",
"completion_window": "<string>",
"created_at": 123,
"request_counts": {
"completed": 123,
"failed": 123,
"total": 123
},
"output_file_id": "<string>",
"error_file_id": "<string>",
"in_progress_at": 123,
"expires_at": 123,
"finalizing_at": 123,
"completed_at": 123,
"failed_at": 123,
"cancelling_at": 123,
"cancelled_at": 123,
"metadata": {}
}For complete usage examples, see the Batch API Guide.Documentation Index
Fetch the complete documentation index at: https://platform.kimi.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
The Authorization header expects a Bearer token. Use an MOONSHOT_API_KEY as the token. This is a server-side secret key. Generate one on the API keys page in your dashboard.
The ID of the batch task
The cancelled batch task
Unique identifier for the batch task
Object type, always batch
"batch"
Request endpoint
Input file ID
Processing time window
Current status: validating, failed, in_progress, finalizing, completed, expired, cancelling, cancelled
validating, failed, in_progress, finalizing, completed, expired, cancelling, cancelled Creation timestamp (Unix)
Show child attributes
Output file ID for successful results
Error file ID for failed results
Execution start timestamp (Unix)
Expiration timestamp (Unix)
Result preparation start timestamp (Unix)
Completion timestamp (Unix)
Validation failure timestamp (Unix)
Cancellation request timestamp (Unix)
Cancellation completion timestamp (Unix)
Custom metadata
Show child attributes
Was this page helpful?