Developer docs

API reference

Low-cost model API for agents: gpt-5.6-terra at US$0.100 input / US$0.600 output per 1M tokens. Prepaid credit from US$5; no monthly fee.

Client tutorials Get API 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, usage.reseller_cost_micros, usage.charged_cents, 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.

Successful API requests are billed at the displayed token rates, metered to a fraction of a cent. Charges accumulate and are deducted from your prepaid balance in whole US cents, so a small request is not rounded up to a minimum charge.