---
description: "Use OpenAI SDKs and tools with Verda Inference: base URL, supported endpoint and parameters, streaming with usage, reasoning output, and error codes."
revision_date: 04.11.2026
---

# OpenAI Compatibility

Verda Inference speaks the OpenAI Chat Completions API. OpenAI SDKs and tools work with Verda once you change two settings:

| Setting | Value |
|---------|-------|
| Base URL | `https://inference.verda.com/v1` |
| API key | Your [inference API key](https://docs.verda.com/welcome-to-verda/api-credentials/#inference-api-keys) |

If you set `OPENAI_BASE_URL` and `OPENAI_API_KEY` in your environment, the OpenAI SDKs pick them up without code changes. See [Quickstart](https://docs.verda.com/inference/quickstart/#2-set-your-environment).

## Endpoints

Verda Inference serves `POST /v1/chat/completions`, with and without streaming, `POST /v1/responses` for clients that use the Responses API, and `GET /v1/models`, which lists the models your project can call. See [Inference Endpoint API](https://docs.verda.com/inference/models/#inference-endpoint-api). Other OpenAI endpoints, such as embeddings, images or audio, return `404` with the code `endpoint_not_supported`.

## Request parameters

You can send the usual Chat Completions parameters, including `messages`, `max_tokens`, `temperature`, `top_p`, `stop`, `seed`, `tools`, `tool_choice` and `response_format`. Tool calling and JSON mode work on models that list them under features on their model page.

A few things work differently:

- `n` must be `1`. Each request returns one choice.
- Send extra parameters at the top level of the JSON body. A body field named `extra_body` is rejected with `400 unsupported_parameter`. The Python SDK's `extra_body` argument is fine, because the SDK merges it into the body before sending.
- Parameters the API doesn't support are ignored.

## Streaming

Set `"stream": true` to receive the response as server-sent events. The stream ends with `data: [DONE]`.

To get token usage for a streamed response, ask for it:

```json
"stream_options": {"include_usage": true}
```

The last chunk before `[DONE]` then carries the `usage` object.

## Timeouts

A request without streaming times out after 60 seconds. A streamed response can run for up to 20 minutes. For long generations, such as an agent writing a large file, set `"stream": true`.

Requests that time out aren't charged.

## Reasoning

Reasoning models think before they answer. They return their thinking in `reasoning_content`, separate from the answer in `content`. When streaming, it arrives in `delta.reasoning_content`. Reasoning counts as output tokens and is billed like them.

Two request fields control it:

- `reasoning_effort` sets how much the model thinks, for example `low` or `high`. Lower effort answers faster and costs less. Each model's page lists the efforts it accepts and its default.
- `max_tokens` caps the reasoning and the answer together. If the model uses it all while reasoning, `content` comes back empty and `finish_reason` is `length`. Raise `max_tokens`, or lower `reasoning_effort`.

Some models always reason, so every request uses some reasoning tokens. The `reasoning` field of [`GET /v1/inference/models`](https://docs.verda.com/inference/models/#model-access-management) lists a model's options: `supported_efforts` (cheapest first), `default_effort`, and `optional`, which says whether reasoning can be turned off.

## Errors

Errors use the OpenAI error format, with `error.type`, `error.code` and `error.message`, so OpenAI SDKs raise them as usual.

| Status | Code | What it means | What to do |
|--------|------|---------------|------------|
| `400` | `invalid_request`, `unsupported_parameter`, `upstream_error` | The model can't take the request, for example a parameter isn't supported or the prompt is too long | Fix the request. The message names the problem. |
| `401` | `invalid_api_key` | The API key is missing, wrong or deleted | Check the key. Use an inference API key, not a Cloud API credential. |
| `402` | | Inference is paused because the project balance is too low | Top up your balance. |
| `403` | `subscription_required` | The model isn't enabled for your project | [Enable the model](https://docs.verda.com/inference/models/#enable-a-model). |
| `403` | `model_access_denied`, `tenant_suspended` | Your project can't use this model, or inference is suspended for it | Contact support. |
| `404` | `model_not_found` | No model has this ID | Check the [model ID](https://docs.verda.com/inference/models/#model-ids). |
| `404` | `endpoint_not_supported` | The endpoint isn't served | Use `/v1/chat/completions`. |
| `413` | `request_too_large` | The request body is too large | Send a smaller request. |
| `429` | `rate_limit_exceeded` | You reached a rate limit | Wait for `Retry-After`, then retry. See [Rate limits](https://docs.verda.com/inference/rate-limits/). |
| `5xx` | | A temporary problem on our side | Retry with exponential backoff. |
