Skip to content
Main Site News Console

Log Query API

4ALL API provides an interface for querying call logs by token, which can be used for business-side reconciliation and usage auditing — authenticate with the API token itself, and only logs generated by that token are returned.

Query token logs

Terminal window
curl https://api.4allapi.com/api/log/token \
-H "Authorization: Bearer $AIPROXY_KEY"

Example response (excerpt):

{
"success": true,
"data": [
{
"model_name": "gpt-5.5",
"prompt_tokens": 120,
"completion_tokens": 260,
"quota": 1372,
"created_at": 1735900000
}
]
}
  • quota is the amount deducted for this call (internal unit, converted to USD according to the site display ratio);
  • This returns recent logs, suitable for spot checks and reconciliation; complete filtering (by time/model/token) is more convenient on the console’s “Logs” page.

Account-level logs

The console’s “Logs” page supports multi-dimensional filtering and export by time, model, and token; programmatic account-level queries require the system access token in the console’s “Personal Settings” (different from the API token, with higher privileges, do not write it into business code), used together with /api/log/self.

Recommendations

  • For reconciliation, cross-check both the usage field and this interface;
  • This interface is rate-limited, so do not poll frequently; pulling by hour/day is sufficient.