Quick Start
NitroRouter provides a unified, OpenAI-compatible endpoint. In most applications, you just need to select the OpenAI or OpenAI-compatible provider type, set the base URL to https://api.nitrorouter.com/v1, and set the API key to the one you created in the console.
In some applications, extra configuration might be required. Please refer to:
SDK Configuration
To call NitroRouter programmatically, you can use any OpenAI-compatible SDK, such as the official OpenAI SDK or Vercel AI SDK with an OpenAI Compatible provider:
Python (OpenAI SDK):
from openai import OpenAI
client = OpenAI(
api_key="NITROROUTER_API_KEY",
base_url="https://api.nitrorouter.com/v1",
)TypeScript (OpenAI SDK):
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'NITROROUTER_API_KEY',
baseURL: 'https://api.nitrorouter.com/v1',
});TypeScript (Vercel AI SDK):
import { createOpenAICompatible } from '@ai-sdk/openai-compatible'
const provider = createOpenAICompatible({
name: 'nitrorouter',
includeUsage: true,
baseURL: 'https://api.nitrorouter.com/v1',
apiKey: 'NITROROUTER_API_KEY'
})Native API Format Support
In addition to the unified OpenAI-compatible endpoint, we also support each provider's native API format.
For example, GPT models also support the Responses API format, Claude models also support the Anthropic API format, and Gemini models also support the Gemini API format. The API endpoint for all of them is https://api.nitrorouter.com.
Native API formats usually offer better compatibility. If you experience a low cache hit rate with the OpenAI-compatible format, try switching to the native API format.
Via CDN
If your direct connection to our service is unstable, consider switching to our CDN endpoint: https://cdn.nitrorouter.com.