API overview
Getting started
Base URL
Use the API Base URL shown in the Syon console. The examples below refer to it as$TEAMO_BASE_URL:
bash
Authentication
Send your Syon API key in theAuthorization header of every request:
http
Retrieve usage and billing for a single request
Use a request ID to retrieve the token usage and final charge for one model call. httpPath parameters
Request example
bashResponse example
jsonToken fields
Token categories that do not apply or are not provided by the upstream service return
0.
Retrieve billing for a time range
Retrieve billing totals for the authenticated API key over a time range. The basic response contains aggregate data only, not individual request records. httpQuery parameters
The query range must not exceed 90 days. Longer ranges return
400 invalid_request.
Request example
bashResponse example
jsonRetrieve token usage for a time range
Retrieve aggregate token usage for the authenticated API key over a time range. httpQuery parameters
The query range must not exceed 90 days. Longer ranges return
400 invalid_request.
Request example
bashResponse example
jsonRetrieve the account balance
Retrieve the available balance for the account associated with the current API key. httpRequest example
bashResponse example
jsonError handling
When an API call fails, the response body contains a stable error code and a message that helps diagnose the problem. jsonCommon error codes
Recommendations
- Use the same
start_timeandend_timewhen reconciling usage and billing so both queries use the same scope. - Prices may change. Use the
amountreturned with historical billing records instead of recalculating past charges from the current price list. - Configure reasonable timeouts and retries. Use exponential backoff for
429and5xxresponses.

