---
title: "An agent's calls, outgoing and incoming"
method: GET
path: "/api/v1/agents/{id}/calls"
tags: ["Agents"]
---

# An agent's calls, outgoing and incoming

`GET /api/v1/agents/{id}/calls`

## Request

- Base URL: `https://app.lastping.dev`
- URL: `https://app.lastping.dev/api/v1/agents/{id}/calls`
- Auth: API key in header `X-Api-Key`

The calls table: the same rows as `/dependencies` for
`direction=out` (the default), the agent's callers for
`direction=in`, or both for `direction=all`. Each outgoing row also
names its top five operations (span names), counted over the agent's
newest 10 traced runs in the range. Most calls first, at most 50;
`more` counts the rest.

## Query parameters

- `range` '24h' | '7d' | '30d'
- `direction` 'out' | 'in' | 'all'

## Response `200`

The agent's calls.

- AgentCalls: The body of `GET /api/v1/agents/{id}/calls`.
  - `range` '24h' | '7d' | '30d', required
  - `direction` 'out' | 'in' | 'all', required
  - `calls` Call[], required: At most 50, most calls first.
    - `kind` 'model' | 'tool' | 'http' | 'database' | 'queue' | 'rpc' | 'agent', required
    - `name` string, required: The display name: `postgresql app`, `api.github.com`, `anthropic claude-sonnet-4-5`. Never a URL and never a path.
    - `direction` 'out' | 'in', required: `out` for something the agent calls, `in` for a caller of the agent.
    - `calls` integer, required
    - `errors` integer, required: Calls whose span reported an error status.
    - `error_rate` number, double, required: `errors / calls`, from 0 to 1; 0 when there were no calls.
    - `p50_ms` integer, required
    - `p95_ms` integer, required
    - `p95_is_floor` boolean, required: True when the 95th percentile call was slower than the last bucket (60 s), so `p95_ms` is a floor.
    - `tokens_in` integer, nullable, required: Input tokens, including cache reads (the OpenTelemetry rule). Null for every kind but `model`.
    - `tokens_out` integer, nullable, required: Output tokens. Null for every kind but `model`.
    - `cost_usd` string, nullable, required: Cost in US dollars as decimal text. Null for every kind but `model`, and for a model no call reported or could be priced.
    - `cost_source` string, required: What `cost_usd` is made of. A plain string, not an enum, so a new value never breaks a client: `client` when every priced call's cost was reported by the client (the exporter's own figure, or Claude Code's per-call cost), `estimated` when LastPing priced every call at API list prices, `mixed` when the sum holds both, empty when `cost_usd` is null.
    - `series` DependencySeriesPoint[], required: One point per UTC day of the range, oldest first, including days with no calls, for a row sparkline.
      - `day` string, date, required
      - `calls` integer, required
      - `errors` integer, required
    - `operations` CallOperation[], required
      - `name` string, required: A span name, as the instrumentation named it.
      - `calls` integer, required: How many calls in the sampled runs carried this name.
  - `more` integer, required: How many more rows the range holds beyond the ones returned.

## Other responses

- `400`: An invalid `range` or `direction` (`INVALID_FILTER`).
- `401`: Missing or invalid API key.
- `404`: Agent not found in this project (unknown UUID or slug).

---

[API](https://skmtc.dev/lastping/apis/lastping-management-api.md) · [All operations](https://skmtc.dev/lastping/apis/lastping-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/lastping/apis/lastping-management-api/revisions/bbc6eda91c46?raw)
