Balance API
Check how many credits you can spend, and how many of them expire at the next monthly refresh.
Moving from v1? Only the path changes. GET /openapi/v1/balance becomes GET /openapi/v2/balance, and the response stays the same. See Endpoint paths in the migration reference.
Get the balance
Returns the credit balance of the account that owns the API key. On a team with a shared credit pool, the values are those of the pool. Calling this endpoint is free.
Request
# Get your credit balance
curl https://api.meshy.ai/openapi/v2/balance \
-H "Authorization: Bearer ${MESHY_API_KEY}"
Response
{
"balance": 1000,
"monthly_credits": 600,
"permanent_credits": 400,
"monthly_resets_at": 1793491200000
}
Parameters
None.
Returns
- Name
- balance
- Type
- integer
- Description
Number of credits you can spend. It's usually
monthly_creditspluspermanent_credits.It's lower when a member credit limit or an Enterprise workspace credit limit applies to you. Team owners and admins have no such limit.
balancedoesn't take an API key credit limit into account. A request can still return402withAPI key credit limit reachedwhilebalanceis above zero.
- Name
- monthly_credits
- Type
- integer
- Description
Number of credits from your plan's monthly allowance. Meshy clears unused monthly credits at the next monthly refresh, at
monthly_resets_at. Some Enterprise plans carry part of them over.
- Name
- permanent_credits
- Type
- integer
- Description
Number of credits that don't expire, for example from credit packs you bought and from rewards.
- Name
- monthly_resets_at
- Type
- integer | null
- Description
Time of the next monthly refresh, in Unix milliseconds. At that time, your plan's monthly allowance replaces the remaining monthly credits.
nullwhen the account has no refresh date. On an account that doesn't refresh monthly, it can be a time in the past.
Failure modes
- Name
401 - Unauthorized- Description
The API key is missing or invalid. Check the
Authorizationheader.
- Name
429 - Too Many Requests- Description
You sent too many requests. Wait the number of seconds in
Retry-After, then retry.