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

# OpenRouter

> Access Radium through the OpenRouter gateway

<Error>
  This page contains placeholder values and assumed model identifiers marked in <span style="color:red">red</span>. Needs verification (Vijay, Adam, Alex, Product/Legal).
</Error>

# OpenRouter

OpenRouter provides a unified API for <span style="color:red">299+</span> models. Radium models are available through OpenRouter for easy switching and comparison.

## Prerequisites

* OpenRouter account and API key
* A Radium API key from the [dashboard](https://deploy.radium.cloud)

## Setup

### Direct OpenRouter access

If Radium models are listed on OpenRouter, use them directly:

```python theme={null}
import openai

client = openai.OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="YOUR_OPENROUTER_KEY",
)

response = client.chat.completions.create(
    model="radium/hal-1.0",
    messages=[{"role": "user", "content": "Hello"}],
    extra_headers={
        "HTTP-Referer": "https://your-site.com",
        "X-Title": "Your App"
    }
)
```

### Proxy through OpenRouter to Radium

If you want to use OpenRouter's routing but keep Radium as the destination:

```yaml theme={null}
# OpenRouter config
providers:
  radium:
    base_url: https://api.radium.cloud/v1
    api_key: ${RADIUM_API_KEY}
    models:
      - hal-1.0
      - clarke-1.0
      - tycho-1.0
```

## Model identifiers

| Radium model | OpenRouter ID |
| - | - |
| hal-1.0 | `radium/hal-1.0` |
| clarke-1.0 | `radium/clarke-1.0` |
| tycho-1.0 | `radium/tycho-1.0` |

## Routing strategies

OpenRouter supports multiple routing strategies. For Radium:

```python theme={null}
response = client.chat.completions.create(
    model="radium/hal-1.0",
    messages=messages,
    extra_body={
        "provider": {
            "order": ["Radium"],
            "allow_fallbacks": False
        }
    }
)
```

## Fallback configuration

Allow OpenRouter to fall back to another provider if Radium is overloaded:

```python theme={null}
response = client.chat.completions.create(
    model="radium/hal-1.0",
    messages=messages,
    extra_body={
        "provider": {
            "order": ["Radium", "OpenAI"],
            "allow_fallbacks": True
        }
    }
)
```

## Pricing

OpenRouter may add a small routing fee on top of Radium's base pricing. Check current rates at [openrouter.ai/models](https://openrouter.ai/models).

| Model | Radium direct | Via OpenRouter |
| - | - | - |
| hal-1.0 | $2.75 / $13.75 per MTok | Radium rate + routing fee |
| clarke-1.0 | $1.50 / $7.00 per MTok | Radium rate + routing fee |
| tycho-1.0 | $0.50 / $2.25 per MTok | Radium rate + routing fee |

## When to use OpenRouter vs direct

| Scenario | Recommendation |
| - | - |
| Already using OpenRouter for other models | Add Radium via OpenRouter |
| Need unified billing across providers | Use OpenRouter |
| Need lowest latency | Call Radium directly |
| Need enterprise controls (SSO, audit logs) | Call Radium directly |
| Testing multiple models side-by-side | Use OpenRouter |

## Troubleshooting

| Symptom | Fix |
| - | - |
| "Model not found" | Check exact model ID: `radium/hal-1.0` |
| Higher latency | Direct Radium calls skip the OpenRouter hop |
| Different pricing | OpenRouter adds fees; check their pricing page |

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="bolt" href="/quickstart">Direct Radium API access</Card>
  <Card title="LiteLLM" icon="route" href="/tools/lite-llm">Self-hosted routing proxy</Card>
  <Card title="Models" icon="brain" href="/models/overview">Compare model capabilities</Card>
  <Card title="Migration testing" icon="shuffle" href="/guides/migration-testing">Canary deployment strategies</Card>
</CardGroup>


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