Async tasks (video / MJ / async image)
Longer-running generation (video, Midjourney, async image) uses the task API: submit and get a task_id immediately, then poll status until success or failure.
Availability
The task API is ready, but whether a given task type (video / Midjourney, etc.) is available depends on whether the platform has enabled that capability. Confirm the target task_type is enabled before submitting, or check the console "Tasks" page.
Create a task
POST https://gateway.mindproxy.ai/v1/taskscurl https://gateway.mindproxy.ai/v1/tasks \
-H "Authorization: Bearer $TT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"task_type": "async_image",
"public_model": "flux-1-dev",
"prompt": "a futuristic city at sunset",
"idempotency_key": "my-task-001"
}'| Field | Description |
|---|---|
task_type | Required: video / midjourney / async_image |
public_model | Public model ID (recommended) |
prompt | Task description |
idempotency_key | Idempotency key (optional, strongly recommended) |
input_assets_json | Input assets (optional, JSON object, e.g. a reference image) |
metadata_json | Custom metadata (optional) |
Response (HTTP 202 Accepted):
{
"task_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"status": 1,
"request_id": "req_...",
"hold_id": "hold_..."
}With task_id you can start polling.
Get task status
GET https://gateway.mindproxy.ai/v1/tasks/{task_id}{
"task_id": "f47ac10b-...",
"task_type": 3,
"status": 4,
"public_model": "flux-1-dev",
"result_assets_json": "{\"image_url\":\"https://.../image.png\",\"seed\":12345}",
"created_at": "2026-06-22T10:00:00Z",
"completed_at": "2026-06-22T10:02:00Z"
}On success, results are in result_assets_json (a stringified JSON), commonly: image_url / video_url / thumbnail_url / seed, depending on the task type.
Status values
status is a numeric enum:
| Value | Status | Meaning |
|---|---|---|
| 1 | CREATED | Created, pending |
| 2 | SUBMITTED | Queued |
| 3 | PROCESSING | Processing |
| 4 | SUCCEEDED | Success, result in result_assets_json |
| 5 | FAILED | Failed, see error_code / error_message |
| 6 | CANCELLED | Cancelled |
| 7 | EXPIRED | Expired (timeout / TTL) |
| 8 | REFUNDED | Refunded (hold released, not charged) |
task_type is also an enum: 1 = midjourney, 2 = video, 3 = async_image.
Polling tips
- Poll every 2–5 seconds until the status reaches a terminal state (4/5/6/7/8).
- You can also follow progress via the events endpoint (below).
Task events
GET https://gateway.mindproxy.ai/v1/tasks/{task_id}/events?limit=50&offset=0{
"task_events": [
{
"task_event_id": "event-...",
"event_type": "created",
"status": 1,
"message": "task created",
"created_at": "2026-06-22T10:00:00Z"
}
]
}Cancel a task
POST https://gateway.mindproxy.ai/v1/tasks/{task_id}/cancel{ "reason": "user cancelled" }Cancel, failure and expiry all release the hold and don't charge.
Billing
A task holds funds on creation and settles on success by real usage. Failed / cancelled / expired tasks are not charged, the hold is auto-released, and no stuck balance is left behind.
End-to-end flow
POST /v1/tasksto submit, gettask_id(status 1).- Poll
GET /v1/tasks/{task_id}until status reaches 4 (success) or 5/6/7 (failed / cancelled / expired). - On success, read the asset URL from
result_assets_json.