> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paretoinference.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference

> Use the GLM 5.3 Flash API.

The Pareto application programming interface (API) uses JavaScript Object Notation (JSON). Streaming responses use server-sent events.

| Setting | Value |
| - | - |
| Base URL | `https://api.paretoinference.com/v1` |
| Authentication | `Authorization: Bearer <API_KEY>` |

The `Authorization` header carries the API key. The word `Bearer` tells the API to use the next value as the key.

## List models

GET `/models`

This endpoint does not require an API key. The response contains a `data` list of public model IDs. Chat requests require an active API key with access to the selected model.

Use `z-ai/glm-5.3-flash` for this offer. Pareto also accepts the alias `glm-5.3-flash`. For Kimi K3.1 Pro, use `moonshotai/kimi-k3.1-pro`. The model catalog does not grant access to a model.

Use an ID exactly as listed.

```bash theme={"system"}
curl https://api.paretoinference.com/v1/models
```

### Model prices

Each model in the `data` list has a `pricing` object. The object uses the OpenRouter format. Each value is a decimal string in USD per token.

* `prompt`: the input price.
* `completion`: the output price.
* `input_cache_read`: the cached input price.

To get USD per 1 million tokens, multiply the value by 1,000,000. Without an API key, the values agree with the [token prices](https://docs.paretoinference.com/pricing.md#token-prices). With an API key, the values are the prices for the account of that key. These prices can be different if the account has a special price agreement.

Routers can read `pricing` to update their prices automatically. Read the list again at a regular interval to get price changes.

### Model limits

Each model has a context window of 1,048,576 tokens. The context window contains the prompt and the output.

| Limit | Tokens |
| - | -: |
| Context window | 1,048,576 |
| Prompt | 917,504 |
| Output | 131,072 |

The prompt limit leaves space for the full output limit. GLM 5.3 Flash returns HTTP 400 with `context_length_exceeded` for a longer prompt. DeepSeek V4.1 Flash returns it only for a prompt longer than the context window. See [Troubleshooting](https://docs.paretoinference.com/errors.md#400-bad-request).

Cached tokens count toward the prompt limit. See [Prompt caching](https://docs.paretoinference.com/prompt-caching.md).

### Model precision

Quantization can vary by deployment. Pareto does not guarantee a fixed precision.

See [why we do not disclose our serving system details](https://docs.paretoinference.com/how-pareto-works.md#serving-system-details).

## Create a chat completion

POST `/chat/completions`

Use `z-ai/glm-5.3-flash` as the model ID. The request body must contain:

* `model`: the model ID.
* `messages`: the input messages.
* `stream`: `true`. Pareto serves streamed requests only.

```bash theme={"system"}
curl https://api.paretoinference.com/v1/chat/completions \
  -H "Authorization: Bearer $PARETO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-ai/glm-5.3-flash",
    "messages": [{"role": "user", "content": "Hello"}],
    "stream": true
  }'
```

The response is a server-sent event stream. See [Streaming](#streaming) to read it.

## Request parameters

Send only the parameters in this table. Support for optional parameters can differ by deployment. The API can reject unsupported values or combinations.

| Parameter | Notes |
| - | - |
| `model` | Required. Use a model ID from `GET /models`. |
| `messages` | Required. Use the OpenAI message format. |
| `stream` | Required. Must be `true`. Without it the API returns HTTP 400 with `streaming_only`. |
| `stream_options` | With `stream: true`, use `{"include_usage": true}` for a final usage event. `{"include_usage": false}`, `{}`, and `null` omit that event. |
| `max_tokens` | Sets the maximum output tokens, from 1. The API uses 131,072 for a larger value. The default is 131,072 when both token-limit parameters are omitted. |
| `max_completion_tokens` | Replaces `max_tokens` with the same 131,072-token maximum. Do not send both parameters. |
| `temperature` | Sets the sampling temperature. |
| `top_p` | Sets nucleus sampling. |
| `top_k` | Limits sampling to the most likely tokens. |
| `min_p` | Sets a minimum token probability relative to the most likely token. |
| `repetition_penalty` | Reduces repeated tokens with an open-model penalty. |
| `stop` | Sets up to 4 stop sequences. Kimi K3.1 Pro takes up to 5 while it reasons, and 4 with `reasoning_effort: none`. |
| `seed` | Requests repeatable sampling. Results can differ. |
| `tools` | Sends OpenAI function tools. Model support can differ. |
| `tool_choice` | Selects a function tool. Model support can differ. |
| `n` | Must be `1` or `null`: each request returns one choice. |
| `parallel_tool_calls` | Set to `false` to allow zero or one tool call. `null` uses the model's default behavior. See [Tool calls](#tool-calls). |
| `store` | Accepts `false` or `null`. Stored completions are not supported. `true` returns HTTP 400. |
| `prompt_cache_key` | Accepts a string or `null`. This is a cache hint. It does not guarantee a cache hit. See [Prompt caching](https://docs.paretoinference.com/prompt-caching.md). |
| `user` | Accepted and ignored. Pareto does not forward it. |
| `response_format` | Requests a structured response. Model support can differ. |
| `frequency_penalty` | Reduces repeated tokens. |
| `presence_penalty` | Increases topic diversity. |
| `logprobs` | Requests token probabilities. Model support can differ. |
| `top_logprobs` | Sets the number of token probabilities. Use with `logprobs`. |
| `reasoning` | OpenRouter's reasoning object. `effort` sets `reasoning_effort`, `max_tokens` caps reasoning tokens (at most 32,768, the endpoint's own cap), and `exclude: true` leaves reasoning out of the response. `enabled: false` turns reasoning off on GLM-5.3-Flash and DeepSeek-V4.1-Flash, as `reasoning_effort: none` does. |
| `include_reasoning` | Set to `false` to leave reasoning out of the response. |
| `reasoning_effort` | Sets the reasoning level: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`. `none` turns reasoning off on GLM-5.3-Flash and DeepSeek-V4.1-Flash. Without it, GLM-5.3-Flash uses `high` and DeepSeek-V4.1-Flash uses `medium`. Use `max` for the longest GLM-5.3-Flash reasoning. |

Pareto serves this model on its own GPUs. Parameters outside the table are not supported. Include the conversation history in `messages`.

See [How Pareto works](https://docs.paretoinference.com/how-pareto-works.md) for serving and capacity behavior.

Pareto offers zero data retention (ZDR) and does not keep request content after a request finishes, whatever `store` is set to. See the [Zero Data Retention Policy](https://paretoinference.com/zdr) and [Privacy Policy](https://paretoinference.com/privacy).

## Streaming

Every response arrives as events while it is generated. Read text from `choices[0].delta.content`. Tool calls arrive in `choices[0].delta.tool_calls`.

With `stream_options: {"include_usage": true}`, the last JSON event contains `usage` and an empty `choices` list. `usage` does not show the charge. See [Balance and usage](https://docs.paretoinference.com/balance-and-usage.md) for charges. A successful stream ends with `data: [DONE]`.

## Tool calls

With `parallel_tool_calls` set to `false`, a successful response contains zero or one tool call: GLM-5.3-Flash returns the first call the model writes. If a response still contains more tool calls, the request fails. For a stream, earlier events can arrive before the error.

Read the function name and arguments from `tool_calls`. Send the tool result in a new request with role `tool` and the matching `tool_call_id`. Include the assistant tool call in `messages`.

## Create a response

POST `/responses`

The Responses API uses the same models, key, limits, and prices as chat completions. The request body must contain:

* `model`: the model ID.
* `input`: a string, or a list of input items.
* `stream`: `true`. Pareto serves streamed requests only.

```bash theme={"system"}
curl https://api.paretoinference.com/v1/responses \
  -H "Authorization: Bearer $PARETO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-ai/glm-5.3-flash",
    "input": "Hello",
    "stream": true
  }'
```

Pareto does not store responses. Send the full conversation in `input` with each request:

* `message` items with the roles `user`, `assistant`, `system`, and `developer`. Content parts can be `input_text`, `output_text`, and `input_image`.
* `function_call` and `function_call_output` items. Match them with `call_id`.
* `reasoning` items from earlier responses.

These parameters are supported: `instructions`, `tools` (function and namespace tools), `tool_choice`, `parallel_tool_calls`, `max_output_tokens`, `reasoning.effort`, `text.format`, `temperature`, `top_p`, `prompt_cache_key`, and `metadata`. `store` is accepted. Pareto does not keep a response, whatever `store` is set to.

These parameters return HTTP 400: `previous_response_id`, `conversation`, `prompt`, `background: true`, and `item_reference` items. Pareto ignores hosted tools such as `web_search`. The `Pareto-Ignored-Parameters` response header names each ignored parameter.

The stream uses the Responses event types, from `response.created` to `response.completed`. Each event has a `sequence_number`. The model's reasoning arrives as a `reasoning` item before the answer. With `reasoning.summary`, it arrives as the summary. The last event carries `usage`. A response that reaches `max_output_tokens` ends with `response.incomplete`. A failure ends with `response.failed`.

## Messages

POST `/messages`

The Anthropic Messages API uses the same models, key, limits, and prices as chat completions. Send your key in `x-api-key` or as a bearer token in `Authorization`. The request body must contain:

* `model`: the model ID.
* `max_tokens`: the output limit.
* `messages`: the conversation.
* `stream`: `true`. Pareto serves streamed requests only.

```bash theme={"system"}
curl https://api.paretoinference.com/v1/messages \
  -H "x-api-key: $PARETO_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-ai/glm-5.3-flash",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}],
    "stream": true
  }'
```

Messages can contain `text`, `tool_use`, `tool_result`, and `thinking` blocks. System messages are accepted in `system` and in `messages`. Pareto does not support prefill. If the last user or assistant message is from the assistant, the request returns HTTP 400.

These parameters are supported: `system`, `tools`, `thinking`, `output_config.effort`, `stop_sequences`, and `stream`. Pareto caches prompts automatically, so `cache_control` is accepted and has no other effect.

The model's reasoning arrives as a `thinking` block before the answer. With `thinking.display` set to `omitted`, the block's signature carries the reasoning. Send the block back unchanged in the next request. `usage.input_tokens` counts the prompt tokens that are not cached. `usage.cache_read_input_tokens` counts the cached tokens. The `message_delta` event carries the usage. If the output stops at one of the `stop_sequences`, the `message_delta` event sets `stop_reason` to `stop_sequence` and `stop_sequence` to that sequence. Errors use the Anthropic error format.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.