Server-Side Errors
What should I do if a request returns a 401 error?
Check the following: 1) the Authorization Header format (include one space after Bearer before the API Key); 2) whether the API Key has expired or someone deleted it; and 3) whether you are using an API Key from the correct workspace.
Why did I receive a 429 rate-limit error?
You hit an RPM (requests per minute) or TPM (tokens per minute) limit. Use exponential-backoff retries, or raise the API Key’s RPM limit in the console.
How can I view token usage and charges?
Open the console’s “Usage Logs” page. Filter by time, model, and API Key to view detailed consumption records and charges for each call.
What is a balance?
Your balance is the available workspace funding used to settle API-request charges. Before a request, the system checks whether the balance covers input tokens and the provider’s estimated output tokens. After the request, it charges the provider’s actual upstream cost. If that cost exceeds the estimate, the balance can be negative after settlement; this is normal. Top-ups increase the balance but do not automatically increase quotas. A balance is not a subscription plan.
What is a quota?
A quota is a workspace or API Key usage limit. Balance represents funds, while quota represents available usage; they are independent. Under high concurrency, quota checks and settlement can overlap so that the final request can complete, and a negative quota is normal. When you update a quota, the system refreshes both used and total quota.
How should I handle a 402 Insufficient Quota response?
This error can mean an insufficient balance or an exhausted quota for the current workspace or API Key. First confirm the balance on the “Billing” page, then check limits and used quota on the API Key and workspace usage or quota pages. Top-ups increase balance only; changing quotas does not increase balance. After both are sufficient, check model availability and whether the request uses the correct workspace.
Why do requests still fail after my balance or quota changes?
Confirm that the API Key for this request belongs to the adjusted workspace, and check whether someone disabled the Key, it has expired, or it has a lower individual quota. Usage and balance can take a moment to synchronize. If console status has updated but requests still fail, contact support with the request time, a redacted Key identifier, and the request ID; do not send the full API Key.
What does a 502/504 error mean?
502 and 504 are gateway-layer errors. A 502 usually means the gateway received an invalid response from, or failed to connect to, the upstream provider; a 504 means the upstream provider or the gateway’s waiting path timed out. The status alone cannot identify whether the fault is upstream or inside Token Market, so use the request ID, routed provider, and error reason in request logs to investigate. For safe-to-retry requests, use jittered exponential backoff and consider enabling fallbacks or broadening filters. Do not blindly replay streaming or non-idempotent generations because you could be charged or generate duplicate output. If the problem persists, contact support with the request time, model, provider, and request ID.
How do I contact technical support?
Submit a support ticket through the “Feedback” option in the lower-right corner of the console, or email
support@tokensmarket.ai.