---
title: "Models & protocols"
description: "Every pirouter model ID uses vendor/model, including openai/gpt-6.2-sol, openai/gpt-6.2-astra, anthropic/claude-opus-5.5 and google/gemini-4-hydrogen. Each model accepts only its listed protocols: OpenAI, Anthropic or Gemini. OpenAI GPT text models also accept the Anthropic protocol; no other model is translated."
canonical: "https://pirouter.ai/docs/models"
last-updated: "2026-11-19"
lang: "en"
source: "content/docs/en/(start)/models.mdx"
---

# Models & protocols

Every pirouter model ID uses vendor/model, including openai/gpt-6.2-sol, openai/gpt-6.2-astra, anthropic/claude-opus-5.5 and google/gemini-4-hydrogen. Each model accepts only its listed protocols: OpenAI, Anthropic or Gemini. OpenAI GPT text models also accept the Anthropic protocol; no other model is translated.

A call has to get two things right: the model ID, written as `vendor/model`, and a protocol that model accepts. The catalog includes [GPT-6.2 Sol](https://pirouter.ai/models/openai/gpt-6.2-sol), [GPT-6.2 Astra](https://pirouter.ai/models/openai/gpt-6.2-astra), [Gemini 4 Argon](https://pirouter.ai/models/google/gemini-4-argon), [Gemini 4 Carbon](https://pirouter.ai/models/google/gemini-4-carbon) and [Gemini 4 Hydrogen](https://pirouter.ai/models/google/gemini-4-hydrogen); each model page shows its full ID and supported protocols. Apart from GPT text models also accepting the Anthropic protocol, pirouter does not translate between protocols; the wrong one returns `422`, and the `message` lists the endpoints the model can be called on.

The [public endpoint listing](https://api.pirouter.ai/v1/models/google/gemini-4-carbon/endpoints) for [Gemini 4 Carbon](https://pirouter.ai/models/google/gemini-4-carbon) names OpenAI Chat Completions, OpenAI Responses and Gemini generateContent. It does not list Anthropic Messages.

## Model IDs

A model ID is written as `vendor/model`: the vendor name and the model name, joined by one slash.

Listing every model needs no key:

```bash
$ curl https://api.pirouter.ai/v1/models
```

The response is a `data` array; the `id` of each entry is the model ID to use in a call.

A name the gateway does not know returns `404` with the error code `model_not_found`.

### Aliases

A model can have aliases, usually the name without the vendor prefix. An alias works the same as the full ID.

The gateway looks up the full ID first, and the alias only when that finds nothing. An alias must match exactly as registered: it is case-sensitive, with no prefix completion and no fuzzy matching. Whichever name you call with, logs and billing record the full ID.

To see a model's aliases, read `aliases` in the response of `GET /v1/models/{vendor}/{model}/endpoints`.

### Dated versions

An ID never changes the version it serves, and neither do its aliases. When a vendor releases a new version of a model, the new version is listed under an ID of its own with the release date appended: `deepseek/deepseek-v4.1-flash` stays on the September 10 version, and the October 17 version is `deepseek/deepseek-v4.1-flash-1017`.

To always call the newest version of a family, use its `-latest` alias, currently `deepseek-flash-latest`. When a new version is listed, the alias moves to it. Logs and billing record the full ID of the version that served the call.

## The three protocols

- **OpenAI**: the SDK base URL is `https://api.pirouter.ai/v1`. The endpoints are `POST /v1/chat/completions`, `POST /v1/responses`, `POST /v1/images/generations` and `POST /v1/images/edits`. The model ID goes in `model` in the body; to stream, add `"stream": true` to the body.
- **Anthropic**: the SDK base URL is `https://api.pirouter.ai`. The endpoint is `POST /v1/messages`. The model ID goes in `model` in the body; to stream, add `"stream": true` to the body.
- **Gemini**: the SDK base URL is `https://api.pirouter.ai`. The endpoint is `POST /v1beta/models/{model}:generateContent`; to stream, call `POST /v1beta/models/{model}:streamGenerateContent` instead. The model ID goes in the path.

All endpoints are under `https://api.pirouter.ai`. For the full use of each protocol, see [OpenAI protocol](https://pirouter.ai/docs/api/openai.md), [Anthropic protocol](https://pirouter.ai/docs/api/anthropic.md) and [Gemini protocol](https://pirouter.ai/docs/api/gemini.md).

The SDK adds the rest of the path to the base URL: `/chat/completions` for OpenAI, `/v1/messages` for Anthropic, and `/v1beta` plus the model ID for Gemini.

![The base URL set in an SDK is only the start of the request path: the OpenAI base URL already ends in /v1, while for Anthropic and Gemini the SDK adds the version segment itself, /v1/messages and /v1beta followed by the model ID in the path.](https://pirouter.ai/docs/diagrams/base-url-anatomy.en.svg)

## Which protocols each model accepts

A model can only be called on a protocol it accepts. Some models accept one protocol; others accept the OpenAI protocol as well as their vendor's own. A few examples:

| Model ID                        | OpenAI | Anthropic | Gemini |
| ------------------------------- | ------ | --------- | ------ |
| `openai/gpt-6.2-astra`          | Yes    | Yes       | No     |
| `anthropic/claude-opus-5.5`     | Yes    | Yes       | No     |
| `google/gemini-4-carbon`        | Yes    | No        | Yes    |
| `google/gemini-nano-banana-2.1` | Yes    | No        | Yes    |
| `bytedance/seed-2.1-pro`        | Yes    | Yes       | No     |
| `openai/gpt-image-2`            | Yes    | No        | No     |

- [Browse all models](https://pirouter.ai/models): Each model's page shows the protocols it accepts, its prices and its providers.

### GPT models also accept the Anthropic protocol

OpenAI GPT text models (chat models whose ID starts with `openai/gpt-`, excluding the `openai/gpt-image-` image models) accept the Anthropic protocol as well as the OpenAI protocol: you can call `POST /v1/messages` on them with the Anthropic SDK or Claude Code. pirouter turns such a request into an OpenAI Responses request for the provider and turns the answer back into the Anthropic format. This is the only protocol translation pirouter does.

A few things behave differently from Claude models after the translation: `stop_sequences` has no effect, and thinking from an earlier turn is not handed back to the model. See [Anthropic protocol: calling GPT models](https://pirouter.ai/docs/api/anthropic.md#calling-gpt-models).

To check one model through the API, read `protocols` in the response of `GET /v1/models/{vendor}/{model}/endpoints`.

A protocol has several endpoints, and a model does not have to serve all of them. Image models serve `POST /v1/images/generations` and no chat endpoint; depending on the model they also serve `POST /v1/images/edits`, or `generateContent` on the Gemini protocol. `supported_endpoints` in the same response lists the endpoints a model serves.

> **Note:** An empty `supported_endpoints` list means every endpoint of the protocols the model accepts, not none.

## Protocol mismatch

Calling a model on a protocol it does not accept, or on an endpoint it does not serve, returns `422` with the error code `validation_failed`, and the `message` lists the endpoints that model serves. The request goes to no provider and is not billed; see [Requests that fail](https://pirouter.ai/docs/guides/billing.md#requests-that-fail).

```json
{
  "error": {
    "message": "This model is not served on the endpoint you called. Call it on POST /v1/images/generations or POST /v1beta/models/{model}:generateContent.",
    "type": "invalid_request_error",
    "code": "validation_failed"
  }
}
```

When you get this error, switch to an endpoint the `message` lists, or pick a model that serves the endpoint you are calling.

## Calling each protocol

Each of the three samples uses a model that accepts its protocol, so you can run them as they are.

### OpenAI protocol

cURL:

```bash
curl https://api.pirouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $PIROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-6.2-astra",
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'
```

Python:

```python
import os
from openai import OpenAI

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

completion = client.chat.completions.create(
    model="openai/gpt-6.2-astra",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(completion.choices[0].message.content)
```

TypeScript:

```ts
import OpenAI from 'openai'

const client = new OpenAI({
  baseURL: 'https://api.pirouter.ai/v1',
  apiKey: process.env.PIROUTER_API_KEY,
})

const completion = await client.chat.completions.create({
  model: 'openai/gpt-6.2-astra',
  messages: [{ role: 'user', content: 'Hello!' }],
})
console.log(completion.choices[0].message.content)
```

To stream, add `"stream": true` to the body; see [Stream the response](https://pirouter.ai/docs/quickstart.md#stream-the-response) in the quickstart.

### Anthropic protocol

The SDK's base URL has no `/v1`; the SDK adds it.

cURL:

```bash
curl https://api.pirouter.ai/v1/messages \
  -H "x-api-key: $PIROUTER_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-5.5",
    "max_tokens": 1024,
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'
```

Python:

```python
import os
import anthropic

client = anthropic.Anthropic(
    base_url="https://api.pirouter.ai",
    api_key=os.environ["PIROUTER_API_KEY"],
)

message = client.messages.create(
    model="anthropic/claude-opus-5.5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)
print(message.content[0].text)
```

TypeScript:

```ts
import Anthropic from '@anthropic-ai/sdk'

const client = new Anthropic({
  baseURL: 'https://api.pirouter.ai',
  apiKey: process.env.PIROUTER_API_KEY,
})

const message = await client.messages.create({
  model: 'anthropic/claude-opus-5.5',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Hello!' }],
})
console.log(message.content[0].text)
```

To stream, add `"stream": true` to the body and pass `-N` to curl:

```bash
curl -N https://api.pirouter.ai/v1/messages \
  -H "x-api-key: $PIROUTER_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-5.5",
    "stream": true,
    "max_tokens": 1024,
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'
```

The server-sent events arrive as pairs of lines, `event: ` then `data: `. The first event is `message_start` and the last is `message_stop`.

### Gemini protocol

The SDK adds `/v1beta` itself. When you create the client, also add an `Authorization: Bearer` header through the `headers` of `http_options` (`httpOptions` in TypeScript), or requests return `401`; [Authentication & API keys](https://pirouter.ai/docs/authentication.md#send-the-key-with-a-request) explains why.

cURL:

```bash
curl "https://api.pirouter.ai/v1beta/models/google/gemini-4-carbon:generateContent" \
  -H "Authorization: Bearer $PIROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{ "parts": [{ "text": "Hello!" }] }]
  }'
```

Python:

```python
import os
from google import genai
from google.genai import types

client = genai.Client(
    api_key=os.environ["PIROUTER_API_KEY"],
    http_options=types.HttpOptions(
        base_url="https://api.pirouter.ai",
        headers={"Authorization": f"Bearer {os.environ['PIROUTER_API_KEY']}"},
    ),
)

response = client.models.generate_content(
    model="google/gemini-4-carbon",
    contents="Hello!",
)
print(response.text)
```

TypeScript:

```ts
import { GoogleGenAI } from '@google/genai'

const ai = new GoogleGenAI({
  apiKey: process.env.PIROUTER_API_KEY,
  httpOptions: {
    baseUrl: 'https://api.pirouter.ai',
    headers: { Authorization: `Bearer ${process.env.PIROUTER_API_KEY}` },
  },
})

const response = await ai.models.generateContent({
  model: 'google/gemini-4-carbon',
  contents: 'Hello!',
})
console.log(response.text)
```

To stream, call `streamGenerateContent` in place of `generateContent`. The body stays the same, with no `stream` field:

```bash
curl -N "https://api.pirouter.ai/v1beta/models/google/gemini-4-carbon:streamGenerateContent" \
  -H "Authorization: Bearer $PIROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{ "parts": [{ "text": "Hello!" }] }]
  }'
```

Each server-sent event is one `data: ` line that carries one piece of the reply in `candidates`. The last one carries `finishReason` and the token counts in `usageMetadata`; no closing marker follows it.

## Capability flags

Each model carries a set of capability flags that say what it supports. The common ones:

| Capability        | Flag                                                      | Meaning                                                       |
| ----------------- | --------------------------------------------------------- | ------------------------------------------------------------- |
| Tool calling      | `supports_function_calling`                               | Can call tools and functions                                  |
| Structured output | `supports_structured_outputs`, `supports_response_schema` | Output constrained by a JSON schema; a JSON `response_format` |
| Vision            | `supports_vision`                                         | Accepts image input                                           |
| Caching           | `supports_prompt_caching`                                 | Supports prompt caching                                       |
| Reasoning         | `supports_reasoning`                                      | Supports extended thinking and produces reasoning tokens      |

To see a model's flags, read `capabilities` in the response of `GET /v1/models/{vendor}/{model}/endpoints`.

## Next steps

- [Pricing & billing](https://pirouter.ai/docs/guides/billing.md): How each kind of token is priced and how the wallet is charged.
- [API reference](https://pirouter.ai/docs/api.md): The endpoints behind each protocol.
