API documentation

Build with the InferGate API

InferGate provides OpenAI-compatible API access through an independent gateway for model routing, API keys, usage tracking, and credit-based consumption.

3-minute quickstart

Step 1

Create an account

New accounts currently include $20 in trial credits for testing InferGate.

Create account
Step 2

Get your API key

Open the dashboard, create an API key, and keep it on your server or local environment.

Open dashboard
Step 3

Test the endpoint

Use the OpenAI-compatible base URL and send a chat completions request.

Step 4

Check usage and costs

Review request records, model usage, and balance movement in the dashboard.

Step 5

Recharge when ready

Switch to prepaid API credits when trial testing is complete.

View pricing

Base URL and authorization

Base URL: https://api.useinfergate.com/v1

Authorization: Bearer YOUR_INFERGATE_API_KEY

Create and manage API keys in the InferGate Dashboard.

Chat completions

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": "system", "content": "You are a concise technical assistant."},
      {"role": "user", "content": "Explain unified AI API gateways."}
    ]
  }'

Models

curl https://api.useinfergate.com/v1/models \
  -H "Authorization: Bearer YOUR_INFERGATE_API_KEY"

JavaScript

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: "gpt-4o-mini",
  messages: [{ role: "user", content: "Hello from InferGate" }]
});

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

Python

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="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello from InferGate"}],
)

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

OpenAI-compatible clients

OpenAI-compatible client libraries usually only need two changes: set baseURL or base_url to https://api.useinfergate.com/v1, and use your InferGate API key. Review the Dashboard for enabled models, pricing, usage records, rate limits, and balance before production use.

More developer guides