/APIXO Docs

GPT Image 1

High-quality image generation with text-to-image and reference-guided creation

Endpoints

MethodEndpointDescription
POST/api/v1/generateTask/gpt-image-1Create generation task
GET/api/v1/statusTask/gpt-image-1Query task status

Authentication

All requests require an API Key in the header:

Authorization: Bearer YOUR_API_KEY

Request Body

{
  "request_type": "async",
  "callback_url": "https://...",
  "provider": "auto",
  "input": {
    "mode": "gpt-image-1",
    "prompt": "...",
    "aspect_ratio": "3:2",
    "num_images": 2,
    "image_urls": ["..."]
  }
}

Parameters

Parameter
Required
Default
Description
request_typestring
async
async (polling) or callback (webhook)
callback_urlstring
Callback URL, required when request_type=callback
providerstring
auto
Routing strategy: auto, value, or official
inputobject
Model input parameters

Example

Text-to-Image

curl -X POST "https://api.apixo.ai/api/v1/generateTask/gpt-image-1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "gpt-image-1",
      "prompt": "a cozy cyberpunk cafe with neon lights",
      "aspect_ratio": "3:2",
      "num_images": 2
    }
  }'

Reference-Guided Generation

curl -X POST "https://api.apixo.ai/api/v1/generateTask/gpt-image-1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "provider": "official",
    "input": {
      "mode": "gpt-image-1",
      "prompt": "a futuristic cityscape at sunset",
      "aspect_ratio": "3:2",
      "num_images": 4,
      "image_urls": [
        "https://example.com/ref1.jpg",
        "https://example.com/ref2.jpg"
      ]
    }
  }'

Response

POST /api/v1/generateTask/gpt-image-1

Returns taskId on success for subsequent status queries.

Success:

{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}

Error:

{
  "code": 400,
  "message": "Insufficient credits",
  "data": null
}

GET /api/v1/statusTask/gpt-image-1

Query task execution status and results via taskId.

curl -X GET "https://api.apixo.ai/api/v1/statusTask/gpt-image-1?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"

Success:

{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://r2.apixo.ai/xxx.png\",\"https://r2.apixo.ai/yyy.png\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}

Failed:

{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "CONTENT_VIOLATION",
    "failMsg": "Content does not meet safety guidelines"
  }
}

Status Response Fields

FieldTypeDescription
taskIdstringUnique task identifier
statestringpending processing success failed
resultJsonstringJSON containing resultUrls array (on success)
failCodestringError code (on failure)
failMsgstringError message (on failure)
createTimeintegerTask creation timestamp (ms)
completeTimeintegerTask completion timestamp (ms)
costTimeintegerProcessing duration (ms)

Error Codes

CodeDescription
400Invalid parameters or request error
401Invalid or missing API Key
429Rate limit exceeded
Fail CodeDescription
CONTENT_VIOLATIONContent violates safety guidelines
INVALID_IMAGE_URLCannot access provided image URL

Rate Limits

LimitValue
Requests10000 / minute
Concurrent tasks1000

Exceeding limits returns 429 error. Wait and retry.


Tips

  • Generation time: Average ~30 seconds. Submit task, wait 20 seconds, then poll every 3 seconds.
  • Callback mode: For high-concurrency scenarios, use callback mode to avoid frequent polling.
  • Image expiration: Result URLs are valid for 15 days. Download and store important outputs promptly.
  • Content moderation: Prompts must comply with content safety guidelines. Violations return CONTENT_VIOLATION.
  • Reference images: image_urls supports JPG, PNG, WebP formats, max 10MB per image.
  • Batch generation: num_images supports 1/2/4, billed per generated image.
  • Aspect ratio selection: 1:1 for avatars/social media, 3:2 for landscape posters, 2:3 for portrait posters.

On this page