> ## 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        |

<Info>
  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.
</Info>

## 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](/docs/admin/create-api-keys), project ID, and prompt ID

## Chat Completions

### Complete Chat

<CodeGroup>
  ```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);
  ```
</CodeGroup>

### Stream Chat

<CodeGroup>
  ```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="")
  ```
</CodeGroup>

## Next Steps

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

***

<Card title="Back to Integrations" icon="arrow-left" href="/docs/integrations/introduction">
  Browse all integrations
</Card>
