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

MethodPathPurpose
POST/billing/request-codeRequest one-time login code.
POST/billing/verify-codeVerify code and issue token.
GET/billing/verify-tokenValidate token.
GET/billing/planAccount access and balance state.
GET/billing/usage/monthlyMonthly 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"}'