Skip to content
gist.link ↗

agentUsage

Query Agent Workforce API — POST https://agentworkforce.api.gist.link/graphql

Per-day token/cost usage for one agent, most recent first.

agentworkforce:query:agentUsage

The calling IAM key must hold this permission (or a wildcard that covers it: agentworkforce:query:* or agentworkforce:*) and the access token must have been minted with audience=agentworkforce. See Permissions.

type Query {
agentUsage(agentUuid: ID!, days: Int): [AgentUsageDay!]!
}
Argument Type Required Description
agentUuid ID! Yes —
days Int No —

[AgentUsageDay!]! — see the Agent Workforce types reference.

Terminal window
curl https://agentworkforce.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "query AgentUsage($agentUuid: ID!, $days: Int) { agentUsage(agentUuid: $agentUuid, days: $days) { day tokensIn tokensOut costMinor llmCalls } }",
"variables": {
"agentUuid": "01a01234-abcd-7000-9000-0123456789ab",
"days": 10
}
}
JSON