Same SDK.
Cost in every response.
Point any OpenAI SDK at DIME and call 450+ models with one key. Non-streaming responses carry the exact charge, the list rate and your remaining balance in X-Dime-* headers.
/v1- Auth
- Authorization: Bearer sk-dime-…
- Models
- — live · /v1/models
- Rate limit
- 120 requests / min per key
- At a $0 balance
- 10 free calls on FREE models
Get a key
- Open /account and connect a wallet. Signing in is a message signature: free, no transaction, no gas.
- Press Create key. The full key (sk-dime-…) is shown once; DIME keeps only a hash of it.
- Call the API. With a $0 balance the key already works on FREE models, so you can test before paying anything. Rotate any time; the old key stops working at once.
Free allowance
An account with a $0 balance can make a small number of real calls so the API can be evaluated without a top-up. Once your balance is above $0, every call is billed to it, FREE models included.
| Allowance | 10 calls per account, separate from the 10 chat messages each browser gets on the home page |
| Models | FREE models only: output rate at or below $1.00 per 1M tokens. See the list |
| Reply length | up to 1,200 output tokens per free call |
| Shared limits | 30 free messages per IP per day, and a site-wide daily free budget of $2. When it is spent, calls return 402 free_paused until the next UTC day. |
| Remaining | returned on every free call in X-Dime-Free-Left |
Make a request
Use the official OpenAI SDKs with a different base URL, or plain HTTP. Model ids are OpenRouter ids such as openai/gpt-4o-mini; the full list is at /models.
Supported parameters
model, messages (text and image parts for vision models), stream, max_tokens / max_completion_tokens, temperature, top_p, stop, tools, tool_choice, parallel_tool_calls, response_format, seed, presence_penalty, frequency_penalty, logit_bias, reasoning. Other fields are ignored.
Streaming
Set stream: true to receive OpenAI-format server-sent events, ending with data: [DONE]. Headers are sent before the cost is known, so streaming responses carry no X-Dime-* headers. The charge for each streamed call appears in your usage table at /account (and in GET /api/me/usage with your session).
Response headers
| Header | Value |
|---|---|
| X-Dime-Cost | USD charged for this call: tokens × list rate, or the cost OpenRouter reports if that is lower, rounded up to the next $0.000001 |
| X-Dime-Balance | Balance after the charge (the agent's balance for agent keys) |
| X-Dime-Free-Left | Free API calls left on this account |
| X-Dime-Rate-In-Per-M | Input list rate, USD per 1M tokens |
| X-Dime-Rate-Out-Per-M | Output list rate, USD per 1M tokens |
To check a charge yourself: prompt_tokens × rate_in + completion_tokens × rate_out, divided by 1,000,000. The charge never goes above that figure: when OpenRouter reports a lower cost for the request (for example cached-prompt pricing), you pay the lower one. The only other difference is rounding up to the next $0.000001.
How a call is billed
- Hold. Before calling the model, DIME reserves the most the call could cost (estimated prompt tokens × input rate + max_tokens × output rate) and lowers max_tokens to what your balance can cover.
- Call. The request goes to the provider through OpenRouter at its list rate. DIME adds no markup on usage.
- Settle. DIME charges tokens × list rate, or the cost OpenRouter reports when that is lower, records the tokens and cost in your usage table, and releases the rest of the hold. If the provider fails, the hold is released and nothing is charged.
Errors
| Status · code | Meaning |
|---|---|
| 401 invalid_api_key | Missing or unknown key. Create one at /account. |
| 402 top_up | Your balance is $0 and the model is not FREE, or your free API calls are used up. |
| 402 insufficient_balance | Your balance (or the agent's, for agent keys) cannot cover a minimal reply on this model. |
| 402 free_paused | The site-wide daily free budget is spent. Free calls resume the next UTC day. |
| 400 bad_model | Unknown model id. Use an id from /v1/models. |
| 400 bad_messages | Messages missing, malformed, more than 200 entries or over 400,000 characters. |
| 429 rate_limited | More than 120 requests in a minute on this key. |
| 502 upstream_error | The provider returned an error. You were not charged. |
Non-streaming errors use the OpenAI shape {"error": {"message", "code"}}. On streaming calls, errors raised before the stream starts return {"error": "<code>", "message"}, and an empty agent balance is reported as agent_empty. The web chat also uses sign_in and model_needs_balance for visitors without an account; API keys always belong to an account or agent, so the API answers top_up in those cases.
List models
Returns every model with its context length and list rates per 1M tokens. The same data in DIME's own shape is at /api/models.
Public JSON endpoints
Every number on this site comes from one of these. Open them in a new tab, or preview them here.
| Endpoint | Returns | Check |
|---|
Agent API keys
An agent's creator can create an API key for it under Your agents at /account, or with POST /api/agents/<slug>/apikey while signed in. Agent keys use the same /v1 endpoints but bill the agent's own balance, which is funded by of its coin's creator fees. They have no free allowance; when the agent's balance cannot cover a call the API returns 402 insufficient_balance. The agent's persona prompt is not added to API calls: messages reach the model as you send them.
Limits and data
| Balance | Custodial: held by the DIME server, non-transferable, and non-refundable except where law requires. It is not a token. |
| Prompts | Requests go to the model provider through OpenRouter; providers may log them under their own terms. DIME records the model, token counts and cost of each call, not the request or response text. |
| Browsers | The API sends no CORS headers, so call it from a server or script. Browser calls work only from this site, as in the box above. |
| Keys | One key per account; rotating replaces it immediately. Keep it server-side. |
| Top-ups | A 5% platform fee applies to top-ups, not to usage. The top-up bonus depends on the bonus reserve and can be 0%. |