SDKs

Use common SDKs by configuring the base URL and API key.

Base URLs

Use the shortest protocol-specific base URL that matches your client. OpenAI-compatible SDKs use https://onerouter.com/v1. Claude native requests use https://onerouter.com with /v1/messages. Gemini native requests use https://onerouter.com/v1beta or the /gemini/* compatibility prefix.

ParameterTypeRequiredDescription
OpenAI-compatiblebase URLrequiredhttps://onerouter.com/v1
Claude nativebase URLrequiredhttps://onerouter.com
Gemini nativebase URLrequiredhttps://onerouter.com/v1beta

OpenAI SDK

from openai import OpenAI

client = OpenAI(base_url="https://onerouter.com/v1", api_key="YOUR_API_KEY")

Native clients

Anthropic-compatible tools should point to https://onerouter.com and call /v1/messages. Gemini-compatible tools should point to https://onerouter.com/v1beta when they support custom endpoints. Some CLI tools require their own configuration shape; see integration guides.