Billing

You pay for the tokens a model generates. The prompt is free, so a 4,000-token document that returns a 120-token answer is billed as 120 tokens.

You pay with USDC on Solana. There is no card on file, no subscription and no invoice. You do not need an account in the usual sense: the key is generated on your device and the balance is attached to it. No name, email or ID is collected.

What a request costs

The price is per model and per generated token, set by the operator who publishes the model. It does not change with which machine serves the request. The price can change over time; the app shows the price in force before you send, and every response reports what the request cost.

Reading a price

The price lookup does not need a key, so you can check a model before you hold credit.

curl -s "https://api.autarcho.com/model/<hash>/price?for_client=true"

The models page lists a price per model, and each model page shows the same figure.

When you are not charged

  • A request that is refused before it runs, such as a parameter we do not accept.
  • A request that fails without producing any text.
  • A request whose price is above the limit you set.

In each case the balance is unchanged, and the error names the reason.

Capping the price

Add max_price_per_token_micro_usdc to any request. If the model's price is above it, the request is refused with 402 before anything is charged, which is the simplest way to bound what a loop can spend.

Streams that stop early

If a stream is cut off, the tokens already produced are charged, because they were delivered. A client that gives up after a few seconds pays for what it received and nothing more.

Retrying without paying twice

Send Idempotency-Key with a value between 1 and 255 characters using letters, digits, ., _, : or -. The key belongs to your account, so two keys can use the same value without colliding.

SituationWhat happens
The same request is sent again with the same keyThe stored response is returned and nothing is charged.
The first request is still running409 idempotency_in_progress with Retry-After.
The body changed under the same key409 idempotency_key_reused. Use a new key for a different request.
A stream was already completed under the key409 idempotency_already_completed. Streamed answers are not replayed.

A request that failed can be retried with the same key. A failed request is not charged, so retrying it is what the key is for.

What a response reports

usage.completion_tokens is the number of tokens billed. usage.prompt_tokens is zero because the prompt is not billed. usage.cost_micro_usdc is the charge for that request, in millionths of a USDC.