curl --request POST \
--url https://api.weryai.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "GEMINI_25_FLASH",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is artificial intelligence?"
}
],
"max_tokens": 1024,
"temperature": 1,
"top_p": 1,
"n": 1
}
'import requests
url = "https://api.weryai.com/v1/chat/completions"
payload = {
"model": "GEMINI_25_FLASH",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is artificial intelligence?"
}
],
"max_tokens": 1024,
"temperature": 1,
"top_p": 1,
"n": 1
}
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: 'GEMINI_25_FLASH',
messages: [
{role: 'system', content: 'You are a helpful assistant.'},
{role: 'user', content: 'What is artificial intelligence?'}
],
max_tokens: 1024,
temperature: 1,
top_p: 1,
n: 1
})
};
fetch('https://api.weryai.com/v1/chat/completions', 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/chat/completions",
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' => 'GEMINI_25_FLASH',
'messages' => [
[
'role' => 'system',
'content' => 'You are a helpful assistant.'
],
[
'role' => 'user',
'content' => 'What is artificial intelligence?'
]
],
'max_tokens' => 1024,
'temperature' => 1,
'top_p' => 1,
'n' => 1
]),
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/chat/completions"
payload := strings.NewReader("{\n \"model\": \"GEMINI_25_FLASH\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is artificial intelligence?\"\n }\n ],\n \"max_tokens\": 1024,\n \"temperature\": 1,\n \"top_p\": 1,\n \"n\": 1\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/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"GEMINI_25_FLASH\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is artificial intelligence?\"\n }\n ],\n \"max_tokens\": 1024,\n \"temperature\": 1,\n \"top_p\": 1,\n \"n\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weryai.com/v1/chat/completions")
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\": \"GEMINI_25_FLASH\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is artificial intelligence?\"\n }\n ],\n \"max_tokens\": 1024,\n \"temperature\": 1,\n \"top_p\": 1,\n \"n\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-abc123def456",
"object": "chat.completion",
"created": 1711929600,
"model": "GEMINI_25_FLASH",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Artificial intelligence (AI) refers to the simulation of human intelligence in machines..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 150,
"total_tokens": 175
}
}{
"status": 1001,
"desc": "Parameter error",
"message": "Prompt cannot be empty"
}{
"status": 1002,
"desc": "Authentication failed",
"message": "Invalid API Key"
}Chat Completion
Send messages to a chat model and receive a response. Compatible with OpenAI Chat Completions protocol. Supports multi-turn conversations by providing message history.
curl --request POST \
--url https://api.weryai.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "GEMINI_25_FLASH",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is artificial intelligence?"
}
],
"max_tokens": 1024,
"temperature": 1,
"top_p": 1,
"n": 1
}
'import requests
url = "https://api.weryai.com/v1/chat/completions"
payload = {
"model": "GEMINI_25_FLASH",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is artificial intelligence?"
}
],
"max_tokens": 1024,
"temperature": 1,
"top_p": 1,
"n": 1
}
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: 'GEMINI_25_FLASH',
messages: [
{role: 'system', content: 'You are a helpful assistant.'},
{role: 'user', content: 'What is artificial intelligence?'}
],
max_tokens: 1024,
temperature: 1,
top_p: 1,
n: 1
})
};
fetch('https://api.weryai.com/v1/chat/completions', 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/chat/completions",
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' => 'GEMINI_25_FLASH',
'messages' => [
[
'role' => 'system',
'content' => 'You are a helpful assistant.'
],
[
'role' => 'user',
'content' => 'What is artificial intelligence?'
]
],
'max_tokens' => 1024,
'temperature' => 1,
'top_p' => 1,
'n' => 1
]),
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/chat/completions"
payload := strings.NewReader("{\n \"model\": \"GEMINI_25_FLASH\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is artificial intelligence?\"\n }\n ],\n \"max_tokens\": 1024,\n \"temperature\": 1,\n \"top_p\": 1,\n \"n\": 1\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/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"GEMINI_25_FLASH\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is artificial intelligence?\"\n }\n ],\n \"max_tokens\": 1024,\n \"temperature\": 1,\n \"top_p\": 1,\n \"n\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weryai.com/v1/chat/completions")
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\": \"GEMINI_25_FLASH\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is artificial intelligence?\"\n }\n ],\n \"max_tokens\": 1024,\n \"temperature\": 1,\n \"top_p\": 1,\n \"n\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-abc123def456",
"object": "chat.completion",
"created": 1711929600,
"model": "GEMINI_25_FLASH",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Artificial intelligence (AI) refers to the simulation of human intelligence in machines..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 150,
"total_tokens": 175
}
}{
"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
Chat model key. Use the /v1/chat/models endpoint to get available models.
| Model Name | Model Key |
|---|---|
| GPT-5.6-Sol | GPT_5_6_SOL |
| GPT-5.6-Terra | GPT_5_6_TERRA |
| GPT-5.6-Luna | GPT_5_6_LUNA |
| GPT-5.5 | GPT_5_5 |
| GPT-5.4 | GPT_5_4 |
| Claude-Fable-5 | CLAUDE_FABLE_5 |
| Claude-4.8-Opus | CLAUDE_4_8_OPUS |
| Claude-4.6-Opus | CLAUDE_4_6_OPUS |
| Gemini-3.7-Flash | GEMINI_3_7_FLASH |
| Gemini-3.6-Flash | GEMINI_3_6_FLASH |
| Gemini-3.5-Flash | GEMINI_3_5_FLASH |
| Gemini-3.1-Pro | GEMINI_3_1_PRO |
| Gemini-3.0-Flash | GEMINI_3_0_FLASH |
| GPT-5.1 | GPT_5_1 |
| Claude-4.5-Opus | CLAUDE_4_5_OPUS |
| GPT-5 | GPT_5 |
| DeepSeek-R1 | DEEPSEEK_R1 |
| Kimi K2 Thinking | KIMI_K2_THINKING |
| QwQ 32B | QWEN_QWQ_32B |
| Grok-4 | GROK_4 |
| Claude-Sonnet-4.6 | CLAUDE_SONNET_4_6 |
| Gemini-3.1-Flash-Lite | GEMINI_3_1_FLASH_LITE |
| Qwen3.5 Plus | QWEN_3_5_PLUS |
| GLM 5 | GLM_5 |
| Kimi K2.5 | KIMI_K2_5 |
| Claude-Sonnet-4.5 | CLAUDE_SONNET_4_5 |
| GPT-4o | GPT_4O |
| Gemini-2.5-Pro | GEMINI_25_PRO |
| GLM 4.7 Flash | GLM_4_7_FLASH |
| Gemini-2.5-Flash | GEMINI_25_FLASH |
| Seed-2.0-Mini | SEED_2_0_MINI |
| Claude-4-Opus | CLAUDE_4_OPUS |
| Claude-4-Sonnet | CLAUDE_4_SONNET |
"GEMINI_25_FLASH"
Message list for the conversation. Supports multi-turn by including history.
1 - 50 elementsShow child attributes
Show child attributes
[
{
"role": "user",
"content": "What is artificial intelligence?"
}
]
Maximum number of tokens to generate. Default 1024. The upper limit depends on the model (use the model list endpoint to check).
x >= 11024
Controls randomness of the output. Higher values produce more diverse results.
0 <= x <= 21
Nucleus sampling parameter. Limits cumulative probability of candidate tokens.
0 <= x <= 11
Penalizes new topics to reduce repetition
-2 <= x <= 2Penalizes frequent tokens to reduce repetition
-2 <= x <= 2Random seed. Same seed with same input produces deterministic results.
Number of responses to generate
x >= 11
Whether to stream the response
Controls how much reasoning effort the model spends before answering. Higher levels typically improve quality on complex tasks at the cost of higher latency and token usage.
Supported values: none, minimal, low, medium, high, xhigh.
Model notes:
- Gemini 3.x: supports
none,minimal,low,medium,high,xhigh; defaults tomedium. - GPT: supports
none,minimal,low,medium,high,xhigh. Defaults vary by version: GPT-5 defaults tominimal; GPT-5.1/5.2/5.4 default tonone; GPT-5.5 defaults tomedium; GPT-4o/4.1 are non-reasoning models and do not support this parameter. - Claude: supports
low,medium,high; defaults to empty (no default).
Whether a specific value takes effect depends on the selected model and upstream provider capabilities.
none, minimal, low, medium, high, xhigh "medium"
Optional plugins for the chat request.
Web Search
Some models support web search. Whether web search takes effect depends on the selected model and upstream provider capabilities. Gemini models are currently integrated with Google Search; for other models, the plugins parameter is passed through and upstream support determines whether it works.
Enable web search with:
{
"plugins": [
{ "id": "web" }
]
}
Notes:
plugins[].id = "web"requests web search.- When Gemini models use web search,
response_format.type = "json_schema"cannot be used at the same time.
Show child attributes
Show child attributes
[{ "id": "web" }]
Response
Chat completed successfully
OpenAI-compatible Chat Completion response
Unique identifier for the chat completion
"chatcmpl-abc123def456"
Object type, always "chat.completion"
"chat.completion"
Unix timestamp (in seconds) of when the completion was created
1711929600
The model used for this completion
"GEMINI_25_FLASH"
List of completion choices
Show child attributes
Show child attributes
Show child attributes
Show child attributes
