Getting started
Quickstart
Keep the OpenAI-compatible client you already use, swap the base URL, and verify the economics on one safe slice of traffic first.
1
Base URL swap
Point your existing client at /v1
1
Workspace key
Create a scoped machine key in the dashboard
5
Proof headers
Track cache tier, charge, and saved amount
Prerequisites
- A Runtime workspace with credits or a connected provider path ready.
- A machine key created from the dashboard with the
inferencescope. - An existing OpenAI-compatible SDK integration you can point at a new base URL.
Integration steps
1
Create a workspace key
Start in Dashboard / API keys. Runtime keeps human sign-in in the dashboard and expects your app to use a scoped machine key on the live request path.
2
Set an environment variable
Put the key in
GATEWAY_API_KEY so the same secret can be reused across your SDK snippet, your server environment, and quick smoke tests from the terminal.3
Swap the base URL
Point the same OpenAI-compatible client at
https://api.rntm.sh/v1. That keeps the app contract stable while routing, cache, and billing proof move into Runtime.1. Create a key
INFO
Recommended first key
Start with an inference-only key for one safe traffic slice. You can add billing or read-only scopes later when a real workflow needs them.
2. Set env var
Authorization header
Authorization: Bearer <GATEWAY_API_KEY>3. Swap one line
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.GATEWAY_API_KEY,
baseURL: "https://api.rntm.sh/v1",
});
const response = await client.chat.completions.create({
model: "gpt-4.1-mini",
messages: [
{ role: "user", content: "Summarize this support ticket in 3 bullets." },
],
});
console.log(response.choices[0]?.message?.content);Verify it works
The fastest live check is a small request plus an inspection of the response headers. That proves auth, routing, and the savings layer in one shot.
Smoke test
curl -i https://api.rntm.sh/v1/chat/completions \
-H "Authorization: Bearer $GATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4.1-mini",
"messages": [{"role":"user","content":"Say hello from Runtime."}]
}'Expected response headers
HTTP/2 200
content-type: application/json
x-btl-request-id: req_8f2a1c9d
x-btl-cache-tier: exact_response_cache
x-btl-benchmark-cost: 0.014
x-btl-customer-charge: 0.0056
x-btl-saved: 0.0084
x-btl-net-savings: 0.0084
x-btl-upstream-cost-basis: short_circuitedWhat's next
Auth
Lock down key scopes
Use scoped machine keys for apps and keep human sign-in inside the dashboard.
Billing proof
Quote before cutover
Run a representative request through the quote route before switching live traffic.
Headers
Read request economics live
Use the response headers and usage APIs to show what Runtime changed on each request.
Was this page helpful?