Developers · API as a service
An OpenAI-compatible API funded with crypto. Point anything you already use at Sonnely with a base URL and a key.
The terminal client remembers your key and model. Needs Node 18+.
curl -fsSL https://sonnely.com/install.sh | sh sonnely login sonnely "what changed in HTTP/3?"
sonnely models to browse · sonnely image "prompt" to render · -m to switch models.
No install, no SDK required.
export SONNELY_KEY="sk-sonnely-..."
curl https://sonnely.com/api/v1/chat/completions \\
-H "Authorization: Bearer $SONNELY_KEY" \\
-H "Content-Type: application/json" \\
-d '{"model":"sonnely-gpt","messages":[{"role":"user","content":"hello"}]}'Base URL https://sonnely.com/api/v1 · key sk-sonnely-…
Settings → Models → add an OpenAI key, override base URL to https://sonnely.com/api/v1.
In config.json: "provider": "openai", "apiBase": "https://sonnely.com/api/v1".
--openai-api-base https://sonnely.com/api/v1 --openai-api-key $SONNELY_KEY
Pass base_url + api_key. Nothing else changes.
Any OpenAI chat model class that accepts a base URL.
It is HTTP and JSON. The examples on this page work as-is.
| GET | /api/v1/models | Every model you can call — 16 featured + 373 catalog, OpenAI shape. |
| POST | /api/v1/chat/completions | The one that does the work. Streaming and non-streaming. |
| GET | /api/v1/balance | Connection check. Returns your credit balance. |
| POST | /api/v1/images/generations | Text-to-image. Billed per render from the exact reported cost. |
| POST | /api/v1/videos/generations | Async text-to-video. Returns a job id + poll URL. |
| GET | /api/v1/videos/:jobId | Poll status. Charges the exact cost once at completion. |
| POST | /api/v1/audio/speech | Text to speech, raw audio bytes. Billed per character (beta). |
| POST | /api/deposits/claim | Claim a USDG/ETH deposit for credits by tx hash. |
| GET | /api/health | Gateway reachability + model routing status. |
| GET | /api/openapi | OpenAPI 3.1 of this whole surface. |
$1 = 1,000 credits. Each request is priced from upstream cost plus our flat 20% margin — and the figure comes back with the response, so a script never guesses.
"sonnely": { "credits_charged": 9.0, "margin_bps": 2000 }Make as many as you like in the console. Shown once — only a hash is kept. Scope to a team, cap the budget, revoke instantly. Treat a key like a card number: environment variable, never a committed file.
Generated from the live OpenAPI on every docs build — always in sync with this API.
Open docs →