Async API

Disconnect-safe task execution for long-running completions.

Overview

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.

Base URL:https://api.miromind.ai
Auth:Bearer API Key
Pattern:Submit + Poll

Endpoints

POST/v1/async
Submit Task

Submit 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

AuthorizationRequired

Your MiroMind API key

Bearer YOUR_API_KEY
Content-TypeRequired

Must be application/json

application/json

Parameters

modelstringRequired

Model ID to use, e.g. "mirothinker-1-7-deepresearch-mini"

messagesarrayRequired

Array of message objects with "role" and "content" fields (same as Chat Completions)

max_tokensinteger

Maximum number of tokens to generate

mcp_serversarray

Array 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

Response (201 Created)
{
  "id": "task_550e8400-e29b-41d4-a716-446655440000",
  "status": "CREATED",
  "created_at": "2026-04-08T10:00:00Z"
}
GET/v1/async
List Tasks

List all async tasks for the authenticated user. Returns tasks ordered by creation time, most recent first.

Headers

AuthorizationRequired

Your MiroMind API key

Bearer YOUR_API_KEY

Request

cURL
curl https://api.miromind.ai/v1/async \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

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"
    }
  ]
}
GET/v1/async/:id
Get Task

Get the status and result of a specific async task. When the task is COMPLETED, the response includes the full chat completion result.

Headers

AuthorizationRequired

Your MiroMind API key

Bearer YOUR_API_KEY

Request

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"
}
POST/v1/async/:id/cancel
Cancel Task

Cancel an in-progress async task. Has no effect if the task has already completed or failed.

Headers

AuthorizationRequired

Your MiroMind API key

Bearer YOUR_API_KEY

Request

curl -X POST https://api.miromind.ai/v1/async/task_550e8400-e29b-41d4-a716-446655440000/cancel \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

Response
{
  "id": "task_550e8400-e29b-41d4-a716-446655440000",
  "status": "CANCELLED",
  "created_at": "2026-04-08T10:00:00Z",
  "cancelled_at": "2026-04-08T10:01:15Z"
}
Status Flow

Each async task moves through the following statuses:

CREATEDIN_PROGRESS
COMPLETEDFAILEDCANCELLED
StatusDescription
CREATEDTask has been submitted and is queued for processing
IN_PROGRESSTask is currently being executed by the model
COMPLETEDTask finished successfully; result is available
FAILEDTask encountered an error during execution
CANCELLEDTask was explicitly cancelled via the cancel endpoint
Async API vs Chat Completions
Chat CompletionsAsync API
DeliveryStreaming SSE or single responsePoll for result
DisconnectCancels the requestTask keeps running
Best forInteractive chat, real-time UIBackground jobs, batch processing
Request bodySameSame
Next Steps

For real-time streaming responses, use the Chat Completions API instead.

MiroMindAI Platform - Build Together. Evolve Forever.