Quick Start
Follow these three steps to start using OneRoute in about two minutes:
- Create an account: Sign up for free at app.oneroute.ai to access the platform immediately.
- Generate an API key: Open the API Keys page in the console and create your first API key.
- Update your code: Change your existing API base URL to
https://gw.1route.ai/v1and replace the key with your OneRoute API key.
Integration Examples
SDK Integration
Using the OpenAI SDK (Recommended)
This is the fastest path for most teams and requires minimal changes to existing OpenAI SDK code.
Tip: In most cases, you only need to update
base_urlandapi_keyto connect an existing OpenAI integration to OneRoute.
- Python
- TypeScript
- REST API
from openai import OpenAI
client = OpenAI(
base_url="https://gw.1route.ai/v1",
api_key="<ONEROUTE_API_KEY>",
)
completion = client.chat.completions.create(
extra_headers={
"HTTP-Referer": "<YOUR_SITE_URL>", # Optional. Site URL for rankings on openrouter.ai.
"X-Title": "<YOUR_SITE_NAME>", # Optional. Site title for rankings on openrouter.ai.
},
model="openai/gpt-5.2",
messages=[
{
"role": "user",
"content": "What is the meaning of life?"
}
]
)
print(completion.choices[0].message.content)
import OpenAI from "openai";
const openai = new OpenAI({
baseURL: "https://gw.1route.ai/v1",
apiKey: "<ONEROUTE_API_KEY>",
defaultHeaders: {
"HTTP-Referer": "<YOUR_SITE_URL>", // Optional. Site URL for rankings on openrouter.ai.
"X-Title": "<YOUR_SITE_NAME>", // Optional. Site title for rankings on openrouter.ai.
},
});
async function main() {
const completion = await openai.chat.completions.create({
model: "openai/gpt-5.2",
messages: [
{
role: "user",
content: "What is the meaning of life?",
},
],
});
console.log(completion.choices[0].message);
}
main();
curl "https://gw.1route.ai/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "x-oneroute-api-key: YOUR_ONEROUTE_API_KEY" \
-H "x-portkey-provider: YOUR_PROVIDER" \
-d '{"model":"gpt-3.5-turbo","messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"Hello!"}]}'
Note:
Use the
provider/modelformat for themodelparameter, such asopenai/gpt-4o. OneRoute uses this format to route traffic to the correct upstream provider.
Next Steps
After the initial integration, you can:
- Explore available models and providers in the OneRoute console.
- Review request metrics and spend insights in the Analytics dashboard.
- Configure advanced routing or caching policies based on your workload requirements.