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

# API Reference

> Complete reference for all LLM Router API endpoints, request formats, and supported features.

***

# API Reference

The **LLM Router API** is fully compatible with the OpenAI API specification, allowing you to switch from OpenAI (or any other provider) with minimal or zero code changes.

**Base URL**

```
https://api.llmrouter.app/v1
```

All requests require authentication using your LLM Router API key:

```http theme={null}
Authorization: Bearer sk_llmr_your_api_key_here
```

***

## Supported Endpoints

| Endpoint | Method | Description |
| - | - | - |
| `/chat/completions` | POST | Main chat completions endpoint (most used) |
| `/messages` | POST | Simplified message-based conversations |
| `/embeddings` | POST | Generate embeddings for text |
| `/images/generations` | POST | Generate images (DALL·E, Flux, etc.) |
| `/models` | GET | List all available models |
| `/models/{id}` | GET | Get details about a specific model |
| `/responses` | POST | Responses API (OpenAI Responses API) |

***

## Core Features

LLM Router extends the standard OpenAI format with a powerful `gateway` object that enables:

* Intelligent model routing using tags
* Automatic Skill injection (`enableAutoSearch`)
* Zero Data Retention (ZDR)
* Context compression & pruning
* PII redaction
* Custom routing rules

### Example Request with Advanced Features

```json theme={null}
{
  "model": "anthropic/claude-opus-4.6",
  "messages": [
    { "role": "user", "content": "Write a new billing webhook handler" }
  ],
  "gateway": {
    "zdr": true,
    "skills": {
      "skillIds": ["stripe-api", "node-best-practices"],
      "enableAutoSearch": true
    },
    "tags": ["coding", "backend"]
  }
}
```

***

## Philosophy

LLM Router gives you the best of both worlds:

* **Full OpenAI compatibility** → Drop-in replacement
* **Powerful extensions** → Smart routing, Skills, privacy, and optimization

You can start simple (just change the base URL) and gradually unlock advanced features as needed.


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