Routing guide

AI model routing API for developers

InferGate routes enabled models through one compatible API gateway so developers can test latency, cost, and output quality from one dashboard.

Who it is for

Developers comparing enabled model routes for chat, responses, coding, agents, long context, cost control, and fallback behavior.

Use cases

  • Model evaluation.
  • Fallback planning for enabled routes.
  • Cost control for repeated workloads.
  • Agent routing experiments.
  • Long-context workflow testing.

How InferGate connects

Create an API key, call /v1/models to inspect enabled models, then send compatible requests to selected model names.

Base URL

https://api.useinfergate.com/v1

curl example

curl https://api.useinfergate.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_INFERGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {"role": "user", "content": "Evaluate this model route."}
    ]
  }'

JavaScript example

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.INFERGATE_API_KEY,
  baseURL: "https://api.useinfergate.com/v1"
});

const completion = await client.chat.completions.create({
  model: process.env.INFERGATE_MODEL || "gpt-4o-mini",
  messages: [{ role: "user", content: "Evaluate this model route." }]
});

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

Python example

from openai import OpenAI
import os

client = OpenAI(
    api_key=os.environ["INFERGATE_API_KEY"],
    base_url="https://api.useinfergate.com/v1",
)

completion = client.chat.completions.create(
    model=os.getenv("INFERGATE_MODEL", "gpt-4o-mini"),
    messages=[{"role": "user", "content": "Evaluate this model route."}],
)

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

Trial credits and pricing

New accounts currently include $20 in trial credits. Pricing depends on selected model/provider route and dashboard configuration. Use prepaid API credits when ready to scale.

FAQ

Can I route every model?

No. You can route enabled models available to your account.

How do I check models?

Use the dashboard or call /v1/models with your API key.

Does routing change pricing?

Pricing can depend on selected model/provider route and current account configuration.

Can I use routing for fallback?

Use enabled routes to design fallback behavior, then test your exact workload before production.