> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List LLM calls

> `fromDate` and `toDate` are required. `fromDate` is included in the results and
`toDate` is not, so a full day is
`fromDate=2026-08-04T00:00:00Z&toDate=2026-08-05T00:00:00Z`.

All other filters are optional and match exactly. Filters combine with AND, so
adding more narrows the results.

`source` and `sourceSubtype` also accept older spellings and translate them for
you — see those parameters for the details.


Use this endpoint to retrieve the LLM call ledger for a project. The response contains one record for each individual LLM call, including details such as the model, provider, token usage, latency, and cost. The endpoint does not aggregate calls by conversation turn.

Use the `dataMode` parameter to control the level of detail returned. The default mode returns call-level facts, while `full` additionally includes the exact prompt and response payloads when available.

The available filtering criteria are:

* Date range — required: `fromDate` and `toDate`. `fromDate` is inclusive, while `toDate` is exclusive.
* Source: Filter by the source of the LLM call.
* Source subtype: Further filter calls by source subtype.
* Model: Filter calls by the LLM model.
* Provider: Filter calls by the model provider.
* Other query parameters: The endpoint also supports pagination and sorting, but these control how results are returned rather than which records are included.


## OpenAPI

````yaml agent-platform/api-specs/llm-ledger.yaml get /api/public/analytics/projects/{projectId}/llm-ledger
openapi: 3.1.0
info:
  title: ABL Public Analytics LLM Ledger API
  version: 1.0.0
  summary: Retrieve a project-scoped ledger of individual LLM calls.
  description: >
    Returns one row for every individual LLM call made in a project, with its
    model,

    provider, token counts, latency, and cost. Calls are listed individually —
    nothing

    is rolled up per conversation turn.


    Use `dataMode` to control detail. `summary` returns the facts about each
    call.

    `full` adds the exact prompt sent and response received under each call's
    `payload`,

    so you do not need a second request to retrieve them.


    Authenticate with the `x-api-key` header. The key must be bound to the
    project you

    are querying and have `analytics:read` permission.


    ## Sending parameters in a POST body


    Every GET on this API has a POST form on the same path. Send the same
    parameters

    as a flat JSON object instead of a query string. Use POST when the
    parameters

    themselves must be encrypted: a GET query string is never encrypted. GET
    stays

    available and unchanged.


    - Body keys are exactly the GET query parameter names. Numbers and booleans
    are
      converted to the strings the GET parser expects. List parameters accept a
      JSON array or a comma-separated string.
    - An unknown key, a `null`, or a nested value is rejected with
      `400 INVALID_QUERY_PARAMETER`. A body that is not a JSON object is rejected
      with `400 INVALID_REQUEST_BODY`.
    - Do not add a query string to a POST (`400 INVALID_QUERY_PARAMETER`), and
    do
      not split parameters between the query string and the body.
    - `Content-Type` must be `application/json` or `application/jose+json`,
      otherwise `415 UNSUPPORTED_MEDIA_TYPE`.
    - Permissions, validation, pagination and the response shape are identical
    to
      the GET form.

    ## Payload encryption


    Payload encryption is an opt-in setting on a Platform Key, configured in
    Studio

    under Settings → API Keys → Platform Keys. It has two independent toggles.

    Neither changes what the key may access, and both are available only to keys

    bound to exactly one project.


    **Request encryption** applies to POST bodies (a GET has no body). The body
    must

    be a JWE (RFC 7516) in flattened JSON serialization, `{protected, iv,

    ciphertext, tag}`, whose protected header is
    `{"alg":"dir","enc":"A256GCM"}`,

    optionally with `kid`, `typ` and `cty`. The key is the 32-byte AES-256
    request

    key Studio shows when request encryption is enabled. `kid` is optional; if
    sent

    it must equal the key's Key ID shown in Studio.


    **Response encryption** applies to every response sent after the key is

    authenticated, successes and errors alike (400, 403, 404, 413, 415, 429,
    500,

    503). The body is a flattened JWE `{protected, encrypted_key, iv,
    ciphertext,

    tag}` with protected header

    `{"alg":"RSA-OAEP-256","enc":"A256GCM","kid":"<Key
    ID>","pkf":"<fingerprint>"}`,

    sealed with a fresh AES-256 key per response that is wrapped with the RSA
    public

    key (≥ 2048 bits) configured on the Platform Key. `pkf` is the SHA-256 hex

    digest of that public key's SubjectPublicKeyInfo DER. The response keeps

    `Content-Type: application/json` and adds `X-ABL-Encrypted: true`.
    Decrypting

    it yields exactly the JSON documented in this spec. A `401` is never
    encrypted

    (the key is not known yet), and a `304` has no body.


    | Key setting | Plain JSON body | JWE body |

    |---|---|---|

    | Request encryption off | accepted | `400 ENCRYPTED_PAYLOAD_INVALID` |

    | Request encryption on | `400 ENCRYPTED_PAYLOAD_INVALID` | decrypted, then
    handled as plain JSON |


    Encryption fails closed: a configured key never receives plaintext by
    accident.


    - `400 ENCRYPTED_PAYLOAD_INVALID` is returned for every envelope problem:
    any
      other `alg`/`enc`, `zip` or `crit`, unknown header parameters, `unprotected`,
      `header`, `aad` or `recipients` members, a `kid` that is not this key's,
      padded or standard base64, a wrong IV (12 bytes) or tag (16 bytes) length, a
      failed authentication tag, or a plaintext that is not JSON.
    - `503 ENCRYPTION_CONFIG_UNAVAILABLE` (with `Retry-After: 30`) means the
    key's
      encryption configuration could not be read. Retry later; there is no
      plaintext fallback.
    - `500 INTERNAL_ERROR` with a content-free body is returned if a response
    cannot
      be encrypted.

    All JWE members are unpadded base64url. The AAD is the ASCII of the
    `protected`

    member, as in standard JWE, so JOSE libraries (for example `jose` for
    Node.js)

    can produce and open these envelopes directly. Pin the algorithms when

    decrypting: key management `RSA-OAEP-256`, content encryption `A256GCM`.
  x-source-release: develop
  x-source-commit: b6a1a328b3e089e03ca2494a7091d72a6a481d4b
  x-payload-encryption:
    jira: ABLP-5317
    source: develop, PR
    source-commit: 6de86f59eb
    runtime-capability: 'GET /health -> capabilities.payloadEncryption: 2'
servers:
  - url: https://{host}
    variables:
      host:
        default: runtime.example.com
security:
  - ApiKeyAuth: []
tags:
  - name: LLM Ledger
paths:
  /api/public/analytics/projects/{projectId}/llm-ledger:
    get:
      tags:
        - LLM Ledger
      summary: List LLM calls
      description: >
        `fromDate` and `toDate` are required. `fromDate` is included in the
        results and

        `toDate` is not, so a full day is

        `fromDate=2026-08-04T00:00:00Z&toDate=2026-08-05T00:00:00Z`.


        All other filters are optional and match exactly. Filters combine with
        AND, so

        adding more narrows the results.


        `source` and `sourceSubtype` also accept older spellings and translate
        them for

        you — see those parameters for the details.
      operationId: listPublicLlmLedger
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - name: fromDate
          in: query
          required: true
          schema:
            type: string
            format: date-time
        - name: toDate
          in: query
          required: true
          schema:
            type: string
            format: date-time
        - name: limit
          in: query
          description: >
            How many calls to return. When `dataMode=full`, a page may come back
            with

            fewer rows than requested so the response stays within the 1 MiB
            size limit

            — check `hasMore` rather than assuming a short page is the last one.
          schema:
            type: integer
            minimum: 1
            maximum: 10000
            default: 100
        - name: offset
          in: query
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: sessionIds
          in: query
          description: >
            Filter to specific sessions. Pass up to 10,000 session IDs,
            comma-separated

            or by repeating the parameter.
          style: form
          explode: false
          schema:
            type: array
            maxItems: 10000
            uniqueItems: true
            items:
              type: string
              minLength: 1
        - name: channel
          in: query
          description: >
            Filter by the channel the conversation took place on. Design-time
            calls,

            such as Studio test calls, are not tied to a channel and will not
            match any

            channel filter.


            Matched exactly as stored, with no alias handling. Unlike the
            sessions

            endpoint, shorthand such as `web` or `sms` is not expanded here —
            use the

            exact channel name such as `web_chat` or `twilio_sms`.


            Not restricted to a fixed list, so an unrecognised value returns no
            results

            rather than an error. Cannot be empty (`400 INVALID_FILTER`).
          schema:
            type: string
            enum:
              - http_async
              - slack
              - line
              - msteams
              - whatsapp
              - messenger
              - instagram
              - twilio_sms
              - zendesk
              - telegram
              - genesys
              - genesys_open_messaging
              - ai4w
              - kore_agent_assist
              - email
              - voice_vxml
              - korevg
              - audiocodes
              - genesys_audio_connector
              - voice_pipeline
              - voice_realtime
              - voice
              - voice_twilio
              - voice_livekit
              - ag_ui
              - a2a
              - sdk_websocket
              - web_debug
              - web_chat
              - api
              - http
        - name: source
          in: query
          description: >
            Filter by which part of the platform made the call — for example
            `runtime`

            for live agent traffic, or `evals` for evaluation runs.


            You can pass either the current name or an older one; the older
            spellings

            listed under `x-alias-groups` are translated for you, and matching
            is

            case-insensitive with `-` and spaces treated as `_`. So
            `agent_session`

            finds the same calls as `runtime`.


            Not restricted to a fixed list, so an unrecognised value returns no
            results

            rather than an error. Cannot be empty (`400 INVALID_FILTER`).
          schema:
            type: string
            enum:
              - runtime
              - runtime_internal
              - arch
              - evals
              - pipelines
              - guardrails
              - knowledge
              - studio_test_calls
              - channels
              - agent_session
              - eval
              - analytics_pipeline
              - analytics_query
              - guardrail
              - search_ai
              - prompt_library
              - model_health
              - model_admin
              - health:credential-store
              - sdk_widget_localization
          x-alias-groups:
            runtime:
              - runtime
              - agent_session
            runtime_internal:
              - runtime_internal
            arch:
              - arch
            evals:
              - evals
              - eval
            pipelines:
              - pipelines
              - analytics_pipeline
            guardrails:
              - guardrails
              - guardrail
            knowledge:
              - knowledge
              - search_ai
              - analytics_query
            studio_test_calls:
              - studio_test_calls
              - prompt_library
              - model_health
              - model_admin
              - health:credential-store
            channels:
              - channels
              - sdk_widget_localization
        - name: sourceSubtype
          in: query
          description: >
            Filter by the specific purpose of the call within its source — for
            example

            `response_generation` for replies to users, or `guardrails` for
            safety

            checks.


            Older spellings are translated for you, as listed under
            `x-alias-groups`. If

            you also pass `source`, translation is limited to that source's
            subtypes; on

            its own, subtype names are resolved across all sources.


            Not restricted to a fixed list, so an unrecognised value returns no
            results

            rather than an error. Cannot be empty (`400 INVALID_FILTER`).
          schema:
            type: string
            enum:
              - response_generation
              - conversation_history_compaction
              - ner_gather_llm_extraction
              - model_based_pii_entity_recognizer
              - model_entity_preview
              - llm_backed_validation
              - searchai_kb_query_intelligence
              - searchai_query_assistance
              - routing_pipeline
              - pipeline_classifier
              - pipeline_tool_filter
              - pipeline_merge
              - contextual_filler_generation
              - tool_result_summarization
              - sip_handoff_summary
              - semantic_execution
              - legacy_nlu_fallback
              - general_assistance
              - project_assistance
              - eval_remediation
              - evaluation_suite_generation
              - natural_language_analytics_query
              - text_to_sql
              - guardrails
              - studio_test_calls
              - widget_copy_translation
              - tool_use_iteration
              - response_gen
              - realtime_response
              - conversation_compaction
              - nlu_entity_extraction
              - kb_classify_rewrite
              - field_validation
              - agent_building
              - eval_suite_creation
              - eval_design_time_asset_generation
              - nl_to_sql
              - nl_query
              - query_intelligence
              - prompt_test
              - prompt_experiment
              - credential_health_check
              - translation_generation
          x-alias-groups:
            response_generation:
              - tool_use_iteration
              - response_gen
              - realtime_response
            conversation_history_compaction:
              - conversation_compaction
            ner_gather_llm_extraction:
              - nlu_entity_extraction
            searchai_kb_query_intelligence:
              - kb_classify_rewrite
            llm_backed_validation:
              - field_validation
            general_assistance:
              - agent_building
            evaluation_suite_generation:
              - eval_suite_creation
              - eval_design_time_asset_generation
            natural_language_analytics_query:
              - nl_to_sql
              - nl_query
            text_to_sql:
              - nl_to_sql
            searchai_query_assistance:
              - query_intelligence
            studio_test_calls:
              - prompt_test
              - prompt_experiment
              - credential_health_check
            widget_copy_translation:
              - translation_generation
        - name: status
          in: query
          description: >
            Filter to successful or failed calls. Any other value is rejected
            with `400

            INVALID_STATUS`.
          schema:
            type: string
            enum:
              - success
              - failed
        - name: model
          in: query
          description: >
            Filter by model, using the exact model id as recorded, such as
            `gpt-4o`.

            There is no fixed list, because each tenant can register its own
            models.

            Calls recorded without a model id appear as `unknown` and can be
            found with

            `model=unknown`. Cannot be empty (`400 INVALID_FILTER`).
          schema:
            type: string
            minLength: 1
        - name: provider
          in: query
          description: >
            Filter by model provider, such as `openai` or `azure`. Calls
            recorded

            without a provider appear as `unknown` and can be found with

            `provider=unknown`.


            Not restricted to a fixed list, so an unrecognised value returns no
            results

            rather than an error. The values below are the providers the
            platform can

            call. Cannot be empty (`400 INVALID_FILTER`).
          schema:
            type: string
            minLength: 1
            x-common-values:
              - openai
              - anthropic
              - azure
              - bedrock
              - microsoft_foundry
              - google
              - gemini
              - vertex
              - vertex_ai
              - google_vertex
              - cohere
              - groq
              - mistral
              - fireworks
              - togetherai
              - together
              - perplexity
              - deepseek
              - xai
              - openrouter
              - litellm
              - openai_compatible
              - ultravox
              - custom
              - mock
              - unknown
        - name: environment
          in: query
          description: >
            Filter by environment. Note that this endpoint stores `development`
            rather

            than `dev` — unlike the sessions endpoint, which uses `dev`.
            Design-time

            calls, such as Studio test calls, are not tied to an environment and
            will

            not match this filter.


            Matched exactly as stored. Not restricted to a fixed list, so an

            unrecognised value returns no results rather than an error. Cannot
            be empty

            (`400 INVALID_FILTER`).
          schema:
            type: string
            enum:
              - development
              - staging
              - production
              - working-copy
        - name: name
          in: query
          description: Exact effective agent name, operation type, or provider fallback.
          schema:
            type: string
            minLength: 1
        - name: channelType
          in: query
          description: Exact transport-specific channel type.
          schema:
            type: string
            enum:
              - http_async
              - slack
              - line
              - msteams
              - whatsapp
              - messenger
              - instagram
              - twilio_sms
              - zendesk
              - telegram
              - genesys
              - genesys_open_messaging
              - ai4w
              - kore_agent_assist
              - email
              - voice_vxml
              - korevg
              - audiocodes
              - genesys_audio_connector
              - voice_pipeline
              - voice_realtime
              - voice
              - voice_twilio
              - voice_livekit
              - ag_ui
              - a2a
              - sdk_websocket
              - web_debug
              - web_chat
              - api
              - http
        - name: attributionName
          in: query
          description: >-
            Display name of the credential, auth profile or other source the
            call is attributed to. Matched case-insensitively against the name
            after trimming. When the name matches more than one source, all of
            them are included and the response carries `attributionMatch`.
          schema:
            type: string
            minLength: 1
        - name: attributionType
          in: query
          description: >-
            Exact attribution type recorded on the call, for example
            `credential` or `auth_profile`.
          schema:
            type: string
            minLength: 1
        - name: attributionId
          in: query
          description: >-
            Exact attribution ID recorded on the call. Combine with
            `attributionType` to select one credential or auth profile.
          schema:
            type: string
            minLength: 1
        - name: attributionScope
          in: query
          description: Exact attribution scope recorded on the call.
          schema:
            type: string
            minLength: 1
        - name: dataMode
          in: query
          description: >
            How much detail to return per call. `summary` returns the facts
            about each

            call. `full` also includes the prompt sent and the response
            received, under

            `payload`, where these were stored.
          schema:
            type: string
            enum:
              - summary
              - full
            default: summary
        - name: sortBy
          in: query
          schema:
            type: string
            enum:
              - timestamp
              - latencyMs
              - cost
              - totalTokens
            default: timestamp
        - name: sortOrder
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
      responses:
        '200':
          description: LLM ledger page returned successfully.
          headers:
            Cache-Control:
              schema:
                type: string
              example: private, no-store, max-age=0
            X-ABL-Encrypted:
              $ref: '#/components/headers/XAblEncrypted'
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/LlmLedgerResponse'
                  - $ref: '#/components/schemas/EncryptedResponse'
              examples:
                summary:
                  summary: Summary mode
                  value:
                    success: true
                    statusCode: 200
                    total: 1
                    limit: 100
                    offset: 0
                    dataMode: summary
                    hasMore: false
                    generations:
                      - id: >-
                          sess-1:call-1:2026-08-04T09:59:36.316Z:GPT-5.2:azure:1396:780:11659:0
                        model: GPT-5.2
                        agentName: Support Agent
                        provider: azure
                        environment: production
                        status: success
                        inputTokens: 1396
                        cachedTokens: 224
                        completionTokens: 500
                        reasoningTokens: 280
                        outputTokens: 780
                        totalTokens: 2176
                        latencyMs: 11659
                        timeToFirstTokenMs: 0
                        streamingUsed: false
                        cost: 0.42
                        timestamp: '2026-08-04T09:59:36.316Z'
                        sessionId: sess-1
                        callId: call-1
                        traceId: trace-1
                        eventId: event-1
                        source: runtime
                        sourceSubtype: response_generation
                        sourceLabel: Runtime
                        sourceSubtypeLabel: Response Generation
                        sourceId: agent-1
                        channel: web_chat
                        channelType: web_chat
                        statusCode: 200
                        payloadState: available
                full:
                  summary: Full mode with inline request and response
                  value:
                    success: true
                    statusCode: 200
                    total: 1
                    limit: 100
                    offset: 0
                    dataMode: full
                    hasMore: false
                    generations:
                      - id: >-
                          sess-1:call-1:2026-08-04T09:59:36.316Z:GPT-5.2:azure:1396:780:11659:0
                        model: GPT-5.2
                        agentName: Support Agent
                        provider: azure
                        environment: production
                        status: success
                        inputTokens: 1396
                        cachedTokens: 224
                        completionTokens: 500
                        reasoningTokens: 280
                        outputTokens: 780
                        totalTokens: 2176
                        latencyMs: 11659
                        timeToFirstTokenMs: 0
                        streamingUsed: false
                        cost: 0.42
                        timestamp: '2026-08-04T09:59:36.316Z'
                        sessionId: sess-1
                        callId: call-1
                        traceId: trace-1
                        eventId: event-1
                        source: runtime
                        sourceSubtype: response_generation
                        sourceLabel: Runtime
                        sourceSubtypeLabel: Response Generation
                        sourceId: agent-1
                        channel: web_chat
                        channelType: web_chat
                        statusCode: 200
                        payloadState: available
                        payload:
                          request:
                            model: GPT-5.2
                            messages:
                              - role: user
                                content: Hello
                          response:
                            text: How can I help?
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '413':
          $ref: '#/components/responses/ResponseTooLarge'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  parameters:
    ProjectId:
      name: projectId
      in: path
      required: true
      schema:
        type: string
        minLength: 1
  headers:
    XAblEncrypted:
      description: >-
        Present with value `true` when the body is an `EncryptedResponse`.
        Absent otherwise.
      schema:
        type: string
        enum:
          - 'true'
  schemas:
    LlmLedgerResponse:
      type: object
      additionalProperties: false
      required:
        - success
        - statusCode
        - total
        - limit
        - offset
        - dataMode
        - hasMore
        - generations
      properties:
        success:
          type: boolean
          const: true
          description: |
            Always true on a successful response.
        statusCode:
          type: integer
          const: 200
          description: >
            HTTP status code returned by the provider — 200 when the call
            succeeded.
        total:
          type: integer
          minimum: 0
          description: |
            Total number of calls matching your filters, across all pages.
        limit:
          type: integer
          minimum: 1
          maximum: 10000
          description: |
            The page size applied to this response.
        offset:
          type: integer
          minimum: 0
          description: |
            The offset applied to this response.
        dataMode:
          type: string
          enum:
            - summary
            - full
          description: |
            The detail level applied to this response, echoing your request.
        hasMore:
          type: boolean
          description: |
            Whether more pages are available after this one.
        generations:
          type: array
          items:
            $ref: '#/components/schemas/LlmGeneration'
          description: |
            The LLM calls on this page.
        attributionMatch:
          type: object
          additionalProperties: false
          required:
            - name
            - sourceCount
          description: >
            Present only when an `attributionName` filter matched more than one
            source.
          properties:
            name:
              type: string
              description: The name that was matched.
            sourceCount:
              type: integer
              minimum: 2
              description: How many sources share that name.
    EncryptedResponse:
      type: object
      additionalProperties: false
      required:
        - protected
        - encrypted_key
        - iv
        - ciphertext
        - tag
      description: >
        Response body for a Platform Key with response encryption on (signalled
        by the

        `X-ABL-Encrypted: true` header): a JWE in flattened JSON serialization.
        The

        decrypted plaintext is the JSON body documented for that status code.
      properties:
        protected:
          type: string
          pattern: ^[A-Za-z0-9_-]+$
          description: >-
            base64url of the protected header. Decodes to
            `ResponseProtectedHeader`.
        encrypted_key:
          type: string
          pattern: ^[A-Za-z0-9_-]+$
          description: >-
            The per-response AES-256 key, wrapped with the customer's RSA public
            key using RSA-OAEP-256.
        iv:
          type: string
          pattern: ^[A-Za-z0-9_-]+$
          description: base64url of the 12-byte AES-GCM IV (fresh per response).
        ciphertext:
          type: string
          pattern: ^[A-Za-z0-9_-]+$
          description: base64url of the AES-256-GCM ciphertext.
        tag:
          type: string
          pattern: ^[A-Za-z0-9_-]+$
          description: base64url of the 16-byte AES-GCM authentication tag.
    LlmGeneration:
      type: object
      additionalProperties: false
      required:
        - id
        - model
        - agentName
        - provider
        - environment
        - status
        - inputTokens
        - cachedTokens
        - completionTokens
        - reasoningTokens
        - outputTokens
        - totalTokens
        - latencyMs
        - timeToFirstTokenMs
        - streamingUsed
        - cost
        - timestamp
        - sessionId
        - callId
        - traceId
        - eventId
        - source
        - sourceSubtype
        - sourceLabel
        - sourceSubtypeLabel
        - sourceId
        - channel
        - channelType
        - attributionType
        - attributionId
        - attributionScope
        - attributionName
        - attributionProvider
        - statusCode
        - payloadState
      properties:
        id:
          type: string
          description: Stable composite identifier derived from call attributes.
        model:
          type: string
          description: >
            The model used, as recorded — for example `gpt-4o`. There is no
            fixed list,

            since each tenant can register its own models. `unknown` when no
            model was

            recorded.
          minLength: 1
        agentName:
          type: string
          description: Agent name
          falling back to operation type or provider.: null
        provider:
          type: string
          description: >
            The model provider, such as `openai` or `azure`. `unknown` when no
            provider

            was recorded. The values below are the providers the platform can
            call, but

            this is not a fixed list.
          minLength: 1
          x-common-values:
            - openai
            - anthropic
            - azure
            - bedrock
            - microsoft_foundry
            - google
            - gemini
            - vertex
            - vertex_ai
            - google_vertex
            - cohere
            - groq
            - mistral
            - fireworks
            - togetherai
            - together
            - perplexity
            - deepseek
            - xai
            - openrouter
            - litellm
            - openai_compatible
            - ultravox
            - custom
            - mock
            - unknown
        environment:
          type: string
          description: >
            The environment the call ran in. Empty for design-time calls that
            have no

            conversation behind them, such as Arch, evaluation runs, pipelines,
            and

            Studio test calls.
          enum:
            - ''
            - development
            - staging
            - production
            - working-copy
        status:
          type: string
          enum:
            - success
            - failed
          description: |
            Whether the call succeeded or failed.
        inputTokens:
          type: number
          minimum: 0
          description: |
            Tokens in the prompt sent to the model.
        cachedTokens:
          type: number
          minimum: 0
          description: >
            Input tokens served from the provider's prompt cache. These are part
            of inputTokens

            and usually cost less.
        completionTokens:
          type: number
          minimum: 0
          description: >
            Tokens the model generated as its answer, not counting reasoning
            tokens.
        reasoningTokens:
          type: number
          minimum: 0
          description: >
            Tokens the model spent on internal reasoning. Billed as output but
            not part of the

            visible answer.
        outputTokens:
          type: number
          minimum: 0
          description: |
            All tokens the model produced — the answer plus any reasoning.
        totalTokens:
          type: number
          minimum: 0
          description: |
            Input plus output tokens for this call.
        latencyMs:
          type: number
          minimum: 0
          description: |
            Total time the call took, in milliseconds.
        timeToFirstTokenMs:
          type:
            - number
            - 'null'
          minimum: 0
          description: >
            Time until the first token arrived, in milliseconds. Meaningful for
            streamed calls;

            null otherwise.
        streamingUsed:
          type: boolean
          description: |
            Whether the response was streamed back token by token.
        cost:
          type: number
          minimum: 0
          description: >-
            Estimated cost. No currency field exists on this endpoint; values
            are implicitly USD.
        timestamp:
          type: string
          format: date-time
          description: |
            When the call was made.
        sessionId:
          type: string
          description: >
            The conversation this call belongs to. Empty for calls made outside
            a conversation,

            such as Studio test calls.
        callId:
          type: string
          description: |
            Identifier of the individual LLM call.
        traceId:
          type: string
          description: >
            The trace this call belongs to. Use it to look the call up in the
            traces API.
        eventId:
          type: string
          description: >
            The trace event that recorded this call. Use it with the traces API
            for the full

            execution context.
        source:
          type: string
          description: >
            Which part of the platform made the call. Older recorded spellings
            are

            translated to the current name where possible; anything unrecognised
            is

            returned as recorded.
          enum:
            - runtime
            - runtime_internal
            - arch
            - evals
            - pipelines
            - guardrails
            - knowledge
            - studio_test_calls
            - channels
        sourceSubtype:
          type: string
          description: >
            What the call was used for within its source, such as
            `response_generation`.

            Older recorded spellings are translated to the current name where
            possible;

            anything unrecognised is returned as recorded.
          enum:
            - response_generation
            - conversation_history_compaction
            - ner_gather_llm_extraction
            - model_based_pii_entity_recognizer
            - model_entity_preview
            - llm_backed_validation
            - searchai_kb_query_intelligence
            - searchai_query_assistance
            - routing_pipeline
            - pipeline_classifier
            - pipeline_tool_filter
            - pipeline_merge
            - contextual_filler_generation
            - tool_result_summarization
            - sip_handoff_summary
            - semantic_execution
            - legacy_nlu_fallback
            - general_assistance
            - project_assistance
            - eval_remediation
            - evaluation_suite_generation
            - natural_language_analytics_query
            - text_to_sql
            - guardrails
            - studio_test_calls
            - widget_copy_translation
        sourceLabel:
          type: string
          description: >
            A display-ready name for `source`, such as `Studio test calls`. If
            the

            source is not one of the known values, its raw value is returned
            here

            instead.
          enum:
            - Runtime
            - Runtime Internal
            - Arch
            - Evals
            - Pipelines
            - Guardrails
            - Knowledge
            - Studio test calls
            - Channels
        sourceSubtypeLabel:
          type: string
          description: >
            A display-ready name for `sourceSubtype`, such as `Response
            Generation`. The

            25 labels below cover the known subtypes; anything else is returned
            as its

            raw value, so this list is not exhaustive. Note that
            `routing_pipeline`

            currently has no display name and is returned as `routing_pipeline`.
          x-common-values:
            - Response Generation
            - Conversation history compaction
            - NER / gather LLM extraction
            - Model-based PII/entity recognizer
            - Model entity preview
            - LLM-backed validation
            - SearchAI KB Query Intelligence
            - Pipeline classifier
            - Pipeline tool filter
            - Pipeline merge
            - Contextual filler generation
            - Tool-result summarization
            - SIP handoff summary
            - Semantic execution
            - SearchAI query assistance
            - Legacy NLU fallback
            - General assistance
            - Project assistance
            - Eval remediation
            - Evaluation suite generation
            - Natural-language analytics query
            - Text-to-SQL
            - Guardrails
            - Studio test calls
            - Widget copy translation
          x-label-map:
            response_generation: Response Generation
            conversation_history_compaction: Conversation history compaction
            ner_gather_llm_extraction: NER / gather LLM extraction
            model_based_pii_entity_recognizer: Model-based PII/entity recognizer
            model_entity_preview: Model entity preview
            llm_backed_validation: LLM-backed validation
            searchai_kb_query_intelligence: SearchAI KB Query Intelligence
            pipeline_classifier: Pipeline classifier
            pipeline_tool_filter: Pipeline tool filter
            pipeline_merge: Pipeline merge
            contextual_filler_generation: Contextual filler generation
            tool_result_summarization: Tool-result summarization
            sip_handoff_summary: SIP handoff summary
            semantic_execution: Semantic execution
            searchai_query_assistance: SearchAI query assistance
            legacy_nlu_fallback: Legacy NLU fallback
            general_assistance: General assistance
            project_assistance: Project assistance
            eval_remediation: Eval remediation
            evaluation_suite_generation: Evaluation suite generation
            natural_language_analytics_query: Natural-language analytics query
            text_to_sql: Text-to-SQL
            guardrails: Guardrails
            studio_test_calls: Studio test calls
            widget_copy_translation: Widget copy translation
        sourceId:
          type: string
          description: |
            Identifier of whatever made the call — usually the agent ID.
        channel:
          type: string
          description: >
            The channel the conversation took place on, exactly as recorded.
            Empty for

            calls with no conversation behind them, such as Studio test calls.
          enum:
            - ''
            - http_async
            - slack
            - line
            - msteams
            - whatsapp
            - messenger
            - instagram
            - twilio_sms
            - zendesk
            - telegram
            - genesys
            - genesys_open_messaging
            - ai4w
            - kore_agent_assist
            - email
            - voice_vxml
            - korevg
            - audiocodes
            - genesys_audio_connector
            - voice_pipeline
            - voice_realtime
            - voice
            - voice_twilio
            - voice_livekit
            - ag_ui
            - a2a
            - sdk_websocket
            - web_debug
            - web_chat
            - api
            - http
        channelType:
          type: string
          description: Empty for calls made outside a channel session.
          enum:
            - ''
            - http_async
            - slack
            - line
            - msteams
            - whatsapp
            - messenger
            - instagram
            - twilio_sms
            - zendesk
            - telegram
            - genesys
            - genesys_open_messaging
            - ai4w
            - kore_agent_assist
            - email
            - voice_vxml
            - korevg
            - audiocodes
            - genesys_audio_connector
            - voice_pipeline
            - voice_realtime
            - voice
            - voice_twilio
            - voice_livekit
            - ag_ui
            - a2a
            - sdk_websocket
            - web_debug
            - web_chat
            - api
            - http
        attributionType:
          type: string
          description: >-
            Kind of source the call is attributed to, for example `credential`
            or `auth_profile`. Empty when not attributed.
        attributionId:
          type: string
          description: >-
            ID of the credential, auth profile or other source the call is
            attributed to. Empty when not attributed.
        attributionScope:
          type: string
          description: Scope of the attribution as recorded. Empty when not recorded.
        attributionName:
          type: string
          description: >-
            Display name of the attributed credential, auth profile or source.
            Empty when unknown.
        attributionProvider:
          type: string
          description: >-
            Provider of the attributed credential or auth profile. Empty when
            unknown.
        statusCode:
          type: integer
          minimum: 100
          maximum: 599
          description: >
            HTTP status code returned by the provider — 200 when the call
            succeeded.
        payloadState:
          type: string
          enum:
            - available
            - omitted
            - missing
            - unknown
          description: >
            Whether the prompt and response were kept for this call: `available`
            (returned when

            dataMode=full), `omitted` (kept but not returned), `missing` (never
            kept), `unknown`

            (not recorded).
        payload:
          $ref: '#/components/schemas/LlmPayload'
          description: >-
            Present only in full mode when at least one stored payload side
            exists.
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        success:
          type: boolean
          const: false
          description: |
            Always false on an error response.
        error:
          description: >
            Details of what went wrong. `code` is a stable machine-readable
            value; `message` is

            human-readable.
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
              additionalProperties: true
        message:
          type: string
          description: >-
            Present on some authorization denials in addition to
            `error.message`.
        required:
          description: >-
            Permission(s) the caller was missing. Present on authorization
            denials.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
    LlmPayload:
      type: object
      additionalProperties: false
      required:
        - request
        - response
      properties:
        request:
          description: Exact stored request payload
          or null when only a response is stored.: null
        response:
          description: Exact stored response payload
          or null when only a request is stored.: null
  responses:
    BadRequest:
      description: >
        The request could not be understood. Common causes: `fromDate` or
        `toDate`

        missing or not a valid timestamp, `fromDate` not earlier than `toDate`,
        an

        unrecognised query parameter, an empty filter value, an invalid value
        for

        `status`, `dataMode`, `sortBy` or `sortOrder`, or a `limit` or `offset`
        outside

        the allowed range. The `error.code` says which.


        Encryption and POST-body errors also return 400:
        `ENCRYPTED_PAYLOAD_INVALID`

        (malformed, unexpected or undecryptable JWE, or a plain body for a

        request-encrypted key), `INVALID_REQUEST_BODY` (POST body is not a JSON
        object),

        and `INVALID_QUERY_PARAMETER` (unknown, null or nested POST body key, or
        a query

        string on a POST).
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorEnvelope'
              - $ref: '#/components/schemas/EncryptedResponse'
    Unauthorized:
      description: Missing or invalid `x-api-key`, or Authorization was supplied.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: The key lacks `analytics:read`.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorEnvelope'
              - $ref: '#/components/schemas/EncryptedResponse'
    NotFound:
      description: Project not found or concealed because it is outside the key's scope.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorEnvelope'
              - $ref: '#/components/schemas/EncryptedResponse'
    ResponseTooLarge:
      description: One full-mode generation exceeds the 1 MiB response budget.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorEnvelope'
              - $ref: '#/components/schemas/EncryptedResponse'
    RateLimited:
      description: Tenant request rate limit exceeded.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorEnvelope'
              - $ref: '#/components/schemas/EncryptedResponse'
    InternalError:
      description: >
        Unexpected LLM ledger query failure.


        Also returned, with a content-free body, when a response cannot be
        encrypted for

        a response-encrypted key.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorEnvelope'
              - $ref: '#/components/schemas/EncryptedResponse'
    Unavailable:
      description: >
        LLM ledger backing store unavailable.


        `ENCRYPTION_CONFIG_UNAVAILABLE` (with `Retry-After: 30`) means the
        Platform

        Key's payload-encryption configuration could not be read. There is no
        plaintext

        fallback.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorEnvelope'
              - $ref: '#/components/schemas/EncryptedResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Project-bound API key. Do not send an Authorization header.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.