API Reference
Auth, billing, usage, and OpenAI-compatible relay endpoints used by Sweet clients.
Base URL
https://billing.sweetcli.com
Authentication
Use bearer token returned from login flow.
Authorization: Bearer <token>
Billing endpoints
| Method | Path | Purpose |
|---|---|---|
POST | /billing/request-code | Request one-time login code. |
POST | /billing/verify-code | Verify code and issue token. |
GET | /billing/verify-token | Validate token. |
GET | /billing/plan | Account access and balance state. |
GET | /billing/usage/monthly | Monthly usage summary. |
Relay endpoint
POST /v1/chat/completions
The relay follows OpenAI-compatible payloads for messages, tool calls, and streaming.
Login example
curl -X POST https://billing.sweetcli.com/billing/request-code \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com"}'
curl -X POST https://billing.sweetcli.com/billing/verify-code \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","code":"123456"}'