Skip to main content
POST
Chat Completion

Authorizations

Authorization
string
header
required

Authenticate using Bearer token. Get your API Key from the WeryAI Console.

Example: Authorization: Bearer sk-xxxxxxxxxxxxxxxx

Body

application/json
model
string
required

Chat model key. Use the /v1/chat/models endpoint to get available models.

Example:

"GEMINI_25_FLASH"

messages
object[]
required

Message list for the conversation. Supports multi-turn by including history.

Required array length: 1 - 50 elements
Example:
max_tokens
integer
default:1024

Maximum number of tokens to generate. Default 1024. The upper limit depends on the model (use the model list endpoint to check).

Required range: x >= 1
Example:

1024

temperature
number
default:1

Controls randomness of the output. Higher values produce more diverse results.

Required range: 0 <= x <= 2
Example:

1

top_p
number
default:1

Nucleus sampling parameter. Limits cumulative probability of candidate tokens.

Required range: 0 <= x <= 1
Example:

1

presence_penalty
number

Penalizes new topics to reduce repetition

Required range: -2 <= x <= 2
frequency_penalty
number

Penalizes frequent tokens to reduce repetition

Required range: -2 <= x <= 2
seed
integer

Random seed. Same seed with same input produces deterministic results.

n
integer
default:1

Number of responses to generate

Required range: x >= 1
Example:

1

stream
boolean
default:false

Whether to stream the response

reasoning_effort
enum<string>

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 to medium.
  • GPT: supports none, minimal, low, medium, high, xhigh. Defaults vary by version: GPT-5 defaults to minimal; GPT-5.1/5.2/5.4 default to none; GPT-5.5 defaults to medium; 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.

Available options:
none,
minimal,
low,
medium,
high,
xhigh
Example:

"medium"

plugins
object[]

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.
Example:

Response

Chat completed successfully

OpenAI-compatible Chat Completion response

id
string

Unique identifier for the chat completion

Example:

"chatcmpl-abc123def456"

object
string

Object type, always "chat.completion"

Example:

"chat.completion"

created
integer<int64>

Unix timestamp (in seconds) of when the completion was created

Example:

1711929600

model
string

The model used for this completion

Example:

"GEMINI_25_FLASH"

choices
object[]

List of completion choices

usage
object