Use Outrun with LiteLLM.
Call Outrun from the LiteLLM Python SDK or a local LiteLLM Proxy.
Before you start
Have your API key and some Outrun credit ready. Keep your key private.
Optional setup helperUse an AI assistant to walk through these steps
Copy the setup instructions into an AI assistant you already use. Review any file changes it suggests before allowing them.
Enter your API key directly in the app or local settings. Keep it out of the assistant’s chat.
Connection settingsShow
api_base: https://api.outrun.to/v1
Example model: openai/claude-sonnet-5-5
API key variable: OUTRUN_API_KEYGet your key from Outrun → API keys and enter it privately in the app or local settings. Test with “Reply with OK only.” Tests use credit; check Activity before retrying.
Setup Steps
- 1Prepare your LiteLLM installation
Use Python 3.10 or newer with a supported LiteLLM installation. The SDK examples need the litellm package; the Proxy section also requires its proxy extra. Select a supported version before installing or upgrading.
- 2Keep your key in a local variable
Provide OUTRUN_API_KEY only to your local process. Use your own key from Outrun → API keys or @outrunAPI_Bot → My API key. Never put it in source control, browser code or a shared configuration.
- 3Use the OpenAI-compatible route
Use a model string with the openai/ prefix, and keep api_base exactly https://api.outrun.to/v1. The prefix selects LiteLLM’s OpenAI-compatible Chat Completions route; it does not change which Outrun model ID is called.
- 4Run one small request
Run the SDK example below once, or start the loopback-only proxy and send its example request. Requests use Outrun credit. Check Activity before repeating an interrupted request.
Call Outrun from Python
Keep the openai/ prefix and replace the model ID with any available chat model from the model catalogue. Image, video and audio operations use their own endpoints, not this chat example.
import os
from litellm import completion
response = completion(
model="openai/claude-sonnet-5-5",
api_base="https://api.outrun.to/v1",
api_key=os.environ["OUTRUN_API_KEY"],
messages=[{"role": "user", "content": "Reply with OK only."}],
)
print(response.choices[0].message.content)Stream the response
Add stream=True and consume the returned chunks. Use streaming only when the selected model’s setup data supports it. The example model lists streaming support.
import os
from litellm import completion
response = completion(
model="openai/claude-sonnet-5-5",
api_base="https://api.outrun.to/v1",
api_key=os.environ["OUTRUN_API_KEY"],
messages=[{"role": "user", "content": "Reply with OK only."}],
stream=True,
)
for chunk in response:
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="", flush=True)Configure a local LiteLLM Proxy
Save this as config.yaml. model_name is the alias clients send to the local proxy; litellm_params.model is the actual Outrun model prefixed with openai/. The key stays in the proxy process environment.
| Model | Model ID | Details |
|---|---|---|
| Claude Sonnet 5.5 | claude-sonnet-5-5 | Model details |
| GPT-6.1 Sol | gpt-6.1-sol | Model details |
| DeepSeek V4 Pro | deepseek-v4-pro | Model details |
model_list:
- model_name: outrun-claude
litellm_params:
model: openai/claude-sonnet-5-5
api_base: https://api.outrun.to/v1
api_key: os.environ/OUTRUN_API_KEY
- model_name: outrun-gpt
litellm_params:
model: openai/gpt-6.1-sol
api_base: https://api.outrun.to/v1
api_key: os.environ/OUTRUN_API_KEY
- model_name: outrun-deepseek
litellm_params:
model: openai/deepseek-v4-pro
api_base: https://api.outrun.to/v1
api_key: os.environ/OUTRUN_API_KEY
Start the proxy and call it
With the proxy extra installed and OUTRUN_API_KEY available to the process, run the command below. Keep this example bound to 127.0.0.1. The cURL model value is the configured alias, not the original Outrun ID.
litellm --config config.yaml --host 127.0.0.1 --port 4000curl http://127.0.0.1:4000/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"outrun-claude","messages":[{"role":"user","content":"Reply with OK only."}]}'Choose another model
Change only the Outrun ID after openai/ in the SDK or YAML. Use an available text/chat model with the endpoint and capabilities shown on its model page. Keep a distinct model_name for each proxy alias.
Browse model pagesAll current pricesAPI formats and endpointsIf something goes wrong
Key missing or rejected (401)
Copy your current key from API keys. Paste it only into the app’s key field or your local key variable, then save and reopen the app.
Not enough available credit (402)
Check Balance and the key’s spending cap. Another request may have temporarily reserved credit; read the message before adding funds.
Model not found (400/404)
Copy a current model ID from Models & Pricing. A model name or a route label is not an API model ID.
Empty replies or an interrupted request
Check Activity first. Confirm the response-length setting is within the model’s output limit. If needed, choose another listed route or model; do not repeatedly submit the same request.
Busy or rate limited (429)
Wait for the active request to finish or the rate limit to reset. Avoid repeatedly submitting the same request.