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

# OpenAI

> Every OpenAI model Verlon supports — plus quickstart and SDK compatibility (use the OpenAI SDK unchanged against Verlon).

Every OpenAI model — GPT-3.5, GPT-4, GPT-4o, GPT-5, and the o-series reasoning models — is routable through Verlon with your existing OpenAI SDK unchanged. Just point `baseURL` at Verlon and swap the API key.

## Chat models

| Model ID                                  | Type | Context |
| ----------------------------------------- | ---- | ------- |
| `chat-latest`                             | chat | 1000K   |
| `gpt-3.5-turbo`                           | chat | 16K     |
| `gpt-3.5-turbo-0125`                      | chat | 16K     |
| `gpt-3.5-turbo-1106`                      | chat | 16K     |
| `gpt-3.5-turbo-16k`                       | chat | 16K     |
| `gpt-4`                                   | chat | 8K      |
| `gpt-4-0613`                              | chat | 8K      |
| `gpt-4-1-2025-04-14`                      | chat | 1048K   |
| `gpt-4-turbo`                             | chat | 128K    |
| `gpt-4-turbo-2024-04-09`                  | chat | 128K    |
| `gpt-4.1`                                 | chat | 1048K   |
| `gpt-4.1-2025-04-14`                      | chat | 1048K   |
| `gpt-4.1-mini`                            | chat | 1048K   |
| `gpt-4.1-mini-2025-04-14`                 | chat | 1048K   |
| `gpt-4.1-nano`                            | chat | 1048K   |
| `gpt-4.1-nano-2025-04-14`                 | chat | 1048K   |
| `gpt-4o`                                  | chat | 128K    |
| `gpt-4o-2024-05-13`                       | chat | 128K    |
| `gpt-4o-2024-08-06`                       | chat | 128K    |
| `gpt-4o-2024-11-20`                       | chat | 128K    |
| `gpt-4o-mini`                             | chat | 128K    |
| `gpt-4o-mini-2024-07-18`                  | chat | 128K    |
| `gpt-4o-mini-realtime-preview`            | chat | 128K    |
| `gpt-4o-mini-realtime-preview-2024-12-17` | chat | 128K    |
| `gpt-4o-mini-search-preview`              | chat | 128K    |
| `gpt-4o-mini-search-preview-2025-03-11`   | chat | 128K    |
| `gpt-4o-realtime-preview`                 | chat | 128K    |
| `gpt-4o-search-preview`                   | chat | 128K    |
| `gpt-4o-search-preview-2025-03-11`        | chat | 128K    |
| `gpt-5-chat-latest`                       | chat | 128K    |
| `gpt-5-nano`                              | chat | 128K    |
| `gpt-5-nano-2025-08-07`                   | chat | 128K    |
| `gpt-5-pro`                               | chat | 128K    |
| `gpt-5-pro-2025-10-06`                    | chat | 128K    |
| `gpt-5-search-api`                        | chat | 128K    |
| `gpt-5-search-api-2025-10-14`             | chat | 128K    |
| `gpt-5.1`                                 | chat | 128K    |
| `gpt-5.1-2025-11-13`                      | chat | 128K    |
| `gpt-5.1-chat-latest`                     | chat | 128K    |
| `gpt-5.2`                                 | chat | 128K    |
| `gpt-5.2-2025-12-11`                      | chat | 128K    |
| `gpt-5.2-chat-latest`                     | chat | 128K    |
| `gpt-5.2-codex`                           | chat | 128K    |
| `gpt-5.3-chat-latest`                     | chat | 128K    |
| `gpt-5.3-codex`                           | chat | 128K    |
| `gpt-5.4`                                 | chat | 128K    |
| `gpt-5.4-2026-03-05`                      | chat | 128K    |
| `gpt-5.4-mini`                            | chat | 128K    |
| `gpt-5.4-mini-2026-03-17`                 | chat | 128K    |
| `gpt-5.4-nano`                            | chat | 128K    |
| `gpt-5.4-nano-2026-03-17`                 | chat | 128K    |
| `gpt-5.4-pro`                             | chat | 128K    |
| `gpt-5.4-pro-2026-03-05`                  | chat | 128K    |
| `gpt-5.5`                                 | chat | 1000K   |
| `gpt-5.5-2026-04-23`                      | chat | 1000K   |
| `gpt-5.5-pro`                             | chat | 1000K   |
| `o1`                                      | chat | 200K    |
| `o1-2024-12-17`                           | chat | 200K    |
| `o1-mini`                                 | chat | 200K    |
| `o1-preview`                              | chat | 200K    |
| `o3`                                      | chat | 200K    |
| `o3-2025-04-16`                           | chat | 200K    |
| `o3-mini`                                 | chat | 200K    |
| `o3-mini-2025-01-31`                      | chat | 200K    |
| `o4-mini`                                 | chat | 200K    |
| `o4-mini-2025-04-16`                      | chat | 200K    |

<Note>
  This table is auto-generated from the Verlon model registry on every sync — see the [live registry](/provider-compatibility/models#live-registry) for pricing, benchmarks, and deprecation dates. Any model listed here is available today.
</Note>

## Other modalities

* **audio** — 13 models
* **embeddings** — 3 models
* **image generation** — 6 models
* **moderation** — 2 models
* **speech-to-text** — 7 models
* **text-to-speech** — 7 models
* **video generation** — 2 models

Non-chat OpenAI models are called through the [Verlon SDK](/sdk-reference/overview) using the same model IDs — see the [SDK reference](/sdk-reference/overview) for modality-specific endpoints.

## Quickstart

<Note>
  First time? [Create a gate](/platform/gates) and grab an [API key](/getting-started/authentication) — the examples below need a `GATE_ID` and `VERLON_API_KEY`.
</Note>

The fastest path — Verlon SDK, one call:

```typescript theme={null}
import { Verlon } from '@verlon-ai/sdk';

const verlon = new Verlon({ apiKey: process.env.VERLON_API_KEY });

const response = await verlon.chat({
  gateId: process.env.GATE_ID,
  model: 'gpt-4o', // optional — overrides the gate's configured model
  data: {
    messages: [{ role: 'user', content: 'Hello!' }],
  },
});

console.log(response.content);
```

Any chat model from the table above works — swap `gpt-4o` for `gpt-5.4`, `o4-mini`, `o1-preview`, or any other ID.

## SDK compatibility

Verlon exposes an OpenAI-compatible endpoint. The official OpenAI SDK works unchanged — you swap two lines and every model in the table above becomes callable via the SDK you already know.

### Configuration — just two lines

<CodeGroup>
  ```typescript Before theme={null}
  import OpenAI from 'openai';

  const openai = new OpenAI({
    apiKey: process.env.OPENAI_API_KEY,
  });
  ```

  ```typescript After (Verlon) theme={null}
  import OpenAI from 'openai';

  const openai = new OpenAI({
    baseURL: 'https://api.verlon.ai/v1', // ← add this
    apiKey: process.env.VERLON_API_KEY,  // ← change this
  });
  ```
</CodeGroup>

### Specifying your gate

Verlon supports three ways to point a request at a gate:

<Tabs>
  <Tab title="Using gateId (Recommended)">
    ```typescript theme={null}
    // @ts-ignore - gateId is a Verlon AI extension
    const response = await openai.chat.completions.create({
      gateId: process.env.GATE_ID,
      messages: [{ role: 'user', content: 'Hello!' }],
    });
    ```

    <Note>
      Requires `@ts-ignore` in TypeScript, but the clearest intent.
    </Note>
  </Tab>

  <Tab title="Using model field">
    ```typescript theme={null}
    const response = await openai.chat.completions.create({
      model: process.env.GATE_ID, // gate UUID in the model slot
      messages: [{ role: 'user', content: 'Hello!' }],
    });
    ```

    <Tip>
      No TypeScript errors, drop-in with existing code.
    </Tip>
  </Tab>

  <Tab title="Using a default header">
    ```typescript theme={null}
    const openai = new OpenAI({
      baseURL: 'https://api.verlon.ai/v1',
      apiKey: process.env.VERLON_API_KEY,
      defaultHeaders: { 'X-Verlon-Gate-Id': process.env.GATE_ID },
    });

    // Every subsequent call inherits the gate
    const response = await openai.chat.completions.create({
      messages: [{ role: 'user', content: 'Hello!' }],
    });
    ```

    <Tip>
      Cleanest for TypeScript — set once, use everywhere.
    </Tip>
  </Tab>
</Tabs>

### Streaming

Identical behavior to the OpenAI SDK — `stream: true` returns an async iterable.

```typescript theme={null}
const stream = await openai.chat.completions.create({
  gateId: process.env.GATE_ID,
  messages: [{ role: 'user', content: 'Tell me a joke.' }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}
```

### Language coverage

<CodeGroup>
  ```typescript TypeScript theme={null}
  import OpenAI from 'openai';

  const openai = new OpenAI({
    baseURL: 'https://api.verlon.ai/v1',
    apiKey: process.env.VERLON_API_KEY,
  });

  const response = await openai.chat.completions.create({
    gateId: process.env.GATE_ID,
    messages: [{ role: 'user', content: 'Hello!' }],
  });

  console.log(response.choices[0].message.content);
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      base_url="https://api.verlon.ai/v1",
      api_key=os.environ["VERLON_API_KEY"],
  )

  response = client.chat.completions.create(
      model=os.environ["GATE_ID"],
      messages=[{"role": "user", "content": "Hello!"}],
  )

  print(response.choices[0].message.content)
  ```

  ```bash cURL theme={null}
  curl https://api.verlon.ai/v1/chat/completions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $VERLON_API_KEY" \
    -d '{
      "gateId": "'"$GATE_ID"'",
      "messages": [{"role": "user", "content": "Hello!"}]
    }'
  ```
</CodeGroup>

### What's supported

<AccordionGroup>
  <Accordion title="Streaming">
    Full support for `stream: true`, identical semantics to OpenAI.
  </Accordion>

  <Accordion title="Tool / function calling">
    Fully supported. Verlon translates across providers if your gate routes to Claude, Gemini, etc.
  </Accordion>

  <Accordion title="Vision">
    Image inputs (`type: 'image_url'`) work with any vision-capable model.
  </Accordion>

  <Accordion title="Standard parameters">
    `temperature`, `max_tokens`, `top_p`, `frequency_penalty`, `presence_penalty`, `logprobs`, and the rest — all passed through.
  </Accordion>

  <Accordion title="Usage + cost tracking">
    Standard `response.usage` with token counts, plus Verlon's `cost` field with per-call dollar amount.
  </Accordion>
</AccordionGroup>

## Responses API

Verlon is also a drop-in for OpenAI's **Responses API** (`client.responses.create`) — the surface the OpenAI Agents SDK and multi-turn tool loops with encrypted reasoning replay are built on. Point `baseURL` at Verlon and pass your gate id as `model`, exactly like chat completions.

```python theme={null}
from openai import OpenAI

client = OpenAI(base_url="https://api.verlon.ai/v1", api_key="sk-vrln-...")

resp = client.responses.create(
    model="<your-gate-id>",
    input=[{"role": "user", "content": "What's the weather in Tokyo?"}],
    tools=[weather_tool],
)
```

<Note>
  **Multi-turn tool loops with reasoning replay work.** On each turn, echo the
  prior `reasoning` and `function_call` items back in `input` — Verlon requests
  `include: ['reasoning.encrypted_content']` for reasoning models and passes the
  encrypted reasoning through untouched, so the model keeps its chain of thought
  across tool calls.
</Note>

<AccordionGroup>
  <Accordion title="Stateless only (v1)">
    `store: true` and `previous_response_id` are **not** supported — Verlon
    holds no server-side conversation state (matching our zero-data-retention
    default). Send the full `input` each turn, echoing prior `reasoning` /
    `function_call` items back. Requests using `store: true` or
    `previous_response_id` return `400`.
  </Accordion>

  <Accordion title="OpenAI-backed gates only">
    The Responses API is OpenAI-specific. A gate that resolves to Anthropic,
    Google, or Mistral returns `400` — use `/v1/chat/completions` for those,
    which normalizes tool calls across providers.
  </Accordion>

  <Accordion title="Streaming">
    `stream: true` returns the named-event SSE stream (`event: response.created`,
    `response.output_text.delta`, `response.completed`, …) verbatim.
  </Accordion>
</AccordionGroup>

## Migrating an existing OpenAI app

<Steps>
  <Step title="Update client initialization">
    Swap `baseURL` + `apiKey`. Two lines.
  </Step>

  <Step title="Add a gate reference">
    Pass `gateId` (or set the default header). The `model` field, `messages`, and everything else stay the same.
  </Step>

  <Step title="Test in development">
    Verify requests appear in the Verlon dashboard and cost tracking works.
  </Step>

  <Step title="Deploy">
    Ship. If anything breaks, revert the two-line diff — takes 30 seconds.
  </Step>
</Steps>

## How it works

1. **You send** an OpenAI-format request to `https://api.verlon.ai/v1/chat/completions`
2. **Verlon receives** — validates the gate, applies routing rules
3. **Verlon routes** to whichever model your gate points at (GPT, Claude, Gemini, Mistral, or anything else in the registry)
4. **The provider responds** in its native format
5. **Verlon normalizes** back to OpenAI format
6. **You receive** a standard OpenAI response with an added `cost` field

Your code doesn't know the difference.

## Errors

Errors come back OpenAI-shaped — `{ "error": { "message", "type", "code", "param" } }` — so the OpenAI SDK's error classes work unchanged.

| Status | Meaning             | What to check                                                                                        |
| ------ | ------------------- | ---------------------------------------------------------------------------------------------------- |
| `400`  | Invalid request     | Malformed body or missing `gateId`                                                                   |
| `401`  | Invalid API key     | Your `VERLON_API_KEY` value and the `Authorization: Bearer` header                                   |
| `404`  | Gate not found      | Your `GATE_ID` — the error message names the offending ID                                            |
| `429`  | Rate limit exceeded | Back off and retry; the body includes `reset_at`, and every response carries `X-RateLimit-*` headers |

```typescript theme={null}
try {
  const response = await openai.chat.completions.create({
    gateId: process.env.GATE_ID,
    messages: [{ role: 'user', content: 'Hello!' }],
  });
} catch (error) {
  if (error.status === 404) {
    console.error('Gate not found — check GATE_ID');
  } else if (error.status === 429) {
    console.error('Rate limited — retry after the reset');
  } else {
    throw error;
  }
}
```

## FAQ

<AccordionGroup>
  <Accordion title="Do I need to change my request code?">
    No. Change `baseURL` + `apiKey` in the client. The completion calls stay identical.
  </Accordion>

  <Accordion title="Can I still call OpenAI directly?">
    Yes. Revert `baseURL` + `apiKey` to OpenAI values and you're back on their API.
  </Accordion>

  <Accordion title="Can I route a Claude or Gemini model through the OpenAI SDK?">
    Yes — that's the point. Configure your gate to route to any model in the [registry](/provider-compatibility/models) and your OpenAI SDK code stays the same.
  </Accordion>

  <Accordion title="Does the Vercel AI SDK work?">
    Yes. Its OpenAI adapter works against Verlon's endpoint unchanged.
  </Accordion>

  <Accordion title="Do I need the Verlon SDK?">
    No. This whole guide uses only the OpenAI SDK.
  </Accordion>
</AccordionGroup>

## Full non-chat model list

Every non-chat OpenAI model Verlon routes to, grouped by modality. Chat models are in the table near the top of this page.

### Audio

| Model ID                               |
| -------------------------------------- |
| `gpt-4o-audio-preview`                 |
| `gpt-4o-audio-preview-2024-12-17`      |
| `gpt-4o-audio-preview-2025-06-03`      |
| `gpt-4o-mini-audio-preview`            |
| `gpt-4o-mini-audio-preview-2024-12-17` |
| `gpt-audio`                            |
| `gpt-audio-1.5`                        |
| `gpt-audio-2025-08-28`                 |
| `gpt-audio-mini`                       |
| `gpt-audio-mini-2025-10-06`            |
| `gpt-audio-mini-2025-12-15`            |
| `gpt-realtime-2`                       |
| `gpt-realtime-translate`               |

### Embeddings

| Model ID                 |
| ------------------------ |
| `text-embedding-3-large` |
| `text-embedding-3-small` |
| `text-embedding-ada-002` |

### Image generation

| Model ID                 |
| ------------------------ |
| `chatgpt-image-latest`   |
| `gpt-image-1`            |
| `gpt-image-1-mini`       |
| `gpt-image-1.5`          |
| `gpt-image-2`            |
| `gpt-image-2-2026-04-21` |

### Moderation

| Model ID                     |
| ---------------------------- |
| `omni-moderation-2024-09-26` |
| `omni-moderation-latest`     |

### Speech-to-text

| Model ID                            |
| ----------------------------------- |
| `gpt-4o-mini-transcribe`            |
| `gpt-4o-mini-transcribe-2025-03-20` |
| `gpt-4o-mini-transcribe-2025-12-15` |
| `gpt-4o-transcribe`                 |
| `gpt-4o-transcribe-diarize`         |
| `gpt-realtime-whisper`              |
| `whisper-1`                         |

### Text-to-speech

| Model ID                     |
| ---------------------------- |
| `gpt-4o-mini-tts`            |
| `gpt-4o-mini-tts-2025-03-20` |
| `gpt-4o-mini-tts-2025-12-15` |
| `tts-1`                      |
| `tts-1-1106`                 |
| `tts-1-hd`                   |
| `tts-1-hd-1106`              |

### Video generation

| Model ID     |
| ------------ |
| `sora-2`     |
| `sora-2-pro` |

## Related

* [Anthropic](/provider-compatibility/anthropic) · [Google](/provider-compatibility/google) · [Mistral](/provider-compatibility/mistral)
* [Verlon SDK reference](/sdk-reference/overview) — full-feature native SDK for new projects
* [Gates](/platform/gates) — set up routing rules and model configuration
* [Bring your own key](/platform/byok) — use your own OpenAI account for provider costs
* [OpenAI's official docs ↗](https://platform.openai.com/docs)
