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

# Introduction

> Routify provides an OpenAI-compatible API — no SDK changes needed.

Routify is a drop-in replacement for the OpenAI API. Just change `base_url` and `api_key` — your existing code works as-is.

## Base URL

```
https://api.routify.ru/v1
```

## Quick Start

<CodeGroup>
  ```python Python theme={null}
  import os
  from openai import OpenAI

  client = OpenAI(
      base_url="https://api.routify.ru/v1",
      api_key=os.environ.get("ROUTIFY_API_KEY"),
  )

  completion = client.chat.completions.create(
      model="gpt-4.1",
      messages=[
          {"role": "user", "content": "Hello!"}
      ]
  )

  print(completion.to_json())
  ```

  ```javascript Node.js theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    baseURL: "https://api.routify.ru/v1",
    apiKey: process.env.ROUTIFY_API_KEY,
  });

  const completion = await client.chat.completions.create({
    model: "gpt-4.1",
    messages: [{ role: "user", content: "Hello!" }],
  });

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

  ```bash cURL theme={null}
  curl https://api.routify.ru/v1/chat/completions \
    -H "Authorization: Bearer $ROUTIFY_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "gpt-4.1",
      "messages": [{"role": "user", "content": "Hello!"}]
    }'
  ```
</CodeGroup>

<Accordion title="Response">
  ```json theme={null}
  {
    "id": "chatcmpl-...",
    "object": "chat.completion",
    "created": 1772345678,
    "model": "gpt-4.1",
    "choices": [
      {
        "index": 0,
        "finish_reason": "stop",
        "message": {
          "role": "assistant",
          "content": "Hello! How can I help you today?"
        }
      }
    ],
    "usage": {
      "prompt_tokens": 10,
      "completion_tokens": 9,
      "total_tokens": 19
    }
  }
  ```
</Accordion>

## Authentication

All requests require a Bearer token:

```
Authorization: Bearer $ROUTIFY_API_KEY
```

## Supported Endpoints

| Endpoint                    | Description                        |
| --------------------------- | ---------------------------------- |
| `POST /v1/chat/completions` | OpenAI-compatible chat completions |
| `POST /v1/responses`        | Native OpenAI Responses API proxy  |
| `GET /v1/models`            | List available models              |
