Async API
Disconnect-safe task execution for long-running completions.
The Async API lets you submit chat completion tasks that run in the background. Unlike the Chat Completions API, disconnecting from the network does not cancel the task. This is ideal for long-running requests, batch processing, or unreliable network conditions.
https://api.miromind.aiBearer API KeyEndpoints
/v1/asyncSubmit a new async task. The request body is the same as Chat Completions (model, messages, max_tokens, mcp_servers). The task runs in the background and can be polled for status.
Headers
AuthorizationRequiredYour MiroMind API key
Bearer YOUR_API_KEYContent-TypeRequiredMust be application/json
application/jsonParameters
modelstringRequiredModel ID to use, e.g. "mirothinker-1-7-deepresearch-mini"
messagesarrayRequiredArray of message objects with "role" and "content" fields (same as Chat Completions)
max_tokensintegerMaximum number of tokens to generate
mcp_serversarrayArray of MCP server configs for external tool access
Request
curl -X POST https://api.miromind.ai/v1/async \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mirothinker-1-7-deepresearch-mini",
"messages": [
{
"role": "user",
"content": "Write a detailed research report on quantum computing advances in 2026."
}
]
}'Response
{
"id": "task_550e8400-e29b-41d4-a716-446655440000",
"status": "CREATED",
"created_at": "2026-04-08T10:00:00Z"
}/v1/asyncList all async tasks for the authenticated user. Returns tasks ordered by creation time, most recent first.
Headers
AuthorizationRequiredYour MiroMind API key
Bearer YOUR_API_KEYRequest
curl https://api.miromind.ai/v1/async \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"tasks": [
{
"id": "task_550e8400-e29b-41d4-a716-446655440000",
"status": "COMPLETED",
"created_at": "2026-04-08T10:00:00Z",
"completed_at": "2026-04-08T10:05:30Z"
},
{
"id": "task_661f9500-f30c-52e5-b827-557766550111",
"status": "IN_PROGRESS",
"created_at": "2026-04-08T10:10:00Z"
}
]
}/v1/async/:idGet the status and result of a specific async task. When the task is COMPLETED, the response includes the full chat completion result.
Headers
AuthorizationRequiredYour MiroMind API key
Bearer YOUR_API_KEYRequest
curl https://api.miromind.ai/v1/async/task_550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"id": "task_550e8400-e29b-41d4-a716-446655440000",
"status": "IN_PROGRESS",
"created_at": "2026-04-08T10:00:00Z",
"started_at": "2026-04-08T10:00:02Z"
}/v1/async/:id/cancelCancel an in-progress async task. Has no effect if the task has already completed or failed.
Headers
AuthorizationRequiredYour MiroMind API key
Bearer YOUR_API_KEYRequest
curl -X POST https://api.miromind.ai/v1/async/task_550e8400-e29b-41d4-a716-446655440000/cancel \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"id": "task_550e8400-e29b-41d4-a716-446655440000",
"status": "CANCELLED",
"created_at": "2026-04-08T10:00:00Z",
"cancelled_at": "2026-04-08T10:01:15Z"
}Each async task moves through the following statuses:
| Status | Description |
|---|---|
CREATED | Task has been submitted and is queued for processing |
IN_PROGRESS | Task is currently being executed by the model |
COMPLETED | Task finished successfully; result is available |
FAILED | Task encountered an error during execution |
CANCELLED | Task was explicitly cancelled via the cancel endpoint |
| Chat Completions | Async API | |
|---|---|---|
| Delivery | Streaming SSE or single response | Poll for result |
| Disconnect | Cancels the request | Task keeps running |
| Best for | Interactive chat, real-time UI | Background jobs, batch processing |
| Request body | Same | Same |
For real-time streaming responses, use the Chat Completions API instead.