ドキュメント

Asynchronous Image Generation API Reference

For long-running image models: submit a task to get task_id, then poll for results. Request body matches the sync image endpoints (JSON or multipart/form-data).

FieldValue
Base URLhttps://token.easyapi.com/v1
AuthenticationAuthorization: Bearer `API_KEY`
Example modeldall-e-3
FormatREST JSON (async jobs)
BillingPay as you go
Note: Task statuses: NOT_START (created), IN_PROGRESS (generating), SUCCESS (done; images holds image results), FAILURE (see fail_reason). Poll about every 2 seconds until status leaves NOT_START / IN_PROGRESS.

Example model

Examples below use dall-e-3 (DALL·E 3). Replace model and adjust size, quality, etc. per console docs when switching models.

Create task

POSThttps://token.easyapi.com/v1/images/tasks

Submit an async image job; returns task_id and initial status immediately. Body fields match sync endpoints (text-to-image / image-to-image); supports application/json or multipart/form-data.

Request parameters

NameInTypeRequiredDescription
AuthorizationheaderstringYesEasyAPI API Key. Format: Bearer `API_KEY`
Content-TypeheaderstringYesapplication/json or multipart/form-data

Request body

NameTypeRequiredDescription
modelstringYesImage model ID, same as sync endpoints
promptstringYesText prompt for the image
nintegerNoNumber of images, default 1
sizestringNoOutput size within model limits
response_formatstringNourl or b64_json when supported
imagefileNoReference image for image-to-image (multipart/form-data)

Example

{
  "model": "dall-e-3",
  "prompt": "一只金毛犬在阳光明媚的海滩上奔跑,水彩插画风格,柔和光线",
  "n": 1,
  "size": "1024x1024"
}

Response example

{
  "code": "success",
  "data": {
    "task_id": "task_img_7c2f9a1b3e4d5c6a8b9f0e1d2c3a4b5",
    "status": "NOT_START",
    "action": "IMAGE_GENERATION",
    "quota": 2000
  }
}

Query task

GEThttps://token.easyapi.com/v1/images/tasks/{task_id}

Example request: https://token.easyapi.com/v1/images/tasks/task_img_7c2f9a1b3e4d5c6a8b9f0e1d2c3a4b5

Poll by task_id. When status is SUCCESS, data.images is a standard OpenAI Image Response array (url / b64_json / revised_prompt).

Request parameters

NameInTypeRequiredDescription
AuthorizationheaderstringYesEasyAPI API Key. Format: Bearer `API_KEY`
task_idstringYestask_id returned from create

Response example

{
  "code": "success",
  "data": {
    "task_id": "task_img_7c2f9a1b3e4d5c6a8b9f0e1d2c3a4b5",
    "status": "SUCCESS",
    "images": [
      {
        "url": "https://cdn.example.com/images/img_dalle3_7c2f9a1b.png",
        "b64_json": "",
        "revised_prompt": "A golden retriever running on a sunny beach, watercolor illustration style"
      }
    ]
  }
}