Integration tutorial
cURL quickstart
Test a key and model without installing an SDK.
01
Buy or create a key
Use guest checkout or create an account key.
02
Set the base URL
https://discountedtokens.com/v1
03
Send a small test
Verify the route before moving production traffic.
Terminal
export DISCOUNTEDTOKENS_API_KEY="YOUR_DISCOUNTEDTOKENS_KEY"
curl https://discountedtokens.com/v1/chat/completions \
-H "Authorization: Bearer $DISCOUNTEDTOKENS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6","messages":[{"role":"user","content":"Reply OK"}],"max_tokens":8}'
Run and verify
curl https://discountedtokens.com/v1/models
Troubleshooting
- GET /v1/models is public and lists callable model IDs and per-token prices.
- A 402 means the key is valid but its prepaid balance is insufficient.
- Use --fail-with-body in scripts so HTTP failures produce a nonzero exit code.
Configuration source: official documentation. DiscountedTokens is an independent gateway and is not endorsed by the client vendor.