Introduction
Quickstart
Get started with the AI Gateway in under 5 minutes.
Quickstart
Get started with the AI Gateway in under 5 minutes. Choose your preferred method:
1. cURL
The simplest way to test the gateway.
curl https://viprouter.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer *** \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [
{"role": "user", "content": "Hello, world!"}
]
}'2. OpenAI Python SDK
Drop-in replacement for the OpenAI SDK.
from openai import OpenAI
client = OpenAI(
base_url="https://viprouter.com/v1",
api_key="your-api-key"
)
response = client.chat.completions.create(
model="openai/gpt-4o-mini",
messages=[{"role": "user", "content": "Hello, world!"}]
)
print(response.choices[0].message.content)3. OpenAI Node.js SDK
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://viprouter.com/v1",
apiKey: "your-api-key",
});
const response = await client.chat.completions.create({
model: "openai/gpt-4o-mini",
messages: [{ role: "user", content: "Hello, world!" }],
});
console.log(response.choices[0].message.content);Model Format
The gateway uses a provider/model format:
| Provider | Format | Example |
|---|---|---|
| OpenAI | openai/model-name | openai/gpt-4o |
| Anthropic | anthropic/model-name | anthropic/claude-sonnet-4-20250514 |
model-name | gemini-2.5-pro | |
| Bedrock | bedrock/model-name | bedrock/anthropic.claude-3 |
Next Steps
- Streaming - Real-time responses
- Tool Calling - Function calling
- API Reference - Full API docs
