Quickstart
Make your first opengateway API call in under 60 seconds. cURL and OpenAI SDK examples for Chat Completions with one base URL change.
1. Get your API key#
Sign up at opengateway.ai, open API Keys, and click Create Key. Copy the key immediately. It is only displayed once.
export OPENGATEWAY_API_KEY="og_live_..."2. Make your first call#
Pick the style that matches your stack. The examples below produce the same response.
cURL#
curl https://api.opengateway.ai/v1/chat/completions \
-H "Authorization: Bearer $OPENGATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [{"role": "user", "content": "Hello, opengateway!"}]
}'OpenAI SDK (Python)#
If you are already using the OpenAI SDK, change the base_url and you are done.
from openai import OpenAI
client = OpenAI(
api_key="og_live_...",
base_url="https://api.opengateway.ai/v1"
)
response = client.chat.completions.create(
model="openai/gpt-4o-mini",
messages=[{"role": "user", "content": "Hello, opengateway!"}],
)
print(response.choices[0].message.content)OpenAI SDK (TypeScript)#
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.OPENGATEWAY_API_KEY,
baseURL: "https://api.opengateway.ai/v1",
});
const response = await client.chat.completions.create({
model: "openai/gpt-4o-mini",
messages: [{ role: "user", content: "Hello, opengateway!" }],
});
console.log(response.choices[0].message.content);3. Swap the model#
The same OpenAI-compatible request shape works across supported providers.
Try each of the following model IDs in the model field:
openai/gpt-4o-mini # cheap and fast
openai/gpt-4o # balanced
anthropic/claude-sonnet-4 # top-tier reasoning
google/gemini-2.5-pro # long context and multimodalThe full catalog is on the Models page.
4. See what just happened#
Open the dashboard. Your request is already there, along with its token counts, cost, latency, and the provider that served it. You did not have to install anything.