curl --request POST \
--url https://api.weryai.com/v1/generation/effect-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template_config_id": 2001,
"image_url": [
"https://example.com/photo.jpg"
],
"bgm": false,
"aspect_ratio": "1:1",
"prompt_inputs": {
"style": "cyberpunk"
},
"webhook_url": "https://your-server.com/webhook"
}
'import requests
url = "https://api.weryai.com/v1/generation/effect-template"
payload = {
"template_config_id": 2001,
"image_url": ["https://example.com/photo.jpg"],
"bgm": False,
"aspect_ratio": "1:1",
"prompt_inputs": { "style": "cyberpunk" },
"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({
template_config_id: 2001,
image_url: ['https://example.com/photo.jpg'],
bgm: false,
aspect_ratio: '1:1',
prompt_inputs: {style: 'cyberpunk'},
webhook_url: 'https://your-server.com/webhook'
})
};
fetch('https://api.weryai.com/v1/generation/effect-template', 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/effect-template",
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([
'template_config_id' => 2001,
'image_url' => [
'https://example.com/photo.jpg'
],
'bgm' => false,
'aspect_ratio' => '1:1',
'prompt_inputs' => [
'style' => 'cyberpunk'
],
'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/effect-template"
payload := strings.NewReader("{\n \"template_config_id\": 2001,\n \"image_url\": [\n \"https://example.com/photo.jpg\"\n ],\n \"bgm\": false,\n \"aspect_ratio\": \"1:1\",\n \"prompt_inputs\": {\n \"style\": \"cyberpunk\"\n },\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/effect-template")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template_config_id\": 2001,\n \"image_url\": [\n \"https://example.com/photo.jpg\"\n ],\n \"bgm\": false,\n \"aspect_ratio\": \"1:1\",\n \"prompt_inputs\": {\n \"style\": \"cyberpunk\"\n },\n \"webhook_url\": \"https://your-server.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weryai.com/v1/generation/effect-template")
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 \"template_config_id\": 2001,\n \"image_url\": [\n \"https://example.com/photo.jpg\"\n ],\n \"bgm\": false,\n \"aspect_ratio\": \"1:1\",\n \"prompt_inputs\": {\n \"style\": \"cyberpunk\"\n },\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 Effect Template Creation Task
Submit an effect image template creation task. Use template_config_id from the template list endpoint and provide required images.
curl --request POST \
--url https://api.weryai.com/v1/generation/effect-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template_config_id": 2001,
"image_url": [
"https://example.com/photo.jpg"
],
"bgm": false,
"aspect_ratio": "1:1",
"prompt_inputs": {
"style": "cyberpunk"
},
"webhook_url": "https://your-server.com/webhook"
}
'import requests
url = "https://api.weryai.com/v1/generation/effect-template"
payload = {
"template_config_id": 2001,
"image_url": ["https://example.com/photo.jpg"],
"bgm": False,
"aspect_ratio": "1:1",
"prompt_inputs": { "style": "cyberpunk" },
"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({
template_config_id: 2001,
image_url: ['https://example.com/photo.jpg'],
bgm: false,
aspect_ratio: '1:1',
prompt_inputs: {style: 'cyberpunk'},
webhook_url: 'https://your-server.com/webhook'
})
};
fetch('https://api.weryai.com/v1/generation/effect-template', 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/effect-template",
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([
'template_config_id' => 2001,
'image_url' => [
'https://example.com/photo.jpg'
],
'bgm' => false,
'aspect_ratio' => '1:1',
'prompt_inputs' => [
'style' => 'cyberpunk'
],
'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/effect-template"
payload := strings.NewReader("{\n \"template_config_id\": 2001,\n \"image_url\": [\n \"https://example.com/photo.jpg\"\n ],\n \"bgm\": false,\n \"aspect_ratio\": \"1:1\",\n \"prompt_inputs\": {\n \"style\": \"cyberpunk\"\n },\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/effect-template")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template_config_id\": 2001,\n \"image_url\": [\n \"https://example.com/photo.jpg\"\n ],\n \"bgm\": false,\n \"aspect_ratio\": \"1:1\",\n \"prompt_inputs\": {\n \"style\": \"cyberpunk\"\n },\n \"webhook_url\": \"https://your-server.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weryai.com/v1/generation/effect-template")
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 \"template_config_id\": 2001,\n \"image_url\": [\n \"https://example.com/photo.jpg\"\n ],\n \"bgm\": false,\n \"aspect_ratio\": \"1:1\",\n \"prompt_inputs\": {\n \"style\": \"cyberpunk\"\n },\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
Template configuration ID (obtained from the effect template list endpoint)
2001
Image URL list (supports jpg, jpeg, png, webp). The number of images should match the image_input value from the template config.
1["https://example.com/photo.jpg"]
Whether to add background music (only applicable when the template config supports bgm)
Aspect ratio (must be one of the supported ratios from the template config)
"1:1"
Prompt placeholder inputs as key-value pairs. Keys should match the key field from prompt_variables in the template config.
Show child attributes
Show child attributes
{ "style": "cyberpunk" }
Callback URL where results will be sent when task completes
"https://your-server.com/webhook"
Caller ID (for business association)
