1. Get your API key
Go to dashboard.chipipay.com, create an org, and copy your API key from the Credentials page.
2. Make your first call
curl -X POST https://api.chipipay.com/v1/ai/chat \
-H "Authorization: Bearer sk_prod_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "What is Starknet?"}]
}'
3. Stream a response
For chatbots and real-time UIs, use the streaming endpoint — same request body, token-by-token delivery via SSE:
curl -N -X POST https://api.chipipay.com/v1/ai/chat/stream \
-H "Authorization: Bearer sk_prod_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "haiku", "messages": [{"role": "user", "content": "Tell me a joke"}]}'
4. Buy credits
AI calls debit from your org’s credit balance. Buy a credit pack (2/5 / 25/50 / $100) at dashboard.chipipay.com/configure/billing by sending USDC.
$5 gets you ~50,000 calls with gpt-4o-mini or ~700 calls with haiku.
Auth
Two options — both work on all AI endpoints, no JWKS setup needed:
| Method | Header | Best for |
|---|
| Secret key | Authorization: Bearer sk_prod_... | Server-side (backend, agent) |
| Public key | x-api-key: pk_prod_... | Client-side (browser, mobile) |
Never put sk_ keys in client-side code. Use pk_ for browser/mobile apps.
What you can build
| Use case | Endpoint | Cost |
|---|
| Chatbot / code assistant | POST /ai/chat | Per token |
| Real-time streaming UI | POST /ai/chat/stream | Per token |
| DeFi portfolio advisor | POST /ai/think | Per token |
| Swap execution | POST /ai/execute | $0.002/call |
| Token prices for wallets | GET /ai/prices | Free |
| Market signals for agents | GET /ai/signals | $0.0005/call |
Next