---
title: "AI data health checks"
method: GET
path: "/api/{org_id}/gen_ai/data_health"
tags: ["GenAI Settings"]
---

# AI data health checks

`GET /api/{org_id}/gen_ai/data_health`

## Request

- Base URL: `https://api.openobserve.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.openobserve.ai/api/{org_id}/gen_ai/data_health`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/gen_ai/data_health/get.ts> (a function with typed inputs; its response is checked against the schema)

Counts LLM spans with no model price, no agent identity, zero duration, or no session id in a trace stream and window. Pass include_samples=true for sample trace ids per failing check. Results are cached for about a minute; pass refresh=true to recompute.

## Path parameters

- `org_id` string, required

## Query parameters

- `stream_name` string, required
- `start_time` integer, required
- `end_time` integer, required
- `agent` string
- `agent_id` string
- `env` string
- `version` string
- `refresh` boolean
- `include_samples` boolean

## Response `200`

Data health checks

- DataHealthResponse
  - `checked_at` integer, required: When the checks ran, microseconds.
  - `checks` HealthCheck[], required
    - `affected` integer, required: LLM spans the problem touches.
    - `id` 'unpriced_models' | 'missing_agent_identity' | 'zero_duration_spans' | 'missing_session_id', required
    - `model_count` integer, nullable: Unpriced check only: every distinct model behind the unpriced spans (spans without a model name count as one), however many `models` lists.
    - `models` ModelUsage[], nullable: Unpriced check only: the 20 models with the most unpriced tokens.
      - `model` string, nullable: Null for spans that carry no model name.
      - `spans` integer, required
      - `tokens` integer, required
    - `models_truncated` boolean, nullable: Unpriced check only: `models` leaves some of the `model_count` models out.
    - `samples` string[], nullable: Up to three recent trace ids with the problem; present only with `include_samples`.
    - `status` 'pass' | 'warning' | 'error', required
    - `total` integer, required: LLM spans checked.
    - `unpriced_tokens` integer, nullable: Unpriced check only: tokens on every unpriced span.

## Other responses

- `400`: Invalid query
- `403`: Forbidden
- `429`: Search not allowed for the organization
- `500`: Internal server error

---

[API](https://skmtc.dev/openobserve/apis/openobserve-api-http.md) - [All operations](https://skmtc.dev/openobserve/apis/openobserve-api-http/llms.txt) - [OpenAPI document](https://skmtc.dev/openobserve/apis/openobserve-api-http/revisions/0529b8a10252?raw)
