# OpenRouter

[OpenRouter](https://openrouter.ai/) is a unified platform that provides developers with seamless access to a wide range of large language models (LLMs) through a single OpenAI-compatible API interface. It enables model interoperability by allowing users to easily route requests between open-source and proprietary models while managing authentication, quotas, and usage tracking in one place.&#x20;

This tutorial will guide you through utilizing Arcee AI's language models on OpenRouter using an OpenAI-compatible endpoint.

***

**Prerequisites**

* OpenRouter Account
  * If you don't have an account, set one up [here](https://openrouter.ai/).
* OpenRouter API Key
  * If you don't have an API Key, create one [here](https://openrouter.ai/settings/keys).
* `openai` Python SDK (install using uv or pip)

**Quickstart**

Run a completion with an Arcee model on OpenRouter

```bash
from openai import OpenAI

# Initialize OpenRouter-compatible client
client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="<OPENROUTER_API_KEY>",
)

# Run a chat completion
completion = client.chat.completions.create(
    model="arcee-ai/trinity-mini",
    messages=[
        {
            "role": "user",
            "content": "What are small language models and how do they compare to LLMs?"
        }
    ]
)

# Print result
print(completion.choices[0].message.content)

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.arcee.ai/get-started/integration-list/openrouter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
