---
title: "What an agent calls"
method: GET
path: "/api/v1/agents/{id}/dependencies"
tags: ["Agents"]
---

# What an agent calls

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

## Request

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

The agent's outgoing dependencies over the range (models, tools,
HTTP hosts, databases, queues, RPC targets, other agents), inferred
from its spans with no configuration, each with calls, errors, error
rate, p50 and p95 latency, tokens and cost for models, and a daily
series. Most calls first, at most 50; `more` counts the rest.

Read from the daily dependency aggregate (kept 90 days), never from
raw spans. A range covers every UTC day that overlaps it.

## Query parameters

- `range` '24h' | '7d' | '30d'

## Response `200`

The agent's dependencies.

- AgentDependencies: The body of `GET /api/v1/agents/{id}/dependencies`.
  - `range` '24h' | '7d' | '30d', required
  - `dependencies` Dependency[], 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
  - `more` integer, required: How many more dependencies the range holds beyond the ones returned.

## Other responses

- `400`: An invalid `range` (`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)
