Get task cost and usage
Returns the settlement status, final user cost, estimated cost, and token usage for a recent task. Public API keys can retrieve only tasks originally created by that same API key, even when another key belongs to the same organization. This lookup remains available after the key reaches its spending limit, but expired, revoked, or scoped keys are still rejected. When settled is false, cost is not final and must not be used for billing or reconciliation. Use estimated_cost only as a display estimate until final settlement completes. Older task execution records may be archived after the retention window and then return 404. Use billing records or billing exports for long-term reconciliation.
Request
- Base URL: https://api.sandbase.ai
- URL: https://api.sandbase.ai/v1/tasks/{task_id}/cost
- Auth: HTTP bearer
Path parameters
Opaque task ID returned by a billable operation, including an x-task-id response header when present.
Response
Task cost and usage
Example response
{
"cost": "0.001234",
"estimated_cost": "0.001234"
}Changes
No recorded changes to this operation across all 1 revision of this API.