---
title: "Introduction"
description: "pirouter is an LLM router: one API to access models from OpenAI, Anthropic, Google and more, with every request routed to the best upstream."
canonical: "https://pirouter.ai/docs"
last-updated: "2026-10-13"
lang: "en"
source: "content/docs/en/(start)/index.mdx"
---

# The Best Router for LLMs

pirouter is an LLM router: one API to access models from OpenAI, Anthropic, Google and more, with every request routed to the best upstream. One key works across the OpenAI, Anthropic and Gemini protocols.

- [Quickstart](https://pirouter.ai/docs/quickstart.md)
- [API reference](https://pirouter.ai/docs/api.md)

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-sol",
    "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-sol",
    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-sol',
  messages: [{ role: 'user', content: 'Hello!' }],
})
console.log(completion.choices[0].message.content)
```

## SDK base URLs

- OpenAI: `https://api.pirouter.ai/v1`
- Anthropic: `https://api.pirouter.ai`
- Gemini: `https://api.pirouter.ai`

These are the values to set as the base URL in each official SDK. The key is the same for all three. If you already use one of these SDKs, you only change the base URL and the key. The rest of your code stays as it is.

For the full paths when you send HTTP requests directly, see [The three protocols](https://pirouter.ai/docs/models.md#the-three-protocols).

## Start here

- [Make your first request](https://pirouter.ai/docs/quickstart.md): Create a key, add credit and call a model.
- [Connect your tools](https://pirouter.ai/docs/integrations.md): Point the official SDKs and your coding tools at pirouter.
- [Browse the API](https://pirouter.ai/docs/api.md): Every endpoint, grouped by the protocol it speaks.

## Before you integrate

- [Authentication & API keys](https://pirouter.ai/docs/authentication.md): Which header carries the key, and how keys are created, expire and are revoked.
- [Models & protocols](https://pirouter.ai/docs/models.md): How model IDs are written and which protocols each model accepts.
- [Pricing & billing](https://pirouter.ai/docs/billing.md): How the prepaid wallet is charged, how to add credit, and what happens when it runs out.
