---
title: "Genai Custom Attrs Schema"
method: POST
path: "/agents/spans/custom-attrs/schema"
tags: ["Agents"]
---

# Genai Custom Attrs Schema

`POST /agents/spans/custom-attrs/schema`

Discover typed custom attribute keys on matching agent spans.

## Request body

- AgentCustomAttrsSchemaReq — Request to discover typed custom attribute keys for matching spans.
  - `project_id` string, required
  - `query` Query
    - `$expr` union, required
      - AndOperation — Logical AND. All conditions must evaluate to true. Example:
        - `$and` union[], required
          - union
            - unknown
            - unknown
            - unknown
            - AndOperation — recursive
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
            - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
      - unknown
  - `started_after` string, date-time, nullable
  - `started_before` string, date-time, nullable
  - `limit` integer
  - `offset` integer

## Response `200`

Successful Response

- AgentCustomAttrsSchemaRes — Typed custom attribute keys available for spans query/group/stats APIs.
  - `attributes` AgentCustomAttrSchemaItem[]
    - `source` 'custom_attrs_string' | 'custom_attrs_int' | 'custom_attrs_float' | 'custom_attrs_bool', required
    - `key` string, required
    - `value_type` 'string' | 'int' | 'float' | 'bool', required
    - `span_count` integer, required
  - `limit` integer
  - `offset` integer
  - `has_more` boolean

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/wandb/apis/serverless-training.md) · [All operations](https://skmtc.net/wandb/apis/serverless-training/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wandb/serverless-training/revisions/8d8d96fc0fd3/schema)
