Skip to main content
POST
Submit Text-to-Image Task

Authorizations

Authorization
string
header
required

Authenticate using Bearer token. Get your API Key from the WeryAI Console.

Example: Authorization: Bearer sk-xxxxxxxxxxxxxxxx

Body

application/json
model
string
required

Model Key. Supported models for text-to-image:

Example:

"WERYAI_IMAGE_2_0"

prompt
string
required

Positive text prompt

Required string length: 1 - 2000
Example:

"A beautiful sunset over the ocean"

aspect_ratio
string
required

Image aspect ratio (e.g., 9:16, 1:1, 16:9). Refer to the model table above for supported values per model.

Example:

"16:9"

negative_prompt
string

Negative text prompt (exclude unwanted elements)

Maximum string length: 1000
Example:

"blurry, low quality"

image_number
integer
default:1

Number of images to generate

Required range: 1 <= x <= 4
Example:

1

quality
string

Image quality. Supported values per model:

Example:

"high"

resolution
string

Image resolution. Supported values per model:

Example:

"1k"

output_format
enum<string>
default:png

Output format. GPT Image 2.6 supports png, jpeg, webp, and gif; defaults to png. GIF only supports 1k resolution. For GPT_IMAGE_2_6_FLARE and GPT_IMAGE_2_6_SUNBURST, use frame_count and frame_duration_ms to customize the animation; defaults are 9 frames and 200 milliseconds per frame.

Available options:
png,
jpeg,
webp,
gif
Example:

"png"

frame_count
integer
default:9

Number of animation frames. Only supported by GPT_IMAGE_2_6_FLARE and GPT_IMAGE_2_6_SUNBURST when output_format is gif. Must be between 2 and 16; omitted or null uses 9. The frame count affects the generation price. Frame size and count are also subject to the provider's total pixel budget, so not every combination is accepted.

Required range: 2 <= x <= 16
Example:

12

frame_duration_ms
integer
default:200

Playback duration of each frame, in milliseconds. Only supported by GPT_IMAGE_2_6_FLARE and GPT_IMAGE_2_6_SUNBURST when output_format is gif. Must be between 20 and 2000; omitted or null uses 200. The value is forwarded to the provider, which rounds encoded timing to 10 ms precision. Changing this value alone does not change the price. For example, 12 frames at 300 ms per frame gives a nominal 3.6-second loop. This controls newly generated animations; it does not retime an existing GIF without regenerating it.

Required range: 20 <= x <= 2000
Example:

300

Whether to use web search to enhance prompts. Supported models:

webhook_url
string<uri>

Callback URL where results will be sent when task completes

Example:

"https://your-server.com/webhook"

caller_id
integer<int64>

Caller ID (for business association)

Response

Task submitted successfully

status
integer

Business status code (0 indicates success)

Example:

0

desc
string

Status description

Example:

"success"

message
string

Multi-language message

Example:

"success"

data
object