Docs
Use the API
Bluusun speaks the OpenAI chat completions API. Point an existing SDK at this base URL and send a model id from the catalog.
Base URL
https://www.bluusun.com/api/v1
Authorization is Bearer bsu_…. Create and revoke keys in the dashboard. The key is shown once.
Chat completion
curl https://www.bluusun.com/api/v1/chat/completions \
-H "Authorization: Bearer bsu_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.3-flash",
"messages": [{"role": "user", "content": "Hello"}]
}'
Python and Node use the official OpenAI SDK with base_url set to the URL above. stream: true returns server-sent events. Tool calls go through when the upstream route supports them.
If you omit max_tokens, the gateway caps the completion at 4,096 tokens or at whatever your balance can still pay, whichever is smaller.
Models and balance
GET /v1/modelslists the live catalog and the per-million rates.GET /v1/balancereturnsbalance_usdfor the key’s account.
Billing
A successful response is billed as fresh input tokens × input rate, plus cached input tokens × cache-read rate, plus output tokens × output rate. Rates are USD per million tokens, the same numbers as the models page. The charge is rounded up to the nearest millionth of a dollar.
Responses include X-Bluusun-Price-USD and X-Bluusun-Balance-USD. The same figures land in the dashboard usage log. HTTP errors are not billed.
Add credit with Stripe from the dashboard. Packs are $10, $25, $50, and $100. Credits do not expire. There is no subscription.
Errors
401missing, unknown, or revoked key.402the balance cannot cover this prompt.404unknown model id.503no upstream route under the published price. Nothing is billed.
Request bodies are limited to 1 MB.