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 2:3 3:4 3:2 4:3 4:5 5:4 16:9(1k) 16:9(2k) 16:9(4k) 9:16(1k) 9:16(2k) 9:16(4k) |
| 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"
Positive text prompt
1 - 2000"A beautiful sunset over the ocean"
Image aspect ratio (e.g., 9:16, 1:1, 16:9). Refer to the model table above for supported values per model.
"16:9"
Negative text prompt (exclude unwanted elements)
1000"blurry, low quality"
Number of images to generate
1 <= x <= 41
Image quality. Supported values per model:
| Model Name | Model Key | Supported Quality |
|---|---|---|
| GPT Image 2 | GPT_IMAGE_2 | low medium high |
"high"
Image resolution. Supported values per model:
| Model Name | Model Key | Supported Resolutions |
|---|---|---|
| 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"
Whether to use web search to enhance prompts. Supported models:
| Model Name | Model Key |
|---|---|
| Nano Banana 2 | GEMINI_3_1_FLASH_IMAGE |
| Nano Banana 2 Lite | GEMINI_3_1_FLASH_LITE_IMAGE |
| Nano Banana Pro | CHATBOT_GEMINI_3_PRO_IMAGE_PREVIEW |
Callback URL where results will be sent when task completes
"https://your-server.com/webhook"
Caller ID (for business association)
