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

# Search spans

> Search and list spans matching a set of filters, returning a keyset-paginated page.

Filters in the request body include trace and span ids, names, statuses,
types, free-text search, metadata, duration bounds, and more, scoped to an
optional time window. Results are keyset-paginated on indexed columns rather
than offset-paginated, and ``total`` is not computed (it is always 0); use the
pagination cursors to page through results. Reads route to the legacy trace
store or the tracing service per account (with fallback to the legacy trace
store outside strict mode), and results are narrowed to traces the caller is authorized to
read — a filter that resolves to no authorized traces yields an empty page
rather than an error. A reversed time window (``from_ts`` after ``to_ts``) is
rejected with 422, as is a request whose combined ``trace_ids``, ``span_ids``,
``excluded_span_ids``, ``excluded_trace_ids``, and ``parent_ids`` count exceeds
10000. ``sort_by`` accepts ``start_timestamp``, ``duration_ms``,
``input_tokens`` and ``output_tokens``; the token counts are read from usage
reported at ingest, and a span whose producer reported none sorts as zero, so
it lands last descending and first ascending. The two token sorts are rejected
for an account still served by the legacy trace store, which keeps no token count
to order by. Any other unsupported sort falls back to timestamp order there.
Spans sharing a sort key are ordered by ``trace_id`` and ``id`` bytewise on both
tracing-service engines. Text search tokenization, indexed-prefix, word-length,
locale and metadata-bytes behavior differs between Postgres and ClickHouse
deployments of the tracing service as the ``search_texts`` field describes.

``x-project-id`` narrows the result to traces whose root span carries that project,
when ``PROJECT_SCOPED_SPAN_LISTING`` is on for the account, on either store.



## OpenAPI

````yaml /openapi/v5.yaml post /v5/spans/search
openapi: 3.1.0
info:
  title: EGP API V5
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
paths:
  /v5/spans/search:
    post:
      tags:
        - Spans
      summary: Search spans
      description: >-
        Search and list spans matching a set of filters, returning a
        keyset-paginated page.


        Filters in the request body include trace and span ids, names, statuses,

        types, free-text search, metadata, duration bounds, and more, scoped to
        an

        optional time window. Results are keyset-paginated on indexed columns
        rather

        than offset-paginated, and ``total`` is not computed (it is always 0);
        use the

        pagination cursors to page through results. Reads route to the legacy
        trace

        store or the tracing service per account (with fallback to the legacy
        trace

        store outside strict mode), and results are narrowed to traces the
        caller is authorized to

        read — a filter that resolves to no authorized traces yields an empty
        page

        rather than an error. A reversed time window (``from_ts`` after
        ``to_ts``) is

        rejected with 422, as is a request whose combined ``trace_ids``,
        ``span_ids``,

        ``excluded_span_ids``, ``excluded_trace_ids``, and ``parent_ids`` count
        exceeds

        10000. ``sort_by`` accepts ``start_timestamp``, ``duration_ms``,

        ``input_tokens`` and ``output_tokens``; the token counts are read from
        usage

        reported at ingest, and a span whose producer reported none sorts as
        zero, so

        it lands last descending and first ascending. The two token sorts are
        rejected

        for an account still served by the legacy trace store, which keeps no
        token count

        to order by. Any other unsupported sort falls back to timestamp order
        there.

        Spans sharing a sort key are ordered by ``trace_id`` and ``id`` bytewise
        on both

        tracing-service engines. Text search tokenization, indexed-prefix,
        word-length,

        locale and metadata-bytes behavior differs between Postgres and
        ClickHouse

        deployments of the tracing service as the ``search_texts`` field
        describes.


        ``x-project-id`` narrows the result to traces whose root span carries
        that project,

        when ``PROJECT_SCOPED_SPAN_LISTING`` is on for the account, on either
        store.
      operationId: POST-V5-/v5/spans/search
      parameters:
        - name: allow_partial_results
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Return however many spans fit the server byte budget instead of a
              400 SEARCH_RESULT_TOO_LARGE, reporting the rest through has_more
              plus next_cursor going forward or prev_cursor going back. A search
              that spends its time budget before the page fills also returns
              what it found, with search_status partial, searched_through and a
              next_cursor that resumes from there. Send it only if the client
              reads has_more, because under it a page shorter than limit no
              longer means the end of the list. Honored by the tracing service
              on either of its storage engines. Accounts still served by the
              legacy trace store ignore it and page by item count, where a short
              page still means the end of the list.
            default: false
            title: Allow Partial Results
          description: >-
            Return however many spans fit the server byte budget instead of a
            400 SEARCH_RESULT_TOO_LARGE, reporting the rest through has_more
            plus next_cursor going forward or prev_cursor going back. A search
            that spends its time budget before the page fills also returns what
            it found, with search_status partial, searched_through and a
            next_cursor that resumes from there. Send it only if the client
            reads has_more, because under it a page shorter than limit no longer
            means the end of the list. Honored by the tracing service on either
            of its storage engines. Accounts still served by the legacy trace
            store ignore it and page by item count, where a short page still
            means the end of the list.
        - name: starting_after
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Starting After
        - name: ending_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Ending Before
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 10000
            minimum: 1
            default: 100
            title: Limit
        - name: sort_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Sort By
        - name: sort_order
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/SortOrder'
              - type: 'null'
            default: asc
            title: Sort Order
        - name: from_ts
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: The starting (oldest) timestamp in ISO format.
            title: From Ts
          description: The starting (oldest) timestamp in ISO format.
        - name: to_ts
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: The ending (most recent) timestamp in ISO format.
            title: To Ts
          description: The ending (most recent) timestamp in ISO format.
        - name: x-selected-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account ID Header
        - name: x-project-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Project ID Header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TracesSearchRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpanSearchPage'
        '400':
          description: >-
            The request carried a value this API or the tracing service
            rejected, such as a search term breaking a documented rule or a
            malformed pagination cursor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpanReadErrorResponse'
        '422':
          description: >-
            A malformed request returns the validation error shape, one entry
            per offending field. A request this API refuses returns only detail,
            as when x-project-id is sent for an account whose tracing backend
            cannot apply the project scope.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/HTTPValidationError'
                  - $ref: '#/components/schemas/SpanReadErrorResponse'
        '503':
          description: >-
            The configured tracing read backend is unavailable. Known service
            configuration failures include a stable error_code; other failures
            return only detail.
          headers:
            x-correlation-id:
              description: Correlation ID for this request.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpanReadErrorResponse'
      security:
        - APIKeyHeader: []
components:
  schemas:
    SortOrder:
      type: string
      enum:
        - asc
        - desc
      title: SortOrder
    TracesSearchRequest:
      properties:
        parents_only:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Parents Only
          description: Only fetch spans that are the top-level (ie. have no parent_id)
        span_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Span Ids
          description: Filter by span IDs
        trace_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Trace Ids
          description: >-
            Filter by trace IDs. The combined count of trace_ids, span_ids,
            excluded_span_ids, excluded_trace_ids, parent_ids, and (trace_id,
            span_id) pairs (each pair counting 2) may not exceed 10000. A
            request over that returns 422.
        excluded_span_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Excluded Span Ids
          description: List of span IDs to exclude from results
        excluded_trace_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Excluded Trace Ids
          description: List of trace IDs to exclude from results
        spans:
          anyOf:
            - items:
                $ref: '#/components/schemas/SpanRef'
              type: array
            - type: 'null'
          title: Spans
          description: >-
            Filter by exact (trace_id, span_id) identity. Unlike span_ids, a
            pair never matches a same-id span from another trace. ANDs with
            span_ids when both are set.
        excluded_spans:
          anyOf:
            - items:
                $ref: '#/components/schemas/SpanRef'
              type: array
            - type: 'null'
          title: Excluded Spans
          description: >-
            List of (trace_id, span_id) identities to exclude from results.
            Unlike excluded_span_ids, a pair never excludes a same-id span from
            another trace. Takes precedence over excluded_span_ids when both are
            set.
        group_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Group Id
          description: Filter by group ID
        parent_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Parent Ids
          description: Filter to the direct children of any of these parent span IDs
        names:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Names
          description: Filter by trace/span name
        statuses:
          anyOf:
            - items:
                $ref: '#/components/schemas/ApplicationOperationStatus'
              type: array
            - type: 'null'
          title: Statuses
          description: Filter on span status
        types:
          anyOf:
            - items:
                $ref: '#/components/schemas/ApplicationOperationType'
              type: array
            - type: 'null'
          title: Types
        search_texts:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Search Texts
          description: >-
            Case-insensitive text search across span name, input, output, and
            metadata. A single-word term of ASCII letters and digits matches as
            a whole word in input, output, and metadata, and as a substring of
            the name. A term of up to 8 such words matches as a contiguous
            phrase whose words each appear as whole words. All other terms
            (punctuated, non-ASCII, longer) match as substrings, where mid-word
            fragments match and an inflected form such as a plural matches only
            where it appears literally. Wrapping a term in double quotes makes
            it a phrase: the quotes mark the phrase and are never matched, a
            backslash escapes a quote or a backslash inside them, the phrase
            must appear contiguously inside one searched value (the input, the
            output, or the metadata), a phrase of up to 8 ASCII letter-and-digit
            words additionally requires each of those words to appear there as a
            whole word, and a UUID-shaped phrase stays a text search. A term
            whose quote is unterminated or left unescaped mid-term is matched
            literally, quotes included. Multiple terms are ANDed, and
            UUID-shaped terms match trace IDs instead. A span must match every
            non-UUID term, and each term may match any of the searched fields.
            UUID matches are ORed onto the text match. Each term must be at
            least 2 characters, measured between the quotes and ignoring outer
            whitespace for a phrase, and at most 10 terms are supported. For
            exact trace ID lookup, use the `trace_ids` filter. The tracing
            service runs on either ClickHouse or Postgres, and the two engines
            match differently. On Postgres deployments the whole-word match uses
            the simple text-search parser, which keeps hosts, e-mail addresses,
            file paths, version strings, hyphenated compounds, URLs and query
            strings as single words (https://x.com/path?q=1 yields
            x.com/path?q=1, x.com and /path?q=1, never path, q or 1;
            user@example.com and v1.2.3 are one word each; gpt-4o yields the
            compound and its parts), whereas ClickHouse deployments split on
            every non-alphanumeric ASCII byte. A single word inside such a value
            is a whole-word hit on ClickHouse and a miss on Postgres; the
            substring forms behave identically on both. On Postgres deployments
            a value over 80000 bytes has only its first 20000 characters indexed
            for whole-word matching; text past that is reachable only by the
            substring forms. Words longer than 2047 bytes are matched as
            substrings, never as whole words. Case folding of non-ASCII text
            follows the database's LC_CTYPE on Postgres deployments, for the
            whole-word index, the quoted-phrase and substring forms and the
            word-boundary check alike; under a C-locale database non-ASCII
            letters are not folded. ASCII folds everywhere. Input and output
            behave identically on both engines. A substring-form term, or a
            text-filtered metrics request, reads every row of the time window
            that survives the other filters. A term that matches too many rows
            in the window is refused by the tracing service as QUERY_TOO_BROAD,
            at an engine-specific threshold, and on Postgres deployments a read
            whose sorts or hashes, the text candidate sets included, outgrow the
            deployment's work memory and its temp-file bound is refused as
            QUERY_TEMP_FILE_LIMIT_EXCEEDED, a code ClickHouse deployments never
            return and one a read without text can also earn. This API relays
            either refusal as a 400 carrying the tracing service's detail, never
            as a page from the legacy trace store, and an export's refusal is
            reported as the failed export's reason on the export status, not on
            the POST. On Postgres deployments each term is counted on its own,
            in every class (whole word, phrase and substring alike) and on every
            read that carries text, and is refused when it alone matches more
            than 50000 rows of the window that survive the other filters, with
            or without assessment_types. On ClickHouse deployments the refusal
            is the candidate-set cap, a deployment-configured limit counted over
            the matches of all terms together: a search page bounds its
            candidates to the page, so there the cap is a backstop rather than a
            limit a common term meets; metrics and by-span resolve every match
            and can trip it; and an export runs under its own 2000000-row set
            cap on every request, assessment_types included. Accounts still
            served by the legacy trace store match differently until migrated:
            every term matches as stemmed whole words (so inflected forms match
            and multi-word terms match word-adjacent), only input and output are
            searched, the 2-character minimum is not enforced, quoting a term
            changes nothing (the quotes are stripped and a multi-word term is
            already matched word-adjacent), and characters like `:`, `|`, or `!`
            inside a term may be interpreted as query operators or cause an
            error.
        extra_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extra Metadata
          description: >-
            Filter on custom metadata: each key must equal its value, or any
            value of an array, and keys are ANDed. On the ClickHouse read path
            `$or` and `$and` also compose nested groups of predicates. On
            Postgres a `$`-prefixed key is an ordinary metadata key matched
            literally. Array values match element-wise; a negative zero inside
            an array equals zero on Postgres-served accounts and not on
            ClickHouse-served ones.
        application_variant_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Application Variant Ids
          description: Filter by application variant IDs
        assessment_types:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Assessment Types
          description: Filter to spans that have at least one assessment of these types
        acp_types:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Acp Types
          description: Filter by ACP types
        agentex_agent_names:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Agentex Agent Names
          description: Filter by Agentex agent names
        agentex_agent_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Agentex Agent Ids
          description: Filter by Agentex agent IDs
        obs_trace_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Obs Trace Ids
          description: >-
            Filter to the business spans that executed in any of these
            observability traces (the obs-to-business reverse lookup). Each id
            must be 32 lowercase hex characters. Served only by the sgp-traces
            service, so a request using this filter against an account still on
            the legacy store returns 422 rather than silently ignoring it.
        obs_span_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Obs Span Ids
          description: >-
            Filter to the business spans that executed in any of these
            observability spans. Each id must be 16 lowercase hex characters. A
            W3C span id is unique per trace only, so combine with obs_trace_ids
            for exact identity, the same looseness span_ids carries versus the
            spans pair filter. ANDs with obs_trace_ids when both are set. Served
            only by the sgp-traces service, so a request using this filter
            against an account still on the legacy store returns 422 rather than
            silently ignoring it.
        min_duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Duration Ms
          description: >-
            Minimum span duration in milliseconds (inclusive). Matched on
            completed duration, so a span with no end time is not reliably
            returned: fetch it by its own id or in its trace's span list.
        max_duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Duration Ms
          description: >-
            Maximum span duration in milliseconds (inclusive). Matched on
            completed duration, so a span with no end time is never returned:
            fetch it by its own id or in its trace's span list.
      type: object
      title: TracesSearchRequest
    SpanSearchPage:
      properties:
        object:
          type: string
          const: list
          title: Object
          default: list
        items:
          items:
            $ref: '#/components/schemas/Span'
          type: array
          title: Items
        limit:
          type: integer
          title: Limit
          description: The maximum number of items to return.
          default: 100
        total:
          type: integer
          title: Total
          description: >-
            Not computed for span search and always 0: results are
            keyset-paginated, so page with has_more and the cursors instead.
        has_more:
          type: boolean
          title: Has More
          description: >-
            Whether more items remain in the direction of travel. Under
            allow_partial_results this is the only end-of-list signal, since the
            byte or time budget can serve a page shorter than limit with rows
            still left.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Pass as starting_after to fetch the next page. None when there is no
            next page.
        prev_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Prev Cursor
          description: >-
            Pass as ending_before to fetch the previous page. None when on the
            first page.
        window_truncated:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Window Truncated
          description: >-
            True when the requested window exceeded the 90 day maximum and was
            clamped, so results cover only effective_from_ts..effective_to_ts.
            null when no clamp occurred.
        effective_from_ts:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Effective From Ts
          description: Resolved start of the searched window. null when no clamp occurred.
        effective_to_ts:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Effective To Ts
          description: Resolved end of the searched window. null when no clamp occurred.
        search_status:
          anyOf:
            - type: string
              enum:
                - complete
                - partial
            - type: 'null'
          title: Search Status
          description: >-
            complete when the page holds every match from the request's position
            to its last item or the end of the window. partial when an
            allow_partial_results search spent its time budget first: the page
            holds every match up to searched_through, and next_cursor resumes
            from there. null on accounts still served by the legacy trace store.
        searched_through:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Searched Through
          description: >-
            On a partial page, the start_timestamp the search covered up to in
            its scan order, oldest first for a descending sort. null on a
            complete page.
      type: object
      required:
        - items
        - total
        - has_more
      description: >-
        Span search page carrying sgp-traces' opaque pagination cursors.


        Accounts still served by the legacy trace store keyset-paginate on the
        span

        id and leave these unset, except that a page the legacy store serves as
        a

        fallback for a tracing-service account, or in continuation of a fallback

        cursor, carries cursors this API mints so later pages stay on the legacy

        store. The tracing service, on either of its storage engines, returns
        opaque

        cursors that clients must round-trip.
    SpanReadErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: A user-safe explanation of why the tracing read failed.
        error_code:
          anyOf:
            - type: string
              const: TRACES_SERVICE_CONFIGURATION_ERROR
            - type: 'null'
          title: Error Code
          description: >-
            Stable classification for a known EGP-to-tracing-service
            configuration failure. Omitted when the downstream failure is not
            safely classifiable.
      type: object
      required:
        - detail
      title: SpanReadErrorResponse
      description: Safe public error body for a tracing read that could not be completed.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SpanRef:
      properties:
        trace_id:
          type: string
          title: Trace Id
          description: Trace ID of the referenced span
        span_id:
          type: string
          title: Span Id
          description: Span ID of the referenced span
      type: object
      required:
        - trace_id
        - span_id
      title: SpanRef
      description: >-
        One span addressed by its full identity, since span ids are only unique
        within a trace.
    ApplicationOperationStatus:
      type: string
      enum:
        - SUCCESS
        - ERROR
        - CANCELED
      title: ApplicationOperationStatus
    ApplicationOperationType:
      type: string
      enum:
        - TEXT_INPUT
        - TEXT_OUTPUT
        - COMPLETION_INPUT
        - COMPLETION
        - KB_RETRIEVAL
        - KB_INPUT
        - RERANKING
        - EXTERNAL_ENDPOINT
        - PROMPT_ENGINEERING
        - DOCUMENT_INPUT
        - MAP_REDUCE
        - DOCUMENT_SEARCH
        - DOCUMENT_PROMPT
        - CUSTOM
        - CODE_EXECUTION
        - DATA_MANIPULATION
        - EVALUATION
        - FILE_RETRIEVAL
        - KB_ADD_CHUNK
        - KB_MANAGEMENT
        - GUARDRAIL
        - OUTPUT_GUARDRAIL
        - TRACER
        - AGENT_TRACER
        - AGENT_WORKFLOW
        - STANDALONE
      title: ApplicationOperationType
    Span:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: span
          title: Object
          default: span
        created_by:
          anyOf:
            - $ref: '#/components/schemas/Identity'
            - type: 'null'
          description: The identity that created the entity.
        name:
          type: string
          title: Name
        trace_id:
          type: string
          maxLength: 256
          title: Trace Id
          description: id for grouping traces together, uuid is recommended
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Id
          description: Reference to a parent span_id
        group_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Group Id
          description: Reference to a group_id
        start_timestamp:
          type: string
          format: date-time
          title: Start Timestamp
        end_timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End Timestamp
        input:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input
        output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Output
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        expected:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Expected
        status:
          anyOf:
            - $ref: '#/components/schemas/ApplicationOperationStatus'
            - type: 'null'
          default: SUCCESS
        type:
          anyOf:
            - $ref: '#/components/schemas/ApplicationOperationType'
            - type: 'null'
          default: STANDALONE
        application_interaction_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Application Interaction Id
          description: The interaction ID this span belongs to
        application_variant_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Application Variant Id
          description: The id of the application variant this span belongs to
        obs_trace_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Obs Trace Id
          description: >-
            W3C trace id of the observability trace this span executed in. Null
            for spans written without the edge, and for accounts still served by
            the legacy trace store.
        obs_span_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Obs Span Id
          description: W3C span id of the observability span this span executed in.
        input_tokens:
          anyOf:
            - type: integer
              maximum: 4294967295
              minimum: 0
            - type: 'null'
          title: Input Tokens
          description: >-
            Prompt tokens the producer reported for this span, absent when it
            reported none. Same quantity the input_tokens sort orders by.
        output_tokens:
          anyOf:
            - type: integer
              maximum: 4294967295
              minimum: 0
            - type: 'null'
          title: Output Tokens
          description: >-
            Completion tokens the producer reported for this span, absent when
            it reported none. Same quantity the output_tokens sort orders by.
        account_id:
          type: string
          title: Account Id
      type: object
      required:
        - id
        - name
        - trace_id
        - start_timestamp
        - account_id
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    Identity:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: identity
          title: Object
          default: identity
        type:
          $ref: '#/components/schemas/IdentityType'
      type: object
      required:
        - id
        - type
      title: Identity
    IdentityType:
      type: string
      enum:
        - user
        - service_account
      title: IdentityType
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````