Complete API reference for OpenAI-compatible, Claude-compatible, and native endpoints.
AI Badgr is an API gateway that:
Receipts are generated for every request, providing execution records for cost tracking and debugging.
Before (OpenAI)
api.openai.com/v1After (AI Badgr)
aibadgr.com/v1What does NOT change:
from openai import OpenAI
client = OpenAI(
api_key="sk-your-openai-key", # Your existing OpenAI key
base_url="https://aibadgr.com/v1" # Only change: swap base URL
)
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "user", "content": "Hello!"}
],
max_tokens=200
)
print(response.choices[0].message.content)from openai import OpenAI
client = OpenAI(
api_key="sk-your-openai-key",
base_url="https://aibadgr.com/v1"
)
stream = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": "Hello!"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")curl -i https://aibadgr.com/v1/chat/completions \
-H "Authorization: Bearer sk-your-openai-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 200
}'-i flag to see response headers (including receipt ID)Receipts are in response headers, not the JSON body.
Response headers:
X-Badgr-Receipt-Id - Unique receipt identifierX-AIBADGR-Receipt-URL - Relative path to receipt# 1. Make request with -i to see headers
curl -i https://aibadgr.com/v1/chat/completions \
-H "Authorization: Bearer sk-your-openai-key" \
-d '{"model": "gpt-3.5-turbo", "messages": [...]}'
# 2. Copy X-AIBADGR-Receipt-URL from headers (e.g., /v1/receipts/abc-123)
# 3. Fetch receipt (use same OpenAI key)
curl https://aibadgr.com/v1/receipts/abc-123 \
-H "Authorization: Bearer sk-your-openai-key"❓ Why does the receipt URL 401 in my browser?
Receipt URLs are API endpoints, not browser pages. Pasting in a browser returns 401. This is expected behavior, not a bug. Use curl, Postman, or your HTTP client withAuthorization: Bearer and your OpenAI key.
Receipts supported for:
/v1/chat/completions (including streaming)Other endpoints execute normally. Receipt coverage is expanding.