Developers · OpenAI-compatible API

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.

Base URL
/v1
Auth
Authorization: Bearer sk-dime-…
Rate limit
120 requests / min per key
At a $0 balance
10 free calls on FREE models
01

Get a key

free · no payment
  1. Open /account and connect a wallet. Signing in is a message signature: free, no transaction, no gas.
  2. Press Create key. The full key (sk-dime-…) is shown once; DIME keeps only a hash of it.
  3. 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.
02

Free allowance

accounts at $0

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.

Allowance10 calls per account, separate from the 10 chat messages each browser gets on the home page
ModelsFREE models only: output rate at or below $1.00 per 1M tokens. See the list
Reply lengthup to 1,200 output tokens per free call
Shared limits30 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.
Remainingreturned on every free call in X-Dime-Free-Left
03

Make a request

chat.completions

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.

04

Streaming

stream: true

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).

05

Response headers

non-streaming calls
HeaderValueSent
X-Dime-CostUSD charged for this call: tokens × list rate, or the cost OpenRouter reports if that is lower, rounded up to the next $0.000001every success
X-Dime-BalanceBalance after the charge (the agent's balance for agent keys)billed calls
X-Dime-Free-LeftFree API calls left on this accountfree calls
X-Dime-Rate-In-Per-MInput list rate, USD per 1M tokensevery success
X-Dime-Rate-Out-Per-MOutput list rate, USD per 1M tokensevery success

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.

06

How a call is billed

hold → settle
  1. 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.
  2. Call. The request goes to the provider through OpenRouter at its list rate. DIME adds no markup on usage.
  3. 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.
07

Errors

HTTP status · code
Status · codeMeaning
401  invalid_api_keyMissing or unknown key. Create one at /account.
402  top_upYour balance is $0 and the model is not FREE, or your free API calls are used up.
402  insufficient_balanceYour balance (or the agent's, for agent keys) cannot cover a minimal reply on this model.
402  free_pausedThe site-wide daily free budget is spent. Free calls resume the next UTC day.
400  bad_modelUnknown model id. Use an id from /v1/models.
400  bad_messagesMessages missing, malformed, more than 200 entries or over 400,000 characters.
429  rate_limitedMore than 120 requests in a minute on this key.
502  upstream_errorThe 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.

08

List models

GET /v1/models · no key needed

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.

09

Public JSON endpoints

no key, no login

Every number on this site comes from one of these. Open them in a new tab, or preview them here.

EndpointReturnsCheck
10

Agent API keys

sk-dime-a-…

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 50% 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.

11

Limits and data

read before you build
BalanceCustodial: held by the DIME server, non-transferable, and non-refundable except where law requires. It is not a token.
PromptsRequests 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.
BrowsersThe 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.
KeysOne key per account; rotating replaces it immediately. Keep it server-side.
Top-upsA 5% platform fee applies to top-ups, not to usage. The top-up bonus depends on the bonus reserve and can be 0%.