Getting Started

3-Minute Quickstart

Connect your existing SDKs to InfinityRouter in three quick steps: generate a key, point your client to our gateway, and execute your first completion.

1

Generate your API Key

Sign in to your account dashboard and navigate to the API Keys tab. Click Create Key, assign an optional rate limit ceiling, and copy your secret key (starting with inf_...).

2

Set your Environment Variables

Store your credentials securely in your local environment or .env file:

shell.env
INFINITY_API_KEY="inf_live_9f2cKq81093bc9281a"
INFINITY_BASE_URL="https://infinityrouter.qd.je/v1"
3

Make your first Request

Pick your preferred language below. Notice that you use the standard OpenAI client without modifying payload structures or installation dependencies:

Python Example

pythonmain.py
import os
from openai import OpenAI

client = OpenAI(
    base_url=os.environ.get("INFINITY_BASE_URL", "https://infinityrouter.qd.je/v1"),
    api_key=os.environ.get("INFINITY_API_KEY"),
)

response = client.chat.completions.create(
    model="claude-sonnet-5",
    messages=[
        {"role": "system", "content": "You are a concise technical assistant."},
        {"role": "user", "content": "Explain zero-downtime routing in two sentences."},
    ],
    temperature=0.7,
)

print(response.choices[0].message.content)

TypeScript / Node.js Example

typescriptindex.ts
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: process.env.INFINITY_BASE_URL || "https://infinityrouter.qd.je/v1",
  apiKey: process.env.INFINITY_API_KEY,
});

async function main() {
  const completion = await client.chat.completions.create({
    model: "claude-sonnet-5",
    messages: [
      { role: "system", content: "You are a concise technical assistant." },
      { role: "user", content: "Explain zero-downtime routing in two sentences." },
    ],
  });

  console.log(completion.choices[0]?.message.content);
}

main().catch(console.error);

cURL Example

shellterminal
curl https://infinityrouter.qd.je/v1/chat/completions \
  -H "Authorization: Bearer $INFINITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "messages": [
      {"role": "user", "content": "Explain zero-downtime routing in two sentences."}
    ]
  }'
Tip on Model Selection: Use canonical model names like claude-sonnet-5, gpt-4o, or deepseek-r1. Check our complete model catalog for current per-token rates.