Connect to the PureGamma API in three steps
Use your sk-pg key and this Base URL in any OpenAI-compatible client. PureGamma handles routing only to enabled providers; you do not manage upstream provider connections.
Before you start
Create a key
Create an sk-pg-... key in the API Console. The plaintext key is shown once.
Add API balance
Gateway uses its own prepaid USD balance, separate from product Credits.
Copy configuration
Put the Base URL, key, and a returned model ID into your server or compatible client.
Gateway configuration card
Works with the OpenAI SDK, Dify, LangChain, Cursor, Continue, Open WebUI, and your own backend.
- API type
- OpenAI Compatible / OpenAI API
- Base URL
- https://api.puregamma.ai/v1
- API key
- sk-pg-... (environment variable or secret manager only)
- Model
- An exact id returned by GET /v1/models
PUREGAMMA_API_KEY=sk-pg-...
PUREGAMMA_BASE_URL=https://api.puregamma.ai/v1
# Use an exact id returned by GET /v1/models
PUREGAMMA_MODEL=deepseek-v4-flashChoose a model
These are public compatibility IDs. Your GET /v1/models response is the source of truth for availability.
deepseek-v4-flashDefaultLow-latency chat, batch work, and value-oriented tasksdeepseek-v4-proComplexMore demanding reasoning, code, and longer answerskimi-k3-maxLong contextLong documents and complex tool workflowsglm-5.2GeneralGeneral Chinese/English tasks and tool callsModel availability and JSON, streaming, or tool support may change with provider health and price approval. Request /v1/models first, then use an id it returns.
Run one request first
No SDK needed. Replace the environment variable with your own key and run this command.
curl -sS https://api.puregamma.ai/v1/chat/completions \
-H "Authorization: Bearer $PUREGAMMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"messages": [{"role": "user", "content": "Hello from PureGamma."}]
}'Use the official OpenAI SDK
Minimal deployment · Keep the key server-side. Add these variables in Vercel, Railway, Docker, Cloud Run, or your own backend.
from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ["PUREGAMMA_API_KEY"],
base_url="https://api.puregamma.ai/v1",
)
response = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Hello from PureGamma."}],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.PUREGAMMA_API_KEY,
baseURL: "https://api.puregamma.ai/v1",
});
const response = await client.chat.completions.create({
model: "deepseek-v4-flash",
messages: [{ role: "user", content: "Hello from PureGamma." }],
});
console.log(response.choices[0].message.content);Streaming and tools
Chat Completions supports stream: true, JSON mode, and tools. Check the selected model's capabilities before enabling them. Tool arguments are untrusted input: validate schema and permissions before they touch databases, payments, networks, or files.
Security and billing
Never place an sk-pg key in browser code, a mobile app, a repository, a screenshot, or a support ticket. Pause or rotate a suspected key in the API Console. Each request debits Gateway prepaid USD balance only; insufficient balance returns 402.
Need streaming, tool calls, error codes, or provider configuration for administrators? Open full documentation