curl --request POST \
--url https://api.weryai.com/v1/generation/text-to-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "WERYAI_IMAGE_2_0",
"prompt": "A beautiful sunset over the ocean",
"negative_prompt": "blurry, low quality",
"image_number": 1,
"aspect_ratio": "16:9",
"resolution": "1080p",
"use_web_search": false,
"webhook_url": "https://your-server.com/webhook"
}
'import requests
url = "https://api.weryai.com/v1/generation/text-to-image"
payload = {
"model": "WERYAI_IMAGE_2_0",
"prompt": "A beautiful sunset over the ocean",
"negative_prompt": "blurry, low quality",
"image_number": 1,
"aspect_ratio": "16:9",
"resolution": "1080p",
"use_web_search": False,
"webhook_url": "https://your-server.com/webhook"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'WERYAI_IMAGE_2_0',
prompt: 'A beautiful sunset over the ocean',
negative_prompt: 'blurry, low quality',
image_number: 1,
aspect_ratio: '16:9',
resolution: '1080p',
use_web_search: false,
webhook_url: 'https://your-server.com/webhook'
})
};
fetch('https://api.weryai.com/v1/generation/text-to-image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.weryai.com/v1/generation/text-to-image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'WERYAI_IMAGE_2_0',
'prompt' => 'A beautiful sunset over the ocean',
'negative_prompt' => 'blurry, low quality',
'image_number' => 1,
'aspect_ratio' => '16:9',
'resolution' => '1080p',
'use_web_search' => false,
'webhook_url' => 'https://your-server.com/webhook'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.weryai.com/v1/generation/text-to-image"
payload := strings.NewReader("{\n \"model\": \"WERYAI_IMAGE_2_0\",\n \"prompt\": \"A beautiful sunset over the ocean\",\n \"negative_prompt\": \"blurry, low quality\",\n \"image_number\": 1,\n \"aspect_ratio\": \"16:9\",\n \"resolution\": \"1080p\",\n \"use_web_search\": false,\n \"webhook_url\": \"https://your-server.com/webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.weryai.com/v1/generation/text-to-image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"WERYAI_IMAGE_2_0\",\n \"prompt\": \"A beautiful sunset over the ocean\",\n \"negative_prompt\": \"blurry, low quality\",\n \"image_number\": 1,\n \"aspect_ratio\": \"16:9\",\n \"resolution\": \"1080p\",\n \"use_web_search\": false,\n \"webhook_url\": \"https://your-server.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weryai.com/v1/generation/text-to-image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"WERYAI_IMAGE_2_0\",\n \"prompt\": \"A beautiful sunset over the ocean\",\n \"negative_prompt\": \"blurry, low quality\",\n \"image_number\": 1,\n \"aspect_ratio\": \"16:9\",\n \"resolution\": \"1080p\",\n \"use_web_search\": false,\n \"webhook_url\": \"https://your-server.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"desc": "success",
"message": "success",
"data": {
"batch_id": 123456789,
"task_ids": [
"task_abc123"
]
}
}{
"status": 1001,
"desc": "Parameter error",
"message": "Prompt cannot be empty"
}{
"status": 1002,
"desc": "Authentication failed",
"message": "Invalid API Key"
}Submit Text-to-Image Task
Generate images based on text prompts
curl --request POST \
--url https://api.weryai.com/v1/generation/text-to-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "WERYAI_IMAGE_2_0",
"prompt": "A beautiful sunset over the ocean",
"negative_prompt": "blurry, low quality",
"image_number": 1,
"aspect_ratio": "16:9",
"resolution": "1080p",
"use_web_search": false,
"webhook_url": "https://your-server.com/webhook"
}
'import requests
url = "https://api.weryai.com/v1/generation/text-to-image"
payload = {
"model": "WERYAI_IMAGE_2_0",
"prompt": "A beautiful sunset over the ocean",
"negative_prompt": "blurry, low quality",
"image_number": 1,
"aspect_ratio": "16:9",
"resolution": "1080p",
"use_web_search": False,
"webhook_url": "https://your-server.com/webhook"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'WERYAI_IMAGE_2_0',
prompt: 'A beautiful sunset over the ocean',
negative_prompt: 'blurry, low quality',
image_number: 1,
aspect_ratio: '16:9',
resolution: '1080p',
use_web_search: false,
webhook_url: 'https://your-server.com/webhook'
})
};
fetch('https://api.weryai.com/v1/generation/text-to-image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.weryai.com/v1/generation/text-to-image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'WERYAI_IMAGE_2_0',
'prompt' => 'A beautiful sunset over the ocean',
'negative_prompt' => 'blurry, low quality',
'image_number' => 1,
'aspect_ratio' => '16:9',
'resolution' => '1080p',
'use_web_search' => false,
'webhook_url' => 'https://your-server.com/webhook'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.weryai.com/v1/generation/text-to-image"
payload := strings.NewReader("{\n \"model\": \"WERYAI_IMAGE_2_0\",\n \"prompt\": \"A beautiful sunset over the ocean\",\n \"negative_prompt\": \"blurry, low quality\",\n \"image_number\": 1,\n \"aspect_ratio\": \"16:9\",\n \"resolution\": \"1080p\",\n \"use_web_search\": false,\n \"webhook_url\": \"https://your-server.com/webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.weryai.com/v1/generation/text-to-image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"WERYAI_IMAGE_2_0\",\n \"prompt\": \"A beautiful sunset over the ocean\",\n \"negative_prompt\": \"blurry, low quality\",\n \"image_number\": 1,\n \"aspect_ratio\": \"16:9\",\n \"resolution\": \"1080p\",\n \"use_web_search\": false,\n \"webhook_url\": \"https://your-server.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weryai.com/v1/generation/text-to-image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"WERYAI_IMAGE_2_0\",\n \"prompt\": \"A beautiful sunset over the ocean\",\n \"negative_prompt\": \"blurry, low quality\",\n \"image_number\": 1,\n \"aspect_ratio\": \"16:9\",\n \"resolution\": \"1080p\",\n \"use_web_search\": false,\n \"webhook_url\": \"https://your-server.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"desc": "success",
"message": "success",
"data": {
"batch_id": 123456789,
"task_ids": [
"task_abc123"
]
}
}{
"status": 1001,
"desc": "Parameter error",
"message": "Prompt cannot be empty"
}{
"status": 1002,
"desc": "Authentication failed",
"message": "Invalid API Key"
}Authorizations
Authenticate using Bearer token. Get your API Key from the WeryAI Console.
Example: Authorization: Bearer sk-xxxxxxxxxxxxxxxx
Body
Model Key. Supported models for text-to-image:
| Model Name | Model Key | Supported Aspect Ratios |
|---|---|---|
| WeryAI Image 2.0 | WERYAI_IMAGE_2_0 | 9:16 1:1 16:9 3:4 4:3 |
| WeryAI Image 1.0 | WERYAI_IMAGE_1_0 | 9:16 1:1 16:9 4:3 3:4 |
| Nano Banana 2 | GEMINI_3_1_FLASH_IMAGE | 9:16 1:1 16:9 4:3 3:4 3:2 2:3 4:5 5:4 4:1 1:4 8:1 1:8 21:9 |
| Nano Banana 2 Lite | GEMINI_3_1_FLASH_LITE_IMAGE | 21:9 16:9 3:2 4:3 5:4 1:1 4:5 3:4 2:3 9:16 4:1 1:4 8:1 1:8 |
| Nano Banana Pro | CHATBOT_GEMINI_3_PRO_IMAGE_PREVIEW | 9:16 1:1 16:9 4:3 3:4 3:2 2:3 4:5 5:4 21:9 |
| Nano-banana | GEMINI_2_5_FLASH | 9:16 1:1 16:9 4:3 3:4 3:2 2:3 4:5 5:4 21:9 |
| GPT Image 2 | GPT_IMAGE_2 | 1:1 1:3 2:3 3:1 3:2 4:3 3:4 4:5 5:4 16:9 9:16 |
| GPT Image 2.5 Flare | GPT_IMAGE_2_5_FLARE | 1:1 1:3 2:3 3:1 3:2 4:3 3:4 4:5 5:4 16:9 9:16 |
| GPT Image 2.6 Flare | GPT_IMAGE_2_6_FLARE | 1:1 1:3 2:3 3:1 3:2 4:3 3:4 4:5 5:4 16:9 9:16 |
| GPT Image 2.6 Sunburst | GPT_IMAGE_2_6_SUNBURST | 1:1 1:3 2:3 3:1 3:2 4:3 3:4 4:5 5:4 16:9 9:16 |
| GPT Image 2.5 Sunburst | GPT_IMAGE_2_5_SUNBURST | 1:1 1:3 2:3 3:1 3:2 4:3 3:4 4:5 5:4 16:9 9:16 |
| GPT Image 1.5 | GPT_IMAGE_1_5 | 3:2 1:1 2:3 |
| Seedream 5.0 lite | SEEDREAM_5_0_LITE | 9:16 1:1 16:9 3:4 4:3 2k 3k |
| Seedream 4.5 | SEEDREAM_4_5 | 9:16 1:1 16:9 3:4 4:3 2k 4k |
| Seedream 4.0 | SEEDREAM_4 | 9:16 1:1 16:9 3:2 2:3 3:4 4:3 |
| Wan2.7 | WAN_2_7 | 9:16 1:1 16:9 3:2 2:3 3:4 4:3 |
| Wan2.7 Pro | WAN_2_7_PRO | 9:16 1:1 16:9 3:2 2:3 3:4 4:3 |
| Wan2.6 | WAN_2_6 | 9:16 1:1 16:9 3:4 4:3 |
| Wan2.5 | WAN_2_5 | 9:16 1:1 16:9 3:2 2:3 3:4 4:3 |
| Dreamina 4.0 | DREAMINA_4 | 1:1 4:3 3:4 3:2 2:3 16:9 9:16 21:9 9:21 |
| Dreamina 3.1 | DREAMINA | 9:16 1:1 4:3 16:9 3:4 |
| Dreamina 3.0 | DREAMINA_3 | 1:1 4:3 3:4 3:2 2:3 16:9 9:16 21:9 9:21 |
| Qwen Image 2 Pro | QWEN_2_PRO | 9:16 1:1 16:9 4:3 3:4 |
| Qwen Image 2 | QWEN_2 | 9:16 1:1 16:9 4:3 3:4 |
| Qwen Image | QWEN | 9:16 1:1 16:9 4:3 3:4 |
| Flux | FLUX | 9:16 1:1 16:9 3:2 2:3 3:4 4:3 |
| Gpt Image Mini | GPT_IMAGE_1_MINI | 1:1 |
| Grok 2 | GROK_IMAGINE_IMAGE | 3:4 |
| Imagen4 | IMAGE4 | 9:16 1:1 16:9 4:3 3:4 |
| Recraft V4 | RECRAFT_V4 | 9:16 1:1 16:9 4:3 3:4 |
| Recraft V4 Pro | RECRAFT_V4_PRO | 9:16 1:1 16:9 4:3 3:4 |
| Recraft V4 Vector | RECRAFT_V4_TO_VECTOR | 9:16 1:1 16:9 4:3 3:4 |
| Recraft V4 Pro Vector | RECRAFT_V4_PRO_TO_VECTOR | 9:16 1:1 16:9 4:3 3:4 |
"WERYAI_IMAGE_2_0"
Image quality. Supported values per model:
| Model Name | Model Key | Supported Quality |
|---|---|---|
| GPT Image 2 | GPT_IMAGE_2 | low medium high |
| GPT Image 2.5 Flare | GPT_IMAGE_2_5_FLARE | low medium high xhigh max |
| GPT Image 2.6 Flare | GPT_IMAGE_2_6_FLARE | low medium high xhigh max |
| GPT Image 2.6 Sunburst | GPT_IMAGE_2_6_SUNBURST | low medium high xhigh max |
| GPT Image 2.5 Sunburst | GPT_IMAGE_2_5_SUNBURST | low medium high xhigh max |
"high"
Image resolution. Supported values per model:
| Model Name | Model Key | Supported Resolutions |
|---|---|---|
| GPT Image 2 | GPT_IMAGE_2 | 1k 2k 4k |
| GPT Image 2.5 Flare | GPT_IMAGE_2_5_FLARE | 1k 2k 4k |
| GPT Image 2.6 Flare | GPT_IMAGE_2_6_FLARE | 1k 2k 4k (GIF: 1k only) |
| GPT Image 2.6 Sunburst | GPT_IMAGE_2_6_SUNBURST | 1k 2k 4k (GIF: 1k only) |
| GPT Image 2.5 Sunburst | GPT_IMAGE_2_5_SUNBURST | 1k 2k 4k |
| Nano Banana 2 | GEMINI_3_1_FLASH_IMAGE | 1k 2k 4k |
| Nano Banana Pro | CHATBOT_GEMINI_3_PRO_IMAGE_PREVIEW | 1k 2k 4k |
| Dreamina 4.0 | DREAMINA_4 | 1k 2k 4k |
| Dreamina 3.0 | DREAMINA_3 | 1k 2k |
"1k"
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.
png, jpeg, webp, gif "png"
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.
2 <= x <= 1612
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.
20 <= x <= 2000300
