Send your key as Authorization: Bearer <key> or as x-api-key: <key>. Keys are stored hashed, so they are shown once when created and can't be read back.
Each key can carry a daily spend cap, and you can rename or revoke it in the app at any time. The app itself signs in with a wallet using Sign-In with Ethereum on Robinhood Chain.
Keep keys on your server. A key shipped inside a browser or mobile app can be read by anyone who has the app.
POST /v1/chat/completions takes the OpenAI Chat Completions body, and POST /v1/messages takes the Anthropic Messages body. Both stream, both support tool use, and every chat model works on both.
What we drop before sending
Field
Why
user
It identifies your end user
metadata
It can carry identifiers
store
Nothing is stored
provider routing fields
Routing is ours, and prices never change because of it
GET /v1/models lists every model with its modality, its price, the maker's list price with its source and check date, the saving, its privacy label (anonymized or sealed) and its status.
POST /v1/images and POST /v1/jobs answer at once with a job id and hold the job's maximum price. GET /v1/jobs/{id} reports the status, and each finished output streams from GET /v1/jobs/{id}/output/{n} on our own domain.
A job that fails releases its hold in full. The job id is forgotten 24 hours after the job completes, so save outputs when they arrive. The app does this for you, in your browser.
GET /v1/sealed/models lists the Sealed models with their provider and pinned measurement, and GET /v1/sealed/attestation/{model} returns the hardware's current attestation so a client can check it.
A Sealed request is encrypted on the client to the attested hardware's key, and we pass the ciphertext through without reading it. The app does this at launch, and an SDK for API clients follows, since a plain OpenAI or Anthropic client can't encrypt to the hardware.
Each call holds its worst case first, then settles at its exact cost. Every reply carries a request id and, outside streams, what you paid in micro-dollars.
Reply headers
Header
What it reports
moth-request-id
The request's id, for support
moth-charged-micros
What the call cost you, in micro-dollars
GET /v1/usage returns your balance and your requests, tokens and spend by day and by model, with no content.
Errors come back in the shape of the endpoint you called, OpenAI's on /v1/chat/completions and Anthropic's on /v1/messages, with the same statuses on both.
Statuses
Status
Type
When it happens
400
invalid_request_error
The request body isn't valid
401
authentication_error
The key is missing, not valid or revoked
402
insufficient_credit
The balance or the key's daily cap can't cover the call's worst case
404
not_found_error
The model isn't in the catalog
429
rate_limit_error
The key sent too many requests, so wait for retry-after