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.
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.
"GEMINI_25_FLASH"
Message list for the conversation. Supports multi-turn by including history.
1 - 50 elementsMaximum 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:
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.
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
