Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.uncensored.com/llms.txt

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

Generate Image Live

POST /v1/images/generations
Generate an image from a text prompt. The endpoint can return synchronously or queue work for async delivery when a callback_url is supplied.

Request body

ParameterTypeRequiredDescription
promptstringYesText prompt describing the image. 1-2,000 characters.
modelstringNoImage model to use. Default: model-dev.
image_widthintegerNoWidth in pixels. 256-2,048, must be a multiple of 8. Default: 1024.
image_heightintegerNoHeight in pixels. 256-2,048, must be a multiple of 8. Default: 1024.
callback_urlstringNoWebhook URL for async delivery.
resolutionstringNoResolution hint for variable-pricing models, such as 1k, 2k, 4k, or 8k.
qualitystringNoQuality hint for variable-pricing models, such as medium or high.
additional_settingsobjectNoAdditional model-specific settings.

Example request

curl --request POST "https://api.uncensored.com/api/v1/images/generations" \
  --header "x-api-key: YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "prompt": "A beautiful sunset over mountains, photorealistic, 8k",
    "model": "model-pro",
    "image_width": 1024,
    "image_height": 1024
  }'

Sync response

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "completed",
  "url": "https://storage.googleapis.com/bucket/images/550e8400.jpg",
  "generation_time": 2.5,
  "model": "model-pro"
}

Async request

{
  "prompt": "A cyberpunk cityscape at night",
  "model": "model-pro",
  "image_width": 1024,
  "image_height": 1024,
  "callback_url": "https://your-server.com/webhook"
}

Async response

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "processing",
  "status_url": "https://api.uncensored.com/api/v1/images/generation/jobs/550e8400-e29b-41d4-a716-446655440000",
  "webhook_url": "https://your-server.com/webhook",
  "created_at": "2026-05-09T10:30:00Z"
}

Get image job status

GET /v1/images/generation/jobs/{job_id}
Poll every 2-5 seconds. Image generation typically takes 5-30 seconds.
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "completed",
  "image_url": "https://storage.googleapis.com/bucket/images/550e8400.jpg",
  "model": "model-pro",
  "created_at": "2026-05-09T10:30:00Z",
  "completed_at": "2026-05-09T10:30:05Z",
  "generation_time": 2.5
}

Status codes

Status codeDescription
200Image generated successfully in sync mode.
202Job accepted and queued for async mode.
400Invalid request parameters.
402Insufficient funds.
403Content moderation failed, or scope does not permit this model.
429Rate limit exceeded.
500Internal server error.