Developer docs
API reference
OpenAI, Responses, and Anthropic-compatible endpoints on one key.
Base URL and routes
Use the same key across all supported compatibility layers.
base_url = https://discountedtokens.com/v1
POST /v1/chat/completions # OpenAI Chat
POST /v1/responses # Responses API
POST /v1/messages # Anthropic Messages
GET /v1/models # Model list
Quickstart
Keep the key in an environment variable, not source code.
export DISCOUNTEDTOKENS_API_KEY="sk-res-..."
curl https://discountedtokens.com/v1/chat/completions \
-H "Authorization: Bearer $DISCOUNTEDTOKENS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.5","messages":[{"role":"user","content":"Hello"}]}'
Authentication
Send Authorization: Bearer <key>. Anthropic clients may use x-api-key. Plaintext keys are shown once and stored hashed.
Billing and usage
Each response includes usage.reseller_cost_usd, sell_rate_in_usd, and sell_rate_out_usd.
Errors
401 · Invalid key
Issue or claim a valid API key.
402 · No credit
Top up the prepaid balance.
404 · Model
Use an ID returned by /v1/models.
429 / 5xx
Back off or retry the upstream request.
Security
Keys are hashed at rest. The edge applies TLS, frame denial, strict response headers, and managed WAF rules.