SDK setup
Use the API hostname, not the website URL.
Python
Install openai. Supply your key through the environment. Disable automatic retries while checking authentication and endpoint availability.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.urouter.net/v1",
api_key=os.environ["UROUTER_API_KEY"],
max_retries=0,
timeout=30.0,
)
for model in client.models.list().data:
print(model.id)TypeScript
Install openai. Run this on your server, not in a browser. The model list is readable without spending funds.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.urouter.net/v1",
apiKey: process.env.UROUTER_API_KEY,
maxRetries: 0,
timeout: 30_000,
});
const models = await client.models.list();
console.log(models.data.map((model) => model.id));Coding tools
OpenAI model discovery and chat completions are available. Individual coding-tool integrations have not been verified. A client that requires Responses or Anthropic Messages will not work by changing its base URL to the chat endpoint.
| Client protocol | uRouter support |
|---|---|
| OpenAI model discovery | Available at /v1/models. |
| OpenAI Chat Completions | Chat and streaming for enabled accounts. |
| OpenAI Responses / Codex | No Responses endpoint. |
| Anthropic Messages / Claude Code | No Messages endpoint. |
Agent documentation
Give your agent the index and schema so it uses uRouter’s current contract.
Read https://urouter.net/llms.txt
API schema: https://api.urouter.net/openapi.json
Keep UROUTER_API_KEY in the environment.
Check endpoint availability before sending paid requests.