Obtain and use your Proxy API Key, call OpenAI/Anthropic-compatible endpoints (streaming included), and understand metering & billing.
http://127.0.0.1:8000Authorization: Bearer <YOUR_PROXY_API_KEY>/v1/openai/chat/completions/v1/openai/responses/v1/anthropic/messagesDashboard → Settings → API Keys → Create new key → Copy and store securely.

Place your screenshot at /public/images/api-key.png.
Authorization: Bearer <key>).402 if insufficient credits./v1/{provider}/{endpoint}/v1/openai/chat/completions/v1/openai/responses/v1/anthropic/messageshttp://127.0.0.1:8000/v1/openaiAuthorization: Bearer YOUR_PROXY_API_KEYContent-Type: application/jsonAccept: text/event-streamcurl -X POST "http://127.0.0.1:8000/v1/openai/chat/completions" \
-H "Authorization: Bearer $APP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role":"user","content":"Tell me a joke."}],
"max_tokens": 50
}'curl -N "http://127.0.0.1:8000/v1/openai/chat/completions" \
-H "Authorization: Bearer $APP_API_KEY" \
-H "Content-Type": "application/json" \
-H "Accept": "text/event-stream" \
-d '{
"model": "gpt-4o",
"messages": [{"role":"user","content":"Stream a tiny haiku."}],
"stream": true
}'import os, requests
BASE_URL = os.getenv("BASE_URL", "http://127.0.0.1:8000")
API_KEY = os.getenv("APP_API_KEY")
url = f"{BASE_URL}/v1/openai/chat/completions"
headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
payload = {"model": "gpt-4o", "messages": [{"role":"user","content":"Tell me a joke."}]}
r = requests.post(url, headers=headers, json=payload, timeout=60)
print(r.status_code, r.json())const BASE_URL = process.env.BASE_URL || "http://127.0.0.1:8000";
const API_KEY = process.env.APP_API_KEY;
const res = await fetch(`${BASE_URL}/v1/openai/chat/completions`, {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
"Accept": "text/event-stream",
},
body: JSON.stringify({
model: "gpt-4o",
messages: [{ role: "user", content: "Stream a tiny haiku." }],
stream: true,
}),
});
for await (const chunk of res.body) process.stdout.write(chunk.toString());from langchain_openai import ChatOpenAI
from langchain_core.messages import SystemMessage, HumanMessage
llm = ChatOpenAI(base_url="http://127.0.0.1:8000/v1/openai", api_key="YOUR_PROXY_API_KEY", model="gpt-4o")
msgs = [SystemMessage(content="Be brief."), HumanMessage(content="One-line proxy joke.")]
print(llm.invoke(msgs).content)
for ch in llm.stream(msgs):
if ch.content: print(ch.content, end="")Set stream: true and send Accept: text/event-stream. The proxy forwards SSE lines unchanged and captures final usage when upstream includes it.
data: {"object":"chat.completion.chunk","choices":[{"delta":{"content":"Hello"}}]}
data: {"object":"chat.completion.chunk","choices":[{"delta":{"content":"!"}}]}
data: [DONE]prompt_tokens, completion_tokens) and Anthropic (input_tokens, output_tokens).(tokens_in × in_price + tokens_out × out_price)/1e6 × user.rate_multiplier × per-model multiplier.402.400 Unknown model pricing — model id not recognized in model_catalog.json.402 Insufficient credit balance — top up or lower max_tokens.429 ... paused — provider paused; admin can reactivate.503 No active API keys — add provider key(s) in Admin.5xx Proxy error — for SSE ensure stream: true + Accept: text/event-stream.APP_API_KEY) & secret managers in prod.