Quickstart
Send your first request.
Create a Relay key, configure your client, and choose an available model from the console. These examples use the Chat Completions API.
- 1Create a key
- 2Configure your client
- 3Send a model request
Base URL
https://proxystacks.com/v1
Model ID
YOUR_MODEL_ID
Replace YOUR_MODEL_ID with an available model ID from your console.
curl https://proxystacks.com/v1/chat/completions \
-H "Authorization: Bearer sk-relay-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"messages": [
{ "role": "user", "content": "Hello, Relay!" }
],
"stream": true
}'import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.RELAY_API_KEY,
baseURL: "https://proxystacks.com/v1",
});
const stream = await client.chat.completions.create({
model: "YOUR_MODEL_ID",
messages: [{ role: "user", content: "Hello!" }],
stream: true,
});import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["RELAY_API_KEY"],
base_url="https://proxystacks.com/v1",
)
response = client.chat.completions.create(
model="YOUR_MODEL_ID",
messages=[{"role": "user", "content": "Hello!"}],
)Authentication
Every model request must carry a Bearer token in the Authorization header. Relay stores only the SHA-256 hash of your API key.
Streaming
Set stream: true to get a standard SSE data stream. Balance deduction completes automatically once the stream ends.
Response format
Non-streaming responses use a standard JSON response format, plus a Relay request ID in the response header for easy log lookup.
AI coding tools
Point your AI coding tools at the Relay gateway. Copy a config block into the target file, then replace sk-relay-your-key and YOUR_MODEL_ID.