Skip to main content
POST
/
agents
/
query
Genai Agents Query
curl --request POST \
  --url https://api.example.com/agents/query \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": "<string>",
  "filters": {
    "agent_name": "<string>"
  },
  "sort_by": [
    {
      "field": "<string>",
      "direction": "desc"
    }
  ],
  "limit": 100,
  "offset": 0
}
'
{
  "agents": [
    {
      "project_id": "<string>",
      "agent_name": "<string>",
      "invocation_count": 123,
      "span_count": 123,
      "total_input_tokens": 123,
      "total_output_tokens": 123,
      "total_duration_ms": 123,
      "error_count": 123,
      "first_seen": "2023-11-07T05:31:56Z",
      "last_seen": "2023-11-07T05:31:56Z"
    }
  ],
  "total_count": 0
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json

Request to list agents with aggregated stats for a project.

project_id
string
required
filters
AgentsQueryFilters · object

Optional filters for querying agents.

sort_by
AgentSortBy · object[] | null
limit
integer
default:100
Required range: 0 <= x <= 10000
offset
integer
default:0
Required range: x >= 0

Response

Successful Response

Response containing aggregated agent stats.

agents
AgentSchema · object[]
required
total_count
integer
default:0