Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions docs/providers/unorouter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# UnoRouter

## Overview

| Property | Details |
|-------|-------|
| Description | UnoRouter is an open-source OpenAI-compatible gateway serving 200+ models, most with a genuine free tier (`:free` suffix). |
| Provider Route on LiteLLM | `unorouter/` |
| Link to Provider Doc | [UnoRouter](https://unorouter.com/models) |
| Base URL | `https://api.unorouter.com/v1` |
| Supported Operations | [`/chat/completions`](#sample-usage) |

<br />

## Required Variables

```python showLineNumbers title="Environment Variables"
os.environ["UNOROUTER_API_KEY"] = "" # your UnoRouter API key from https://unorouter.com/token
```

## Sample Usage

```python showLineNumbers title="UnoRouter Completion"
import os
from litellm import completion

os.environ["UNOROUTER_API_KEY"] = ""

response = completion(
model="unorouter/deepseek-v4-flash:free",
messages=[{"role": "user", "content": "Hello from LiteLLM"}],
)

print(response)
```

## Sample Usage - Streaming

```python showLineNumbers title="UnoRouter Streaming Completion"
import os
from litellm import completion

os.environ["UNOROUTER_API_KEY"] = ""

response = completion(
model="unorouter/deepseek-v4-flash:free",
messages=[{"role": "user", "content": "Stream a short reply"}],
stream=True,
)

for chunk in response:
print(chunk)
```

## Usage with LiteLLM Proxy Server

1. Add the model to your proxy config:

```yaml showLineNumbers title="config.yaml"
model_list:
- model_name: unorouter-chat
litellm_params:
model: unorouter/deepseek-v4-flash:free
api_key: os.environ/UNOROUTER_API_KEY
```

2. Start the proxy:

```bash
litellm --config /path/to/config.yaml
```

## Direct API Usage (Bearer Token)

Use the environment variable as a Bearer token against the OpenAI-compatible endpoint:
`https://api.unorouter.com/v1/chat/completions`.

```bash showLineNumbers title="cURL"
export UNOROUTER_API_KEY=""
curl https://api.unorouter.com/v1/chat/completions \
-H "Authorization: Bearer ${UNOROUTER_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash:free",
"messages": [{"role": "user", "content": "Hello from UnoRouter"}]
}'
```

## Notes

- The full live model catalog (200+ models) is at [unorouter.com/models](https://unorouter.com/models) or via `GET https://api.unorouter.com/v1/models`.
- Models with a `:free` suffix cost nothing and run on shared free pools with a light per-model rate limit; a busy free model returns an explicit "all providers busy" error and recovers automatically.
- API keys: free signup at [unorouter.com](https://unorouter.com) (Discord or GitHub, no card).
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ const sidebars = {
"providers/togetherai",
"providers/topaz",
"providers/triton-inference-server",
"providers/unorouter",
"providers/v0",
"providers/vercel_ai_gateway",
{
Expand Down