Skip to content

Monitor usage and control quotas

When requests stop unexpectedly, people often mix up balance, quota, and per-request usage. Separate those three questions first, or it is hard to know what actually failed.

Distinguish these three measurements first

Section titled “Distinguish these three measurements first”
Item Question it answers Where to look
Account balance Can the account continue to incur usage? Wallet in the ZhiFlo API portal
Token quota How much can this credential consume? API Keys and the Token settings
Response usage How much input and output did this request process? API response or Usage Logs in the portal

A client’s token count usually describes processed input and output text. It is not necessarily the final charge. Use the portal for current prices, units, and model availability.

  1. Create one Token per device or client from API Keys.
  2. Give it a recognizable name, such as “Laptop Codex.”
  3. Choose a finite expiration and a finite quota suited to that task.
  4. After observing normal use, adjust the next limit instead of removing the cap entirely.

Back on API Keys, the Token row should show the expiration and quota you selected.

If one client reaches its limit, other devices can continue. Separate names also make the source of usage easier to identify.

This gives you two practical benefits: one client can hit its limit without stopping the others, and the source of usage is much easier to identify.

Check in this order:

  1. Has the Token expired, been revoked, or reached its own quota?
  2. Does the balance or account state in Wallet permit more requests?
  3. Is the current model still available to the account?
  4. Is the client sending too many concurrent requests?

When a Token reaches its quota, keep the usage record so you can identify the source. After confirming the purpose, adjust the control or create another finite Token and update only that client.

Supported responses may include a usage object. Keep only the fields relevant to the request, such as input, output, or total units; names can differ by request type.

{
"usage": {
"...": "..."
}
}

This object is useful for understanding one request. It does not replace the account and Token state shown in the portal.

To inspect one call, open Usage Logs and find the record by request time, model, and status. The matching row should show that request’s status and usage. Redact private details before keeping or sharing the record, and never send a complete Token or private conversation.

Next: for 429 or a missing reply, use API errors.