Skip to content

API

Usage and credits

The cost of a request is in its reply, so you never have to look it up afterwards.

Where to read it

  • A chat reply’s usage: the tokens used, the credits charged and the credits you have left.
  • An agent run’s steps: each step’s credits, and the run’s total, on GET /v1/agents/:slug/runs/:runId.
  • Your balance, at any time, on GET /v1/credits/balance.

The app’s Usage page shows the same account, with its history. A request that fails is not charged. Rates per model are in the Model Hub.

Common questions

Where do I read what a request cost?

In a chat reply's usage, in each step of an agent run, and on your balance. The Usage page in the app shows the same account with its history.

Am I charged for a request that fails?

No. The credits set aside for a failed request go back to your balance.

How do I check my balance from code?

Send a GET request to /v1/credits/balance.

Where to go next

  • Models API

    The chat request and its reply.

    Open
  • Credit rates

    What each model costs per 1,000 tokens.

    Open
  • Plans and credits

    Plans

    What each plan includes and which models it reaches.

    Open

Not open to the public yet

The cost of a request is in its reply, so you never have to look it up afterwards.

Existing accounts can sign in. To ask about access, contact us.

API usage and credits | MayuAI