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

# OpenRouter

> Integrate OpenRouter models through the Adaline Proxy for automatic telemetry and observability.

# OpenRouter

Integrate OpenRouter through the Adaline Proxy to automatically capture telemetry — requests, responses, token usage, latency, and costs — with minimal code changes. OpenRouter uses an OpenAI-compatible API, giving you access to models from multiple providers through a single key.

## Supported Models

OpenRouter accepts any model available on its platform. Popular models include:

**Chat Models**

| Model | Provider |
| - | - |
| `openai/gpt-4o` | OpenAI |
| `openai/o3` | OpenAI |
| `anthropic/claude-sonnet-4.5` | Anthropic |
| `anthropic/claude-opus-4` | Anthropic |
| `google/gemini-2.5-pro` | Google |
| `google/gemini-2.5-flash` | Google |
| `meta-llama/llama-3.1-405b-instruct` | Meta |
| `mistralai/mixtral-8x7b-instruct` | Mistral AI |
| `deepseek/deepseek-r1` | DeepSeek |
| `x-ai/grok-4` | xAI |

> [!NOTE]
>
> OpenRouter provides access to 300+ models from many providers through a single API key. See the [OpenRouter models page](https://openrouter.ai/models) for the full list.

## Proxy Base URL

```
https://gateway.adaline.ai/v1/open-router/
```

## Prerequisites

1. An [OpenRouter API key](https://openrouter.ai/keys)
2. An [Adaline API key](https://www.adaline.ai/docs/admin/create-api-keys.md), project ID, and prompt ID

## Chat Completions

### Complete Chat

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

client = OpenAI(
    api_key="your-open-router-api-key",
    base_url="https://gateway.adaline.ai/v1/open-router/"
)

headers = {
    "adaline-api-key": "your-adaline-api-key",
    "adaline-project-id": "your-project-id",
    "adaline-prompt-id": "your-prompt-id"
}

response = client.chat.completions.create(
    model="anthropic/claude-3.5-sonnet",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What is the difference between various AI models?"}
    ],
    extra_headers=headers
)

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

```typescript TypeScript theme={null}
import OpenAI from "openai";

// OpenRouter is OpenAI-compatible
const client = new OpenAI({
  apiKey: "your-open-router-api-key",
  baseURL: "https://gateway.adaline.ai/v1/open-router/",
});

const response = await client.chat.completions.create(
  {
    model: "anthropic/claude-3.5-sonnet",
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: "What is the difference between various AI models?" },
    ],
  },
  {
    headers: {
      "adaline-api-key": "your-adaline-api-key",
      "adaline-project-id": "your-project-id",
      "adaline-prompt-id": "your-prompt-id",
    },
  }
);

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

### Stream Chat

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

client = OpenAI(
    api_key="your-open-router-api-key",
    base_url="https://gateway.adaline.ai/v1/open-router/"
)

headers = {
    "adaline-api-key": "your-adaline-api-key",
    "adaline-project-id": "your-project-id",
    "adaline-prompt-id": "your-prompt-id"
}

stream = client.chat.completions.create(
    model="openai/gpt-4-turbo",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Compare different programming languages for AI development."}
    ],
    stream=True,
    extra_headers=headers
)

for chunk in stream:
    if chunk.choices[0].delta.content is not None:
        print(chunk.choices[0].delta.content, end="")
```

## Next Steps

* [Multi-Step Workflows](https://www.adaline.ai/docs/integrations/examples/multi-step-workflows.md) — RAG pipelines, multi-step generation, and conversational agents
* [Headers Reference](https://www.adaline.ai/docs/reference/proxy/headers.md) — Complete header documentation

***

> [card] [Back to Integrations](https://www.adaline.ai/docs/integrations/introduction.md)
>
> Browse all integrations


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