# Parameters

Every request field of chat completions — what the router checks, what it changes, what it passes to the provider and where each field works.

## How the router treats parameters

1. **Checked by the router:** `model`, `models`, `messages`, `stream`, `max_tokens`, `max_completion_tokens`, `tools`, `response_format` and `provider`. A wrong type or value is a `400` that names the field in `error.metadata.fields`.
2. **Passed through:** any other field goes to the provider unchanged. Whether the model supports it depends on the model: see `supported_parameters` of the model in `GET /api/v1/models` or in the [catalog](/models). A model ignores parameters it does not support.
3. **Dropped in the Russia region:** for `ru-1/…` and `ru-2/…` models the router silently removes `provider`, `models`, `route`, `transforms`, `plugins`, `usage`, `include_reasoning`, `reasoning`, `web_search_options`, `prediction` and `debug`. `reasoning.effort` becomes `reasoning_effort`.

> **Warning:** Without `max_tokens` or `max_completion_tokens` the router sets `max_tokens` to 4096: a longer answer ends with `finish_reason: "length"`. Set it explicitly for long answers and for reasoning models, whose reasoning tokens count toward the limit.

In the cards below, **Regions** says where a field works: Global (`vendor/model` ids) and Russia (`ru-1/…`, `ru-2/…`).

## Model and messages

### `model`

Type: `string` · Regions: Global, Russia

The model id from the catalog. Required unless you give `models`.

### `models`

Type: `string[]` · Regions: Global, Russia

Fallback models tried in order after `model`, if a model has no route or fails before the first token. At most 3 attempts per request in total. See [Models and routing](/docs/en/models-and-routing#fallback-models).

### `messages`

Type: `object[]` · Required · Regions: Global, Russia

The conversation. Every message needs a `role`. See [Chat completions](/docs/en/chat-completions#messages-and-roles).

### `stream`

Type: `boolean` · Default: `false` · Regions: Global, Russia

Send the answer as server-sent events. See [Streaming](/docs/en/streaming).

## Output length

### `max_tokens`

Type: `integer` · Default: `4096` · Range: 1 to 65536 · Regions: Global, Russia

The most tokens the model may generate. Before the request the router reserves funds for this many tokens (at most the model's own output limit), so a smaller value also needs a smaller balance. Values above 65536 are rejected with `400`.

### `max_completion_tokens`

Type: `integer` · Range: 1 to 65536 · Regions: Global, Russia

The newer name of the same limit. When both are set, the smaller one applies to both.

## Sampling

### `temperature`

Type: `number` · Range: 0 to 2 · Regions: passed through unchecked

Randomness of the output: lower is more predictable, higher is more varied. The default depends on the model, usually 1.

### `top_p`

Type: `number` · Range: 0 to 1 · Regions: passed through unchecked

Nucleus sampling: only the tokens within this cumulative probability are considered. Change either `temperature` or `top_p`, not both.

### `top_k`

Type: `integer` · Regions: passed through unchecked

Only the K most likely tokens are considered. `0` turns it off. Not every model supports it.

### `frequency_penalty`

Type: `number` · Range: -2 to 2 · Regions: passed through unchecked

Penalizes tokens by how often they already appeared; positive values reduce repetition.

### `presence_penalty`

Type: `number` · Range: -2 to 2 · Regions: passed through unchecked

Penalizes any token that already appeared; positive values push the model to new topics.

### `repetition_penalty`

Type: `number` · Range: 0 to 2 · Regions: passed through unchecked

Reduces repetition of tokens from the input; `1` means no penalty. Mostly for open-weight models.

### `min_p`

Type: `number` · Range: 0 to 1 · Regions: passed through unchecked

The smallest probability of a token relative to the most likely one.

### `seed`

Type: `integer` · Regions: passed through unchecked

Makes sampling repeatable where the provider supports it. The same seed and parameters usually, not always, give the same answer.

### `stop`

Type: `string | string[]` · Regions: passed through unchecked

Sequences that end generation; the sequence itself is not returned.

### `logit_bias`

Type: `object` · Regions: passed through unchecked

Token ids mapped to a bias from -100 to 100 that makes those tokens more or less likely.

### `logprobs`

Type: `boolean` · Regions: passed through unchecked

Return the log probabilities of the output tokens. `top_logprobs` (0 to 20) also returns the most likely alternatives.

## Tools and structured output

### `tools`

Type: `object[]` · Regions: Global, Russia

Functions the model may call, in the OpenAI format. A non-empty list sends the request only to routes that support tools. See [Tool calling](/docs/en/tool-calling).

### `tool_choice`

Type: `string | object` · Regions: passed through unchecked

`auto`, `none`, `required`, or an object that names one function.

### `parallel_tool_calls`

Type: `boolean` · Regions: passed through unchecked

Whether the model may request several tool calls in one answer.

### `response_format`

Type: `object` · Regions: Global, Russia

`{"type": "json_object"}` asks for valid JSON; `{"type": "json_schema", "json_schema": …}` asks for JSON that matches a schema and sends the request only to routes that support structured output. See [Structured outputs](/docs/en/structured-outputs).

## Reasoning

### `reasoning`

Type: `object` · Regions: Global

Controls the thinking of reasoning models: `effort` (`minimal`, `low`, `medium`, `high`), or `max_tokens` for the reasoning budget, `exclude: true` to leave the reasoning out of the answer, `enabled`. In the Russia region only `effort` is kept, as `reasoning_effort`. See [Reasoning](/docs/en/reasoning).

### `reasoning_effort`

Type: `string` · Regions: passed through unchecked

The OpenAI shortcut for `reasoning.effort`.

## Routing and privacy

### `provider`

Type: `object` · Regions: Global, Russia

Where the request may go. The router itself applies:

- `only`, `ignore`, `order`: lists of provider slugs; the slug `ru` names the Russia region;
- `allow_fallbacks` (boolean): `false` keeps one route per model;
- `zdr` (boolean): `true` sends the request only to models with a zero data retention endpoint;
- `data_collection` (`allow` or `deny`): `deny` excludes providers that may store or train on data.

Other keys of the object go to the Global region as is, without guarantees. See [Models and routing](/docs/en/models-and-routing) and [Zero data retention](/docs/en/zero-data-retention).

## Other fields

### `user`

Type: `string` · Regions: passed through unchecked

Your id of the end user. The router does not store it; some providers use it to detect abuse.

### `usage`

Type: `object` · Regions: Global

Ignored: the router always asks for usage, and every response has `usage` with `cost`.

### `stream_options`

Type: `object` · Regions: passed through unchecked

`include_usage` is always on for streams: the last chunk before `[DONE]` carries `usage`.

Fields that are not listed here are passed to the provider as they are. The router never returns an error for an unknown field, but the model may ignore it.
