Skip to main content
POST
/
api
/
v1
/
task
/
submit
curl --request POST \
  --url https://api.maxapi.io/api/v1/task/submit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gpt-image-2/text-to-image",
  "callBackUrl": "https://example.com/webhook",
  "input": {
    "prompt": "A crow running down a neon-lit street",
    "ratio": "16:9",
    "n": 1
  }
}'
{
  "code": 0,
  "msg": "ok",
  "data": {
    "taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.maxapi.io/llms.txt

Use this file to discover all available pages before exploring further.

Generate images from text using GPT Image 2. Synchronous upstream; the API still exposes the standard async submit/query/webhook flow.

Available Model

gpt-image-2/text-to-image

Pricing

Billed per resolution tier × n. Failed tasks are not charged.
resolutionUnit price
1k (default)$0.02 / image
2k$0.04 / image
4k$0.06 / image
Total cost = n × unit_price(resolution).
model
string
required
gpt-image-2/text-to-image
callBackUrl
string
Webhook callback URL.
input
object
required
curl --request POST \
  --url https://api.maxapi.io/api/v1/task/submit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gpt-image-2/text-to-image",
  "callBackUrl": "https://example.com/webhook",
  "input": {
    "prompt": "A crow running down a neon-lit street",
    "ratio": "16:9",
    "n": 1
  }
}'
{
  "code": 0,
  "msg": "ok",
  "data": {
    "taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
}

Query Result

Retrieve the result via the Query Task endpoint or Webhook.
{
  "code": 0,
  "msg": "ok",
  "data": {
    "taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "status": "SUCCESS",
    "input": {
      "model": "gpt-image-2/text-to-image",
      "prompt": "A crow running down a neon-lit street"
    },
    "result": {
      "type": "image",
      "urls": ["https://cdn.maxapi.io/images/.../image-0.png"]
    }
  }
}
All result URLs are stable Max API CDN links. With n > 1, the array contains multiple images.