Getting Started

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.

Private beta

Gateway signup is currently invite-gated. Request access — once approved you'll get a Portal login to create your first virtual key.

  1. 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.

  2. 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.

  3. Point your SDK at Tempr

    Set the base URL to https://api.temprhq.io/v1 and 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