razorBridge AI Gateway
Use razorBridge with OpenAI SDK
Connect OpenAI SDK to razorBridge AI Gateway with a custom base URL. Follow the setup, send a Chat Completions request and check usage.
Get an API keyCreate an account, add prepaid credit, then create your key.
Send your first request
Store your key in RAZORBRIDGE_KEY on your server. These examples send a short, billable request. Keep credentials out of browser code and source control.
Use chat.completions.create. The Gateway base URL already includes the API path; do not append /v1 or /chat/completions to the SDK base URL.
Base URL
https://razorbridge.eu/api/v1/compute/gate
curl
curl --fail-with-body https://razorbridge.eu/api/v1/compute/gate/chat/completions \
-H "Authorization: Bearer $RAZORBRIDGE_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"razorbridge-eu/deepseek-v4-flash-0731","messages":[{"role":"user","content":"Hello!"}],"max_tokens":128}'
Scroll horizontally to see the full example.
Python
# python -m pip install openai
import os
from openai import OpenAI
client = OpenAI(
base_url="https://razorbridge.eu/api/v1/compute/gate",
api_key=os.environ["RAZORBRIDGE_KEY"],
max_retries=0,
)
response = client.chat.completions.create(
model="razorbridge-eu/deepseek-v4-flash-0731",
messages=[{"role": "user", "content": "Hello!"}],
max_tokens=128,
)
print(response.choices[0].message.content)
Scroll horizontally to see the full example.
JavaScript
// npm install openai; save as example.mjs; node example.mjs
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://razorbridge.eu/api/v1/compute/gate",
apiKey: process.env.RAZORBRIDGE_KEY,
maxRetries: 0,
});
const response = await client.chat.completions.create({
model: "razorbridge-eu/deepseek-v4-flash-0731",
messages: [{ role: "user", content: "Hello!" }],
max_tokens: 128,
});
console.log(response.choices[0].message.content);
Scroll horizontally to see the full example.
Check the result
A successful response contains choices and usage. For 401, check the key. For an unavailable model or policy refusal, check the current model list and key permissions. For insufficient credit, add credit before retrying. Disable automatic retries while diagnosing errors.
Connect your stack
Before you start
Does every model stay in the EU?
No. Check the residency label on the selected model. Models without the EU-only label may be processed outside the EU.
How do I make my first request?
Create an account, add prepaid credit and create an API key. Set the base URL, choose a currently listed model and send a Chat Completions request.
Does EU-only mean zero data retention?
No. Processing location and retention are separate questions. Review the DPA, sub-processors and retention terms for your intended use.