Update Token Balance
curl --request POST \
--url https://api.app.shinzo.ai/v1/agent/{id}/balance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"type": "<string>"
}
'Update Token Balance
Update an agent’s output token balance by incrementing or setting directly.
POST
/
v1
/
agent
/
{id}
/
balance
Update Token Balance
curl --request POST \
--url https://api.app.shinzo.ai/v1/agent/{id}/balance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"type": "<string>"
}
'Authentication
Requires JWT token or Platform API key viaAuthorization: Bearer <token> header.
string
required
Agent UUID
number
required
Number of output tokens to add (increment) or set as the new balance (set)
string
required
Update type:
increment (adds to current balance) or set (replaces balance)Example Request
Increment Balance
curl -X POST https://api.app.shinzo.ai/v1/agent/a1b2c3d4-e5f6-7890-abcd-ef1234567890/balance \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"amount": 500000,
"type": "increment"
}'
Set Balance
curl -X POST https://api.app.shinzo.ai/v1/agent/a1b2c3d4-e5f6-7890-abcd-ef1234567890/balance \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"amount": 1000000,
"type": "set"
}'
Example Response
{
"message": "Agent balance updated successfully",
"new_balance": 1500000,
"previous_balance": 1000000
}
Token balance controls how many output tokens the agent can generate. At Sonnet 4.5 pricing (~15permilliontokens),abalanceof1,000,000tokens≈15 of usage.
Status Codes
| Code | Description |
|---|---|
200 | Balance updated successfully |
400 | Invalid amount or type |
401 | Unauthorized - invalid or missing authentication |
404 | Agent not found |

