OpenRouter
Use hundreds of models from many providers in Hull through one OpenRouter API key.
OpenRouter gives you models from many providers through a single API and account. Connect your OpenRouter key to use them in Hull. OpenRouter bills you for usage.
Website: openrouter.ai
Get an API key
- Sign in at openrouter.ai.
- Open the keys page and create a key.
- Copy the key.
Connect OpenRouter
Open Settings, go to Providers, choose Add provider, select OpenRouter and paste your key.
Middle-out transform
OpenRouter provides an optional "middle-out" message transform to help with prompts that exceed the maximum context size of a model.
There's no UI control for it. To enable it, set transforms on the model's options in hull.jsonc. Anything under options is forwarded verbatim to the OpenRouter AI SDK as providerOptions.openrouter:
{
"provider": {
"openrouter": {
"models": {
"anthropic/claude-sonnet-4.5": {
"options": {
"transforms": ["middle-out"],
},
},
},
},
},
}Provider routing
OpenRouter can route to many different inference providers. This can be controlled directly via OpenRouter's provider routing parameter.
There are no UI controls for this. To configure it, set OpenRouter's provider routing fields under the model's options in hull.jsonc. Everything under options is forwarded to the OpenRouter AI SDK as providerOptions.openrouter, so any field from the OpenRouter provider routing docs can be used.
{
"provider": {
"openrouter": {
"models": {
"anthropic/claude-sonnet-4.5": {
"options": {
"provider": {
"sort": "price", // "price" | "throughput" | "latency"
"order": ["Anthropic", "Google"], // specific provider preference
"only": ["Anthropic"], // restrict to listed providers
"data_collection": "deny", // "allow" | "deny"
"zdr": true, // zero data retention
},
},
},
},
},
},
}Omit a field to use your OpenRouter account's default. Hull passes these fields through without validation; see OpenRouter's docs for supported values.
Tips
- Pricing: OpenRouter charges each model's listed price. See OpenRouter models.
- Prompt caching: availability depends on the model and the provider that serves it. See OpenRouter's documentation.