Developer documentation
Connect a wallet, create a scoped key, and send your first completion.
Quickstart
- Open the playground to try a sample or sign in with a Solana wallet.
- Create a key under API keys. Save it to a secrets manager when it appears.
- Set
SONNELY_ORIGINtohttps://sonnely.comandSONNELY_API_KEYto your key. Live requests require managed inference and available credits.
curl "$SONNELY_ORIGIN/api/sonnely/v1/chat/completions" \ -H "Authorization: Bearer $SONNELY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-ai/DeepSeek-V4.1-Flash-1017", "messages": [{"role":"user","content":"Summarize this design."}] }'API reference
Base URL https://sonnely.com/api/sonnely/v1
GET /models- Public model discovery. Each entry includes the exact
idto pass to the completion endpoint. POST /chat/completions- Send JSON with
Authorization: Bearer $SONNELY_API_KEY. Passmodel,messages, and optionallymax_tokensandstream: false.
Read text from choices[0].message.content and token counts from usage. Use clients that support non-streaming Chat Completions with text messages. Streaming, tool calls, multimodal inputs and the Responses API are outside this API’s current contract.
Request limits
- Body
- 36,000 bytes of JSON, including text and formatting.
- Messages
- Up to 32, each with role
system,userorassistantand a text string up to 12,000 characters. - Output tokens
- 512 by default, configurable from 1 to 2,048.
Provider context windows in the catalog describe the models. Every request through Sonnely is subject to the gateway limits above.
Errors and recovery
Read error.message for the specific issue returned by the gateway.
| Status | Meaning | What to do |
|---|---|---|
| 400 | Malformed JSON or unsupported fields | Check the request format and supported fields. |
| 401 | Missing, expired or invalid key | Check the Authorization header and the key in the console. |
| 402 | Insufficient credits or key budget | Review available credits and the key’s daily and lifetime limits. |
| 404 | Unknown model ID | Use the ID returned by the model-list endpoint. |
| 413 | Request body too large | Reduce the amount of text or send fewer messages. |
| 415 | Unsupported media type | Send Content-Type: application/json. |
| 429 | Account request limit | Wait one minute before trying again. |
| 502 | Provider failure, timeout or incomplete usage | Check the usage ledger before retrying. A reservation may still be held. |
| 503 | Account service or managed inference unavailable | Check status in the console. Use a sample while inference is unavailable. |
Key management
Give each app or task its own key so you can track usage separately. Set a daily budget, a lifetime budget and an expiry as needed. Daily budgets reset at midnight UTC. Create and verify a replacement before revoking the old key during a rotation.
Manage keysData handling
HTTPS protects requests in transit to the Sonnely gateway. The gateway reads prompts for validation and forwards them to NEAR AI Cloud. Account and usage records include the wallet identity, model, key label, token counts, request status and charges. The ledger excludes prompt and response text.
Optional chat history is stored in this browser. Manage it in Settings and clear it on shared devices.
Attestation
NEAR AI publishes hardware evidence for its Private TEE model tier. Check the provider’s evidence and assess the Sonnely gateway separately. Through this gateway, clients do not receive end-to-end encryption or per-response attestation verification.
NEAR AI verification guidePayments and credits
Start in Billing. Eligible accounts can buy credits in any positive USDC amount with up to six decimal places. Review the network, amount and recipient before approving. Your wallet pays the SOL network fee and any token account setup.
- On Seeker, open Sonnely in Android Chrome and select Solana mobile wallet when you connect. Select the account you use for Sonnely.
- Continue to payment and choose Pay with connected wallet. Approve the transfer in your wallet. You can also use a Solana Pay link or scan the QR on another device.
- Credits post automatically after the transfer finalizes. To continue later, choose Resume payment in Billing. If needed, check a transaction signature manually.
Verified mainnet payments create spendable credits. NEAR Intents provides informational quotes.
Read the pricing and settlement guide