Submit Image-to-Image Task
curl --request POST \
--url https://api.weryai.com/v1/generation/image-to-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "WERYAI_IMAGE_2_0",
"prompt": "Transform this image into anime style",
"images": [
"https://example.com/reference.jpg"
],
"negative_prompt": "blurry",
"image_number": 1,
"aspect_ratio": "1:1",
"use_web_search": false
}
'import requests
url = "https://api.weryai.com/v1/generation/image-to-image"
payload = {
"model": "WERYAI_IMAGE_2_0",
"prompt": "Transform this image into anime style",
"images": ["https://example.com/reference.jpg"],
"negative_prompt": "blurry",
"image_number": 1,
"aspect_ratio": "1:1",
"use_web_search": False
}
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: 'Transform this image into anime style',
images: ['https://example.com/reference.jpg'],
negative_prompt: 'blurry',
image_number: 1,
aspect_ratio: '1:1',
use_web_search: false
})
};
fetch('https://api.weryai.com/v1/generation/image-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/image-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' => 'Transform this image into anime style',
'images' => [
'https://example.com/reference.jpg'
],
'negative_prompt' => 'blurry',
'image_number' => 1,
'aspect_ratio' => '1:1',
'use_web_search' => false
]),
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/image-to-image"
payload := strings.NewReader("{\n \"model\": \"WERYAI_IMAGE_2_0\",\n \"prompt\": \"Transform this image into anime style\",\n \"images\": [\n \"https://example.com/reference.jpg\"\n ],\n \"negative_prompt\": \"blurry\",\n \"image_number\": 1,\n \"aspect_ratio\": \"1:1\",\n \"use_web_search\": false\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/image-to-image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"WERYAI_IMAGE_2_0\",\n \"prompt\": \"Transform this image into anime style\",\n \"images\": [\n \"https://example.com/reference.jpg\"\n ],\n \"negative_prompt\": \"blurry\",\n \"image_number\": 1,\n \"aspect_ratio\": \"1:1\",\n \"use_web_search\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weryai.com/v1/generation/image-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\": \"Transform this image into anime style\",\n \"images\": [\n \"https://example.com/reference.jpg\"\n ],\n \"negative_prompt\": \"blurry\",\n \"image_number\": 1,\n \"aspect_ratio\": \"1:1\",\n \"use_web_search\": false\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"
}Image Generation
Submit Image-to-Image Task
Generate new images based on reference images and text prompts
POST
/
v1
/
generation
/
image-to-image
Submit Image-to-Image Task
curl --request POST \
--url https://api.weryai.com/v1/generation/image-to-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "WERYAI_IMAGE_2_0",
"prompt": "Transform this image into anime style",
"images": [
"https://example.com/reference.jpg"
],
"negative_prompt": "blurry",
"image_number": 1,
"aspect_ratio": "1:1",
"use_web_search": false
}
'import requests
url = "https://api.weryai.com/v1/generation/image-to-image"
payload = {
"model": "WERYAI_IMAGE_2_0",
"prompt": "Transform this image into anime style",
"images": ["https://example.com/reference.jpg"],
"negative_prompt": "blurry",
"image_number": 1,
"aspect_ratio": "1:1",
"use_web_search": False
}
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: 'Transform this image into anime style',
images: ['https://example.com/reference.jpg'],
negative_prompt: 'blurry',
image_number: 1,
aspect_ratio: '1:1',
use_web_search: false
})
};
fetch('https://api.weryai.com/v1/generation/image-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/image-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' => 'Transform this image into anime style',
'images' => [
'https://example.com/reference.jpg'
],
'negative_prompt' => 'blurry',
'image_number' => 1,
'aspect_ratio' => '1:1',
'use_web_search' => false
]),
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/image-to-image"
payload := strings.NewReader("{\n \"model\": \"WERYAI_IMAGE_2_0\",\n \"prompt\": \"Transform this image into anime style\",\n \"images\": [\n \"https://example.com/reference.jpg\"\n ],\n \"negative_prompt\": \"blurry\",\n \"image_number\": 1,\n \"aspect_ratio\": \"1:1\",\n \"use_web_search\": false\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/image-to-image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"WERYAI_IMAGE_2_0\",\n \"prompt\": \"Transform this image into anime style\",\n \"images\": [\n \"https://example.com/reference.jpg\"\n ],\n \"negative_prompt\": \"blurry\",\n \"image_number\": 1,\n \"aspect_ratio\": \"1:1\",\n \"use_web_search\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weryai.com/v1/generation/image-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\": \"Transform this image into anime style\",\n \"images\": [\n \"https://example.com/reference.jpg\"\n ],\n \"negative_prompt\": \"blurry\",\n \"image_number\": 1,\n \"aspect_ratio\": \"1:1\",\n \"use_web_search\": false\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
application/json
Model Key. Supported models for image-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 21:9 |
| WeryAI Image 1.0 | WERYAI_IMAGE_1_0 | 9:16 1:1 16:9 3:4 4:3 |
| 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.0 | DREAMINA_3 | 1:1 4:3 3:2 16:9 21:9 |
| Qwen Image 2 Pro | QWEN_2_PRO | 9:16 1:1 16:9 3:4 4:3 |
| Qwen Image 2 | QWEN_2 | 9:16 1:1 16:9 3:4 4:3 |
| Qwen Image | QWEN | 9:16 1:1 16:9 3:4 4:3 |
| 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 |
Example:
"WERYAI_IMAGE_2_0"
Positive text prompt
Required string length:
1 - 2000Example:
"Transform this image into anime style"
Reference image list (supports jpg, jpeg, png, webp)
Example:
["https://example.com/reference.jpg"]
Image aspect ratio (e.g., 9:16, 1:1, 16:9). Refer to the model table above for supported values per model.
Example:
"1:1"
Negative text prompt
Maximum string length:
1000Number of images to generate
Required range:
1 <= x <= 4Image quality. Supported values per model:
| Model Name | Model Key | Supported Quality |
|---|---|---|
| GPT Image 2 | GPT_IMAGE_2 | low medium high |
Example:
"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 |
Example:
"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
Caller ID
⌘I
