# OpenRouter — Orthogonal API

> Pay-per-use API on Orthogonal. Each call is billed to your Orthogonal balance.
> Base API: `https://api.orthogonal.com/v1/run` · [llms.txt](https://orthogonal.com/llms.txt) · [browse all APIs](https://orthogonal.com/discover)

Unified API gateway for 300+ LLMs, embeddings, reranking, image generation, video generation, TTS, and transcription. Access models from OpenAI, Anthropic, Google, Meta, Mistral, and many more through a single API.

**Verified:** no

## Access

**Run API:** `POST https://api.orthogonal.com/v1/run`
**Auth:** `Authorization: Bearer $ORTHOGONAL_API_KEY`
Get an API key at https://orthogonal.com/dashboard/settings/api-keys

Every call goes through the unified Run API: send the API `slug`, the endpoint `path`, and the `query`/`body` parameters. The response is `{ "success": true, "price": "<usd>", "data": { ... } }`.

## Endpoints

### Chat Completion

Send a chat conversation to any supported LLM and get a completion response. Supports streaming, tool calling, vision, and more.

`POST /chat/completions`

**Estimated cost:** Dynamic — use `"dryRun": true` in the Run API request to check the exact cost before calling.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | No | Model identifier (e.g. openai/gpt-4o, anthropic/claude-sonnet-4, google/gemini-2.5-flash) |
| `messages` | array | Yes | List of messages for the conversation. Each message has role (system/user/assistant/tool) and content. |
| `max_tokens` | number | No | Maximum tokens in the completion response |
| `temperature` | number | No | Sampling temperature (0-2) |
| `top_p` | number | No | Nucleus sampling threshold (0-1) |
| `stream` | boolean | No | Whether to stream the response |
| `tools` | array | No | List of tools/functions the model can call |
| `tool_choice` | string | No | Controls tool calling behavior: auto, none, required, or specific function |
| `frequency_penalty` | number | No | Frequency penalty (-2.0 to 2.0) |
| `presence_penalty` | number | No | Presence penalty (-2.0 to 2.0) |
| `stop` | array | No | Stop sequences to halt generation |
| `response_format` | object | No | Format constraint (e.g. json_object, json_schema) |

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/chat/completions","body":{"model":"<string>","messages":"<array>","max_tokens":"<number>","temperature":"<number>","top_p":"<number>","stream":"<boolean>","tools":"<array>","tool_choice":"<string>","frequency_penalty":"<number>","presence_penalty":"<number>","stop":"<array>","response_format":"<object>"}}'
```

### Transcribe Audio

Transcribe audio into text. Accepts base64-encoded audio input.

`POST /audio/transcriptions`

**Estimated cost:** Dynamic — use `"dryRun": true` in the Run API request to check the exact cost before calling.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | STT model identifier |
| `input_audio` | object | Yes | Audio input object with data (base64) and format fields |
| `language` | string | No | ISO-639-1 language code (e.g. en, ja) |
| `response_format` | string | No | Output format: json or verbose_json |
| `temperature` | number | No | Sampling temperature for transcription |

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/audio/transcriptions","body":{"model":"<string>","input_audio":"<object>","language":"<string>","response_format":"<string>","temperature":"<number>"}}'
```

### List Models

List all available models with pricing, context length, capabilities, and supported parameters.

`GET /models`

**Cost:** Free

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `q` | string | No | Free-text search by model name or slug |
| `category` | string | No | Filter by use case category |
| `sort` | string | No | Sort field (top-weekly, newest, name, context, pricing) |
| `limit` | number | No | Max records to return (max 1000) |
| `offset` | number | No | Records to skip for pagination |
| `output_modalities` | string | No | Filter by output modality (text, image, audio, video) |
| `input_modalities` | string | No | Filter by input modality (text, image, audio, file) |
| `context` | number | No | Minimum context length in tokens |
| `max_price` | number | No | Maximum prompt price in $/M tokens |
| `arch` | string | No | Filter by architecture (GPT, Claude, Gemini, Llama) |
| `providers` | string | No | Filter by hosting provider (comma-separated) |

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/models","method":"GET","query":{"q":"<string>","category":"<string>","sort":"<string>","limit":"<number>","offset":"<number>","output_modalities":"<string>","input_modalities":"<string>","context":"<number>","max_price":"<number>","arch":"<string>","providers":"<string>"}}'
```

### Create Response

Create a response using the OpenAI Responses API format. Supports streaming, tool use, and web search.

`POST /responses`

**Estimated cost:** Dynamic — use `"dryRun": true` in the Run API request to check the exact cost before calling.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | No | Model identifier |
| `input` | string | No | Input text or array of input items |
| `instructions` | string | No | System instructions for the model |
| `max_output_tokens` | number | No | Maximum output tokens |
| `temperature` | number | No | Sampling temperature |
| `tools` | array | No | Tools available to the model |
| `stream` | boolean | No | Whether to stream the response |

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/responses","body":{"model":"<string>","input":"<string>","instructions":"<string>","max_output_tokens":"<number>","temperature":"<number>","tools":"<array>","stream":"<boolean>"}}'
```

### Rerank

Rerank a list of documents by relevance to a query.

`POST /rerank`

**Estimated cost:** Dynamic — use `"dryRun": true` in the Run API request to check the exact cost before calling.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Reranking model identifier |
| `query` | string | Yes | The query to rank documents against |
| `documents` | array | Yes | List of documents to rerank |
| `top_n` | number | No | Number of top results to return |
| `return_documents` | boolean | No | Whether to return document text in results |

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/rerank","body":{"model":"<string>","query":"<string>","documents":"<array>","top_n":"<number>","return_documents":"<boolean>"}}'
```

### Generate Video

Submit a video generation request. Returns a polling URL to check status.

`POST /videos`

**Estimated cost:** Dynamic — use `"dryRun": true` in the Run API request to check the exact cost before calling.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Video generation model identifier |
| `prompt` | string | No | Text prompt describing the video |
| `duration` | number | No | Duration in seconds |
| `aspect_ratio` | string | No | Aspect ratio of the generated video |
| `resolution` | string | No | Resolution of the generated video |
| `seed` | number | No | Seed for deterministic generation |

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/videos","body":{"model":"<string>","prompt":"<string>","duration":"<number>","aspect_ratio":"<string>","resolution":"<string>","seed":"<number>"}}'
```

### Create Message

Create a message using the Anthropic Messages API format. Supports text, images, PDFs, tools, and extended thinking.

`POST /messages`

**Estimated cost:** Dynamic — use `"dryRun": true` in the Run API request to check the exact cost before calling.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Model identifier (e.g. anthropic/claude-sonnet-4) |
| `messages` | array | Yes | List of messages in Anthropic format |
| `max_tokens` | number | No | Maximum tokens to generate |
| `system` | string | No | System prompt |
| `temperature` | number | No | Sampling temperature |
| `tools` | array | No | Tools available to the model |
| `stream` | boolean | No | Whether to stream the response |

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/messages","body":{"model":"<string>","messages":"<array>","max_tokens":"<number>","system":"<string>","temperature":"<number>","tools":"<array>","stream":"<boolean>"}}'
```

### Text to Speech

Synthesize audio from input text. Returns raw audio in the requested format.

`POST /audio/speech`

**Estimated cost:** Dynamic — use `"dryRun": true` in the Run API request to check the exact cost before calling.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | TTS model identifier |
| `input` | string | Yes | Text to synthesize |
| `voice` | string | No | Voice identifier (provider-specific) |
| `response_format` | string | No | Audio output format (mp3, pcm, wav) |
| `speed` | number | No | Playback speed multiplier |

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/audio/speech","body":{"model":"<string>","input":"<string>","voice":"<string>","response_format":"<string>","speed":"<number>"}}'
```

### Generate Image

Generate images from a text prompt using image generation models.

`POST /images`

**Estimated cost:** Dynamic — use `"dryRun": true` in the Run API request to check the exact cost before calling.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Image generation model identifier |
| `prompt` | string | Yes | Text description of the desired image |
| `n` | number | No | Number of images to generate (1-10) |
| `size` | string | No | Output dimensions (2K, 4K, etc.) |
| `aspect_ratio` | string | No | Aspect ratio (16:9, 1:1, 4:3) |
| `quality` | string | No | Rendering quality tier |
| `output_format` | string | No | Output encoding (png, jpeg, webp, svg) |

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/images","body":{"model":"<string>","prompt":"<string>","n":"<number>","size":"<string>","aspect_ratio":"<string>","quality":"<string>","output_format":"<string>"}}'
```

### Get Model

Get full details for a single model by its author and slug (e.g. openai/gpt-4o). Returns pricing, context length, capabilities, and supported parameters.

`GET /model/{author}/{slug}`

**Cost:** Free

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `author` | string | Yes | Path parameter — substitute directly into the endpoint `path`. |
| `slug` | string | Yes | Path parameter — substitute directly into the endpoint `path`. |

```bash
# Replace {author}, {slug} in "path" with real values before sending
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/model/{author}/{slug}","method":"GET"}'
```

### List Providers

List all available inference providers on OpenRouter.

`GET /providers`

**Cost:** Free

_No parameters required._

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/providers","method":"GET"}'
```

### Create Embedding

Generate vector embeddings for input text using embedding models.

`POST /embeddings`

**Estimated cost:** Dynamic — use `"dryRun": true` in the Run API request to check the exact cost before calling.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Embedding model identifier |
| `input` | string | Yes | Text or array of texts to embed |
| `encoding_format` | string | No | Format of the embedding vector (float or base64) |
| `dimensions` | number | No | Number of dimensions for the embedding |

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/embeddings","body":{"model":"<string>","input":"<string>","encoding_format":"<string>","dimensions":"<number>"}}'
```

### Poll Video Status

Poll the status of an async video generation job. Returns job status and content URLs when completed.

`GET /videos/{jobId}`

**Cost:** Free

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `jobId` | string | Yes | Path parameter — substitute directly into the endpoint `path`. |

```bash
# Replace {jobId} in "path" with real values before sending
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/videos/{jobId}","method":"GET"}'
```

### Download Video Content

Stream and download the generated video content from the upstream provider.

`GET /videos/{jobId}/content`

**Cost:** Free

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `jobId` | string | Yes | Path parameter — substitute directly into the endpoint `path`. |
| `index` | number | No | Index of the video to download if multiple were generated |

```bash
# Replace {jobId} in "path" with real values before sending
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/videos/{jobId}/content","method":"GET","query":{"index":"<number>"}}'
```

### List Image Models

List all available image generation models with supported parameters and pricing.

`GET /images/models`

**Cost:** Free

_No parameters required._

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/images/models","method":"GET"}'
```

### List Video Models

List all available video generation models and their properties.

`GET /videos/models`

**Cost:** Free

_No parameters required._

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/videos/models","method":"GET"}'
```

### List Embedding Models

List all available embedding models and their properties.

`GET /embeddings/models`

**Cost:** Free

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | number | No | Maximum records to return (max 1000) |
| `offset` | number | No | Records to skip for pagination |

```bash
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/embeddings/models","method":"GET","query":{"limit":"<number>","offset":"<number>"}}'
```

### List Model Endpoints

List all provider endpoints for a specific model. Shows pricing tiers, supported parameters, and provider details for each endpoint serving the model.

`GET /models/{author}/{slug}/endpoints`

**Cost:** Free

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `author` | string | Yes | Path parameter — substitute directly into the endpoint `path`. |
| `slug` | string | Yes | Path parameter — substitute directly into the endpoint `path`. |

```bash
# Replace {author}, {slug} in "path" with real values before sending
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/models/{author}/{slug}/endpoints","method":"GET"}'
```

### List Image Model Endpoints

List per-endpoint details for an image generation model. Shows each endpoints supported parameters, pricing, and passthrough allowlist.

`GET /images/models/{author}/{slug}/endpoints`

**Cost:** Free

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `author` | string | Yes | Path parameter — substitute directly into the endpoint `path`. |
| `slug` | string | Yes | Path parameter — substitute directly into the endpoint `path`. |

```bash
# Replace {author}, {slug} in "path" with real values before sending
curl -X POST 'https://api.orthogonal.com/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openrouter","path":"/images/models/{author}/{slug}/endpoints","method":"GET"}'
```

---

Full details and an interactive quickstart: https://orthogonal.com/discover/openrouter
