Quickstart: Gateway API
Tempr Gateway is an OpenAI-compatible API in front of your own provider keys. If you can point an SDK at a custom base_url, you can use it.
Gateway signup is currently invite-gated. Request access — once approved you'll get a Portal login to create your first virtual key.
-
Create a virtual key
In the Portal, switch to the Gateway product area and create a key. Keys are prefixed
tvk_and shown once at creation — store it somewhere safe. -
Add a provider key
Gateway is BYOK, same as Chat: add a key for at least one provider from the supported list before making a request.
-
Point your SDK at Tempr
Set the base URL to
https://api.temprhq.io/v1and the API key to your virtual key. Everything else about the OpenAI SDK stays the same.
Try it with curl
# Replace tvk_... with your virtual key
curl https://api.temprhq.io/v1/chat/completions \
-H "Authorization: Bearer tvk_..." \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o",
"messages": [{"role": "user", "content": "Say hi in one sentence."}]
}'
Python (OpenAI SDK)
# pip install openai
from openai import OpenAI
client = OpenAI(
base_url="https://api.temprhq.io/v1",
api_key="tvk_...",
)
response = client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Say hi in one sentence."}],
)
print(response.choices[0].message.content)
Node / TypeScript (OpenAI SDK)
// npm install openai
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.temprhq.io/v1",
apiKey: "tvk_...",
});
const response = await client.chat.completions.create({
model: "openai/gpt-4o",
messages: [{ role: "user", content: "Say hi in one sentence." }],
});
console.log(response.choices[0].message.content);
Streaming
Pass "stream": true (or stream: true in the SDKs) and Tempr forwards the upstream provider's OpenAI-shaped SSE stream — chat.completion.chunk lines — straight through, with stream_options.include_usage automatically enabled so you still get token counts on the final chunk.
What's next
- Authentication & virtual keys — scoping keys with model allowlists, budgets, and rate limits.
- Chat Completions reference — full parameter and response reference.
- Models, limits & logs — listing models, rate limits, quotas, and request logs.