API Docs
OpenAI-compatible chat endpoint with prepaid balance checks. Current live model: gpt-5.5.
cURL
curl https://yourdomain.com/api/v1/chat/completions \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 120
}'Python
import requests
resp = requests.post(
"https://yourdomain.com/api/v1/chat/completions",
headers={"Authorization": "Bearer sk_live_xxx"},
json={
"model": "gpt-5.5",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 120
}
)
print(resp.status_code, resp.json())Node.js
const resp = await fetch("https://yourdomain.com/api/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer sk_live_xxx",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "gpt-5.5",
messages: [{ role: "user", content: "Hello" }],
max_tokens: 120
})
});
console.log(resp.status, await resp.json());Error codes
401 UNAUTHORIZEDMissing, invalid, or revoked API key.
402 INSUFFICIENT_BALANCERecharge before retrying. The upstream is not called.
429 RATE_LIMITEDMaximum 60 requests per API key per minute.
503 MODEL_UNAVAILABLEOnly gpt-5.5 is available on this API.
503 UPSTREAM_UNAVAILABLEAll eligible upstream providers failed or are disabled.
Balance and recharge
Every request estimates token usage before calling the upstream. If balance is insufficient, the API returns 402 and no upstream cost is incurred.
HTTP 402
{
"error": {
"message": "Balance is insufficient. Please recharge before continuing.",
"code": "INSUFFICIENT_BALANCE",
"required_tokens": 620,
"current_balance": 100
}
}Recharge from the Pricing page with PayPal, Stripe, or Coinbase. Webhook confirmation credits tokens automatically.