---
title: "Get an AI run"
description: "The run and every GenAI span's metadata (its steps, oldest first), without content. 404 when the trace has no GenAI span in [from, to). 404 while AI Center isn't offered."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Observability API

`GET /v1/organizations/{orgId}/projects/{projectId}/obs/datasets/{datasetId}/genai/runs/{trace}`

The run and every GenAI span's metadata (its steps, oldest first), without content. 404 when the trace has no GenAI span in [from, to). 404 while AI Center isn't offered.

## Authentication

Requires one of the following:

- `apiKey`, http, header `Authorization`
- `oauth`, http, header `Authorization`
- `sessionCookie`, apiKey, in cookie

## Path parameters

- `GetGenAIRun.path.orgId` (string, required) — UUID or prefixed ID (org_…)
- `GetGenAIRun.path.projectId` (string, required) — UUID or prefixed ID (prj_…)
- `GetGenAIRun.path.datasetId` (string, required) — UUID or prefixed ID (dst_…)
- `GetGenAIRun.path.trace` (string, required) — The run's trace ID: 32 hexadecimal characters, not all zero. Anything else is 404.
  - pattern `^[0-9a-fA-F]{32}$`

## Query parameters

- `GetGenAIRun.query.from` (string, optional) — Default: 7 days ago.
  - format `date-time`
- `GetGenAIRun.query.to` (string, optional) — Default: a day ahead. At most 31 days after from.
  - format `date-time`

## Code samples

### cURL

```curl
curl --request GET \
  --url https://obs.ezghcloud.com/v1/organizations/string/projects/string/obs/datasets/string/genai/runs/string \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://obs.ezghcloud.com/v1/organizations/string/projects/string/obs/datasets/string/genai/runs/string';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://obs.ezghcloud.com/v1/organizations/string/projects/string/obs/datasets/string/genai/runs/string"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The run.

#### Example

```json
{
  "agent": "string",
  "cacheReadTokens": 0,
  "cacheWriteTokens": 0,
  "conversationId": "string",
  "durationMs": 0,
  "errors": 0,
  "inputTokens": 0,
  "llmCalls": 0,
  "match": {
    "field": "string",
    "snippet": "string",
    "spanId": "string"
  },
  "models": [
    "string"
  ],
  "outputTokens": 0,
  "startTime": "2019-08-24T14:15:22Z",
  "status": "ok",
  "toolCalls": 0,
  "traceId": "string",
  "steps": [
    {
      "agentName": "string",
      "cacheReadTokens": 0,
      "cacheWriteTokens": 0,
      "contentBytes": 0,
      "durationMs": 0,
      "errorType": "string",
      "finishReasons": [
        "string"
      ],
      "inputTokens": 0,
      "model": "string",
      "operation": "string",
      "outputTokens": 0,
      "parentSpanId": "string",
      "spanId": "string",
      "startTime": "2019-08-24T14:15:22Z",
      "status": "ok",
      "toolCallId": "string",
      "toolName": "string",
      "truncated": true
    }
  ]
}
```

- `GetGenAIRun.response.200.agent` (string | null, required) — The root invoke_agent span's gen_ai.agent.name, else the earliest GenAI span's.
- `GetGenAIRun.response.200.cacheReadTokens` (integer, required)
- `GetGenAIRun.response.200.cacheWriteTokens` (integer, required)
- `GetGenAIRun.response.200.conversationId` (string | null, required)
- `GetGenAIRun.response.200.durationMs` (number, required)
- `GetGenAIRun.response.200.errors` (integer, required)
- `GetGenAIRun.response.200.inputTokens` (integer, required)
- `GetGenAIRun.response.200.llmCalls` (integer, required)
- `GetGenAIRun.response.200.match` (one of, required) — With text; null when no content field holds its first word as written.
  - one of: [GenAIMatch](/obs-api/schemas/GenAIMatch/), `null`
- `GetGenAIRun.response.200.models` (array<string>, required)
- `GetGenAIRun.response.200.outputTokens` (integer, required)
- `GetGenAIRun.response.200.startTime` (string, required) — UTC, millisecond precision: 2026-10-02T10:20:00.000Z.
  - format `date-time`
- `GetGenAIRun.response.200.status` (string, required)
  - one of `"ok"`, `"error"`
- `GetGenAIRun.response.200.toolCalls` (integer, required)
- `GetGenAIRun.response.200.traceId` (string, required)
- `GetGenAIRun.response.200.steps` (array<object>, required)
  - `GetGenAIRun.response.200.steps.agentName` (string | null, required)
  - `GetGenAIRun.response.200.steps.cacheReadTokens` (integer, required)
  - `GetGenAIRun.response.200.steps.cacheWriteTokens` (integer, required)
  - `GetGenAIRun.response.200.steps.contentBytes` (integer, required) — The span's content as sent, in bytes.
  - `GetGenAIRun.response.200.steps.durationMs` (number, required)
  - `GetGenAIRun.response.200.steps.errorType` (string | null, required)
  - `GetGenAIRun.response.200.steps.finishReasons` (array | null, required)
  - `GetGenAIRun.response.200.steps.inputTokens` (integer, required)
  - `GetGenAIRun.response.200.steps.model` (string | null, required)
  - `GetGenAIRun.response.200.steps.operation` (string, required)
  - `GetGenAIRun.response.200.steps.outputTokens` (integer, required)
  - `GetGenAIRun.response.200.steps.parentSpanId` (string | null, required)
  - `GetGenAIRun.response.200.steps.spanId` (string, required)
  - `GetGenAIRun.response.200.steps.startTime` (string, required) — UTC, millisecond precision: 2026-10-02T10:20:00.000Z.
    - format `date-time`
  - `GetGenAIRun.response.200.steps.status` (string, required)
    - one of `"ok"`, `"error"`
  - `GetGenAIRun.response.200.steps.toolCallId` (string | null, required) — gen_ai.tool.call.id: matches the tool call in the messages.
  - `GetGenAIRun.response.200.steps.toolName` (string | null, required)
  - `GetGenAIRun.response.200.steps.truncated` (boolean, required) — The content was cut at 1 MiB.

### 400

invalid_request (with issues), invalid_cursor, or the endpoint's own 400 codes.

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    }
  }
}
```

- `GetGenAIRun.response.400.error` (object, required)
  - `GetGenAIRun.response.400.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetGenAIRun.response.400.error.message` (string, required)
    - maxLength 1024
  - `GetGenAIRun.response.400.error.issues` (array<object>, optional) — invalid_request: one entry per problem, at a dotted path.
    - `GetGenAIRun.response.400.error.issues.message` (string, required)
    - `GetGenAIRun.response.400.error.issues.path` (string, required)
  - `GetGenAIRun.response.400.error.quota` (object, optional) — quota_exceeded: the quota that refused the request. Never with Retry-After.
    - `GetGenAIRun.response.400.error.quota.id` (string, required)
    - `GetGenAIRun.response.400.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetGenAIRun.response.400.error.quota.limit` (integer, required)
      - min 0
    - `GetGenAIRun.response.400.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetGenAIRun.response.400.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetGenAIRun.response.400.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.400.error.quota.region` (string, optional)
    - `GetGenAIRun.response.400.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.400.error.quota.scopeResourceName` (string, optional)
    - `GetGenAIRun.response.400.error.quota.used` (integer, optional)
      - min 0
    - `GetGenAIRun.response.400.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.

### 401

unauthenticated: no credential, or one that doesn't check out.

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    }
  }
}
```

- `GetGenAIRun.response.401.error` (object, required)
  - `GetGenAIRun.response.401.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetGenAIRun.response.401.error.message` (string, required)
    - maxLength 1024
  - `GetGenAIRun.response.401.error.issues` (array<object>, optional) — invalid_request: one entry per problem, at a dotted path.
    - `GetGenAIRun.response.401.error.issues.message` (string, required)
    - `GetGenAIRun.response.401.error.issues.path` (string, required)
  - `GetGenAIRun.response.401.error.quota` (object, optional) — quota_exceeded: the quota that refused the request. Never with Retry-After.
    - `GetGenAIRun.response.401.error.quota.id` (string, required)
    - `GetGenAIRun.response.401.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetGenAIRun.response.401.error.quota.limit` (integer, required)
      - min 0
    - `GetGenAIRun.response.401.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetGenAIRun.response.401.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetGenAIRun.response.401.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.401.error.quota.region` (string, optional)
    - `GetGenAIRun.response.401.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.401.error.quota.scopeResourceName` (string, optional)
    - `GetGenAIRun.response.401.error.quota.used` (integer, optional)
      - min 0
    - `GetGenAIRun.response.401.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.

### 403

access_denied: the caller's policies don't allow the action; forbidden_origin: a cookie-authenticated write from an origin that isn't allowed; spend_limit_reached.

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    }
  }
}
```

- `GetGenAIRun.response.403.error` (object, required)
  - `GetGenAIRun.response.403.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetGenAIRun.response.403.error.message` (string, required)
    - maxLength 1024
  - `GetGenAIRun.response.403.error.issues` (array<object>, optional) — invalid_request: one entry per problem, at a dotted path.
    - `GetGenAIRun.response.403.error.issues.message` (string, required)
    - `GetGenAIRun.response.403.error.issues.path` (string, required)
  - `GetGenAIRun.response.403.error.quota` (object, optional) — quota_exceeded: the quota that refused the request. Never with Retry-After.
    - `GetGenAIRun.response.403.error.quota.id` (string, required)
    - `GetGenAIRun.response.403.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetGenAIRun.response.403.error.quota.limit` (integer, required)
      - min 0
    - `GetGenAIRun.response.403.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetGenAIRun.response.403.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetGenAIRun.response.403.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.403.error.quota.region` (string, optional)
    - `GetGenAIRun.response.403.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.403.error.quota.scopeResourceName` (string, optional)
    - `GetGenAIRun.response.403.error.quota.used` (integer, optional)
      - min 0
    - `GetGenAIRun.response.403.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.

### 404

not_found: unknown, malformed, or in an organization the caller isn't in.

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    }
  }
}
```

- `GetGenAIRun.response.404.error` (object, required)
  - `GetGenAIRun.response.404.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetGenAIRun.response.404.error.message` (string, required)
    - maxLength 1024
  - `GetGenAIRun.response.404.error.issues` (array<object>, optional) — invalid_request: one entry per problem, at a dotted path.
    - `GetGenAIRun.response.404.error.issues.message` (string, required)
    - `GetGenAIRun.response.404.error.issues.path` (string, required)
  - `GetGenAIRun.response.404.error.quota` (object, optional) — quota_exceeded: the quota that refused the request. Never with Retry-After.
    - `GetGenAIRun.response.404.error.quota.id` (string, required)
    - `GetGenAIRun.response.404.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetGenAIRun.response.404.error.quota.limit` (integer, required)
      - min 0
    - `GetGenAIRun.response.404.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetGenAIRun.response.404.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetGenAIRun.response.404.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.404.error.quota.region` (string, optional)
    - `GetGenAIRun.response.404.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.404.error.quota.scopeResourceName` (string, optional)
    - `GetGenAIRun.response.404.error.quota.used` (integer, optional)
      - min 0
    - `GetGenAIRun.response.404.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.

### 429

too_many_requests, with Retry-After; or quota_exceeded (a rate, usage or concurrency quota, with quota), never with Retry-After.

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    }
  }
}
```

- `GetGenAIRun.response.429.error` (object, required)
  - `GetGenAIRun.response.429.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetGenAIRun.response.429.error.message` (string, required)
    - maxLength 1024
  - `GetGenAIRun.response.429.error.issues` (array<object>, optional) — invalid_request: one entry per problem, at a dotted path.
    - `GetGenAIRun.response.429.error.issues.message` (string, required)
    - `GetGenAIRun.response.429.error.issues.path` (string, required)
  - `GetGenAIRun.response.429.error.quota` (object, optional) — quota_exceeded: the quota that refused the request. Never with Retry-After.
    - `GetGenAIRun.response.429.error.quota.id` (string, required)
    - `GetGenAIRun.response.429.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetGenAIRun.response.429.error.quota.limit` (integer, required)
      - min 0
    - `GetGenAIRun.response.429.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetGenAIRun.response.429.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetGenAIRun.response.429.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.429.error.quota.region` (string, optional)
    - `GetGenAIRun.response.429.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.429.error.quota.scopeResourceName` (string, optional)
    - `GetGenAIRun.response.429.error.quota.used` (integer, optional)
      - min 0
    - `GetGenAIRun.response.429.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.

### 500

internal_error: a bug; the details are in the logs, under the request ID.

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    }
  }
}
```

- `GetGenAIRun.response.500.error` (object, required)
  - `GetGenAIRun.response.500.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetGenAIRun.response.500.error.message` (string, required)
    - maxLength 1024
  - `GetGenAIRun.response.500.error.issues` (array<object>, optional) — invalid_request: one entry per problem, at a dotted path.
    - `GetGenAIRun.response.500.error.issues.message` (string, required)
    - `GetGenAIRun.response.500.error.issues.path` (string, required)
  - `GetGenAIRun.response.500.error.quota` (object, optional) — quota_exceeded: the quota that refused the request. Never with Retry-After.
    - `GetGenAIRun.response.500.error.quota.id` (string, required)
    - `GetGenAIRun.response.500.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetGenAIRun.response.500.error.quota.limit` (integer, required)
      - min 0
    - `GetGenAIRun.response.500.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetGenAIRun.response.500.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetGenAIRun.response.500.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.500.error.quota.region` (string, optional)
    - `GetGenAIRun.response.500.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.500.error.quota.scopeResourceName` (string, optional)
    - `GetGenAIRun.response.500.error.quota.used` (integer, optional)
      - min 0
    - `GetGenAIRun.response.500.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.

### 503

unavailable: a dependency the request needs is down. Retry after Retry-After.

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    }
  }
}
```

- `GetGenAIRun.response.503.error` (object, required)
  - `GetGenAIRun.response.503.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetGenAIRun.response.503.error.message` (string, required)
    - maxLength 1024
  - `GetGenAIRun.response.503.error.issues` (array<object>, optional) — invalid_request: one entry per problem, at a dotted path.
    - `GetGenAIRun.response.503.error.issues.message` (string, required)
    - `GetGenAIRun.response.503.error.issues.path` (string, required)
  - `GetGenAIRun.response.503.error.quota` (object, optional) — quota_exceeded: the quota that refused the request. Never with Retry-After.
    - `GetGenAIRun.response.503.error.quota.id` (string, required)
    - `GetGenAIRun.response.503.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetGenAIRun.response.503.error.quota.limit` (integer, required)
      - min 0
    - `GetGenAIRun.response.503.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetGenAIRun.response.503.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetGenAIRun.response.503.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.503.error.quota.region` (string, optional)
    - `GetGenAIRun.response.503.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetGenAIRun.response.503.error.quota.scopeResourceName` (string, optional)
    - `GetGenAIRun.response.503.error.quota.used` (integer, optional)
      - min 0
    - `GetGenAIRun.response.503.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.


Source: https://docs.ezghcloud.com/obs-api/GetGenAIRun/index.md
