Mager API

Get generation task

GET/api/v1/generation-tasks/{taskId}

Poll task status, billing, result files, and webhook delivery attempts. Public statuses are queued, running, finished, and failed.

Authorization

MagerApiKey
x-mager-api-key<token>

Mager API key

In: header

Path Parameters

taskId*string

Header Parameters

x-mager-api-key*string

Mager API key

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/generation-tasks/string" \  -H "x-mager-api-key: YOUR_API_KEY"
{  "status": 200,  "message": "Success",  "data": {    "task_id": "cmagr01hxyz123",    "status": "finished",    "model": "image-generator",    "template_id": null,    "callback_url": "https://client.example.com/webhooks/mager",    "created_at": "2026-07-03T06:00:00.000Z",    "updated_at": "2026-07-03T06:00:00.000Z",    "completed_at": "2026-07-03T06:01:00.000Z",    "error": null,    "billing": {      "base_moods": 10,      "charged_moods": 15,      "extra_moods_charged": 5    },    "result": [      {        "id": "result_01hxyz",        "status": "SUCCESS",        "file_url": "https://cdn.example.com/generated-image.png",        "file_type": "image/png",        "external_task_id": "provider_task_01hxyz"      }    ],    "webhooks": [      {        "id": "delivery_01hxyz",        "status": "PENDING",        "attempts": 0,        "max_attempts": 3,        "last_attempt_at": null,        "next_retry_at": null,        "delivered_at": null,        "last_status_code": null,        "last_error": null      }    ]  }}