> For the complete documentation index, see [llms.txt](https://api-docs.helloaviary.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.helloaviary.ai/callmetrics.md).

# CallMetrics

Internal-only observability data for a call (latency percentiles, STT confidence, TTS cache stats, etc.). One row per call, looked up by `call_id`.

## Get call\_metrics for a call (internal)

> Returns the \`call\_metrics\` row keyed by \`call\_id\` (NOT by the\
> metrics row's PK — callers always know the call\_id). 404 if no\
> metrics row has been written yet (the metrics worker is async).\
> Soft-deleted rows hidden by default; pass \`include\_deleted=true\`\
> to see them anyway.<br>

```json
{"openapi":"3.0.3","info":{"title":"Aviary v1 API (merged — Osprey v1 + legacy clientApi)","version":"1.0.0"},"tags":[{"name":"CallMetrics","description":"Internal-only observability data for a call (latency percentiles, STT\nconfidence, TTS cache stats, etc.). One row per call, looked up by\n`call_id`.\n"},{"name":"Internal","description":"Internal-only endpoints. Forbidden for external client keys."}],"servers":[{"url":"https://osprey.helloaviary.com/api","description":"Production"},{"url":"https://osprey-dev.helloaviary.com/api","description":"Development"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"API key for authentication"}},"schemas":{"CallMetricsResponse":{"type":"object","required":["data","meta"],"description":"Internal-only call observability data. The `data` object echoes every\ncolumn on `call_metrics` keyed by snake_case column name. Most\nnumeric columns are nullable — null means \"not measured for this\ncall\" rather than zero.\n","properties":{"data":{"type":"object","additionalProperties":true,"description":"Raw `call_metrics` row keyed by column name."},"meta":{"$ref":"#/components/schemas/Meta"}}},"Meta":{"type":"object","required":["request_id"],"properties":{"request_id":{"type":"string","format":"uuid","description":"Unique ID for this request. Echoed in the `X-Request-ID` response\nheader. Send this back to support to debug a specific call.\n"}}},"ErrorEnvelope":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string"},"request_id":{"type":"string","format":"uuid"}}}}},"ErrorCode":{"type":"string","enum":["bad_request","unauthorized","forbidden","not_found","conflict","internal_error","field_not_editable","call_already_started"]}}},"paths":{"/internal/v1/call-metrics/{call_id}":{"get":{"summary":"Get call_metrics for a call (internal)","description":"Returns the `call_metrics` row keyed by `call_id` (NOT by the\nmetrics row's PK — callers always know the call_id). 404 if no\nmetrics row has been written yet (the metrics worker is async).\nSoft-deleted rows hidden by default; pass `include_deleted=true`\nto see them anyway.\n","operationId":"getCallMetricsInternalV1","tags":["CallMetrics","Internal"],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallMetricsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid X-Api-Key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"External key cannot reach internal scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No metrics row for that call_id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://api-docs.helloaviary.ai/callmetrics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
