Quickstart
One OpenAI-compatible endpoint for many models. Pay per token from prepaid credits, or buy a monthly plan.
1. Get a key
- Create an account.
- Add credits in Billing, by card or USDC. See Pricing and credits.
- In API Keys, select Create API key and copy it. It is shown once.
Use one key per app or environment; all keys share your credits. See API keys and account.
2. Add the connection
| Setting | Value |
|---|---|
| API format | OpenAI Chat Completions |
| Base URL | https://api.caft.dev/v1 |
| API key | Your caft API key |
| Model ID | glm-5.3-flash, or any ID from the Models page |
Connecting directly, your app uses caft's endpoint and key. Through a router, your app uses the router's endpoint and key, and the router uses yours.
3. Send a test request
Put the key in CAFT_API_KEY and run this. The answer streams back token by token; the cost is taken from your credits and shows in Usage.
cURL
curl https://api.caft.dev/v1/chat/completions \
--header "Authorization: Bearer $CAFT_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "glm-5.3-flash",
"messages": [{ "role": "user", "content": "Hello" }],
"max_tokens": 64,
"stream": true
}'Any OpenAI SDK works the same way: set the base URL and key, and keep the rest of your code. See SDK examples for Python and TypeScript. A 401 means the key is missing or wrong, and a 403 usually means you are out of credit; Troubleshooting lists every error code.