> ## 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 using JWE payload

> POST form of `GET` on this path. It accepts the same parameters as a flat JSON
body (`LlmLedgerQueryBody`) instead of a query string, and returns the same response.
Use it when the request parameters must be encrypted. See "Sending parameters
in a POST body" and "Payload encryption" in the API description.

- Request encryption off: send `LlmLedgerQueryBody` as `application/json`.
- Request encryption on: send the same object encrypted as an
  `EncryptedRequest`, preferably as `application/jose+json`.
- Response encryption on: every response except `401` is an
  `EncryptedResponse` with `X-ABL-Encrypted: true`.


This endpoint retrieves the LLM call ledger for a project, with the request parameters supplied in the request body rather than the URL query string. It supports the same filters, pagination, sorting, and response formats as [the corresponding GET endpoint](/agent-platform/api-reference/analytics-list-llm-calls).

Use the `POST` endpoint when the request parameters must be encrypted. When request encryption is enabled for the Platform Key, send the LlmLedgerQueryBody as an encrypted JWE. When response encryption is enabled, the endpoint also returns the response as an encrypted JWE, including error responses after the API key has been authenticated.

The endpoint returns individual LLM calls rather than aggregating calls by conversation turn. You can use `dataMode` to return either call-level details or, with `full`, the stored prompt and response payloads when available.


## OpenAPI

````yaml agent-platform/api-specs/llm-ledger.yaml post /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:
    post:
      tags:
        - LLM Ledger
      summary: List LLM calls (parameters in the body)
      description: >
        POST form of `GET` on this path. It accepts the same parameters as a
        flat JSON

        body (`LlmLedgerQueryBody`) instead of a query string, and returns the
        same response.

        Use it when the request parameters must be encrypted. See "Sending
        parameters

        in a POST body" and "Payload encryption" in the API description.


        - Request encryption off: send `LlmLedgerQueryBody` as
        `application/json`.

        - Request encryption on: send the same object encrypted as an
          `EncryptedRequest`, preferably as `application/jose+json`.
        - Response encryption on: every response except `401` is an
          `EncryptedResponse` with `X-ABL-Encrypted: true`.
      operationId: queryPublicLlmLedger
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/LlmLedgerQueryBody'
                - $ref: '#/components/schemas/EncryptedRequest'
            examples:
              plain:
                summary: Request encryption off
                value:
                  fromDate: '2026-08-01T00:00:00.000Z'
                  toDate: '2026-08-02T00:00:00.000Z'
                  status: failed
                  dataMode: summary
                  sortBy: timestamp
                  sortOrder: desc
                  limit: 50
                  offset: 0
              encrypted:
                summary: Request encryption on (JWE of the plain example)
                value:
                  protected: >-
                    eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwia2lkIjoiNjZmN2ExYzJlNGIwYTFkMmMzZTRmNWE2In0
                  iv: oYYPW_6RxEsDR9Kq
                  ciphertext: >-
                    7Yqu-hzMpfFW7Ctc5gZiWoQvFrECfKqUbqa33wD6jBLX44QIegBlXvvYgJ2-jG8T_TP4gafy7QVk0FdsnMA0LWbhVrWEjDGiLBjgEhQB9kyFC4a__pBIXPbwJPbkDpmj2qIZw8LhfurVRK6Kmbnv1R4-FPT3aqfCamh4Ix3CC9Z4kPvio-TqQB3zsxjJZHjsBnRZn6nzWkJs4HR3ZGUsZ8DIysUwCSbsoV50ESqtxvVPvOBegxGij1aUriiVg04
                  tag: t1lAlMHFcbjNBYISc98GrQ
          application/jose+json:
            schema:
              $ref: '#/components/schemas/EncryptedRequest'
            example:
              protected: >-
                eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwia2lkIjoiNjZmN2ExYzJlNGIwYTFkMmMzZTRmNWE2In0
              iv: oYYPW_6RxEsDR9Kq
              ciphertext: >-
                7Yqu-hzMpfFW7Ctc5gZiWoQvFrECfKqUbqa33wD6jBLX44QIegBlXvvYgJ2-jG8T_TP4gafy7QVk0FdsnMA0LWbhVrWEjDGiLBjgEhQB9kyFC4a__pBIXPbwJPbkDpmj2qIZw8LhfurVRK6Kmbnv1R4-FPT3aqfCamh4Ix3CC9Z4kPvio-TqQB3zsxjJZHjsBnRZn6nzWkJs4HR3ZGUsZ8DIysUwCSbsoV50ESqtxvVPvOBegxGij1aUriiVg04
              tag: t1lAlMHFcbjNBYISc98GrQ
      responses:
        '200':
          description: LLM ledger page returned successfully (same body as the GET form).
          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:
                encrypted:
                  summary: >-
                    Response for a key with response encryption on (decrypt to
                    get the plain body)
                  value:
                    protected: >-
                      eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIiwia2lkIjoiNjZmN2ExYzJlNGIwYTFkMmMzZTRmNWE2IiwicGtmIjoiYTk1YWRiNGE2NTAwOTdmMzk1YTcyZDE0M2M4OGFjZmYxZDdmNzE3OTlkYzZmNDFiNjhiZDU5YmQzMGI1Mjc0MiJ9
                    encrypted_key: >-
                      CYZa0douXIvcxdFpLN93tTs84XAkpHSBv9cCmiIoL7NgSdIhH3zn31vC0pnzWSKzIlZzrAPOQSRj7DNYY1wUM7q66HqYLeB0Z4fQaJ-WRpTNoP4i7rO-EB4lSQTMo8hm0gPFIY1QuiMv5QBVqqYMpyE32keFnj_JjC3YIN9QwyvyDScEbJ6nCqG9etkkpS_yHBRDP7vgtzBWT0MEuE2Xotu4fLV7WHDtNrS5FjpTE6FdaRPHnqs4mFtrmJaGWZzBdp5ssIffrS8OzXPo-eAW9NIZzzY3LnrNm0LeC5Rke9SBRh-EhP7ggHv_GlhM13v8d-qfFjeD15CIRZTU5UmnIA
                    iv: N2dEX08LzFPtTZiA
                    ciphertext: nZsJoUJj3bjdddpTOa--ww
                    tag: OUVK4WI9pnx0vPxB5dxZNg
        '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'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '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
  schemas:
    LlmLedgerQueryBody:
      type: object
      additionalProperties: false
      description: >
        POST form of the GET query parameters: a flat JSON object whose keys are
        the

        GET query parameter names. For a Platform Key with request encryption
        on, send

        this object encrypted as an `EncryptedRequest` instead.
      properties:
        fromDate:
          description: Same as the `fromDate` query parameter of the GET operation.
          type: string
          format: date-time
        toDate:
          description: Same as the `toDate` query parameter of the GET operation.
          type: string
          format: date-time
        limit:
          description: Same as the `limit` query parameter of the GET operation.
          type: integer
          minimum: 1
          maximum: 10000
          default: 100
        offset:
          description: Same as the `offset` query parameter of the GET operation.
          type: integer
          minimum: 0
          default: 0
        sessionIds:
          description: >-
            Same as the `sessionIds` query parameter of the GET operation. Send
            a JSON array, or a comma-separated string as in the query string.
          anyOf:
            - type: array
              maxItems: 10000
              uniqueItems: true
              items:
                type: string
                minLength: 1
            - type: string
              minLength: 1
        channel:
          description: Same as the `channel` query parameter of the GET operation.
          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
        source:
          description: Same as the `source` query parameter of the GET operation.
          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
        sourceSubtype:
          description: Same as the `sourceSubtype` query parameter of the GET operation.
          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
        status:
          description: Same as the `status` query parameter of the GET operation.
          type: string
          enum:
            - success
            - failed
        model:
          description: Same as the `model` query parameter of the GET operation.
          type: string
          minLength: 1
        provider:
          description: Same as the `provider` query parameter of the GET operation.
          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
        environment:
          description: Same as the `environment` query parameter of the GET operation.
          type: string
          enum:
            - development
            - staging
            - production
            - working-copy
        name:
          description: Same as the `name` query parameter of the GET operation.
          type: string
          minLength: 1
        channelType:
          description: Same as the `channelType` query parameter of the GET operation.
          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
        attributionName:
          description: Same as the `attributionName` query parameter of the GET operation.
          type: string
          minLength: 1
        attributionType:
          description: Same as the `attributionType` query parameter of the GET operation.
          type: string
          minLength: 1
        attributionId:
          description: Same as the `attributionId` query parameter of the GET operation.
          type: string
          minLength: 1
        attributionScope:
          description: Same as the `attributionScope` query parameter of the GET operation.
          type: string
          minLength: 1
        dataMode:
          description: Same as the `dataMode` query parameter of the GET operation.
          type: string
          enum:
            - summary
            - full
          default: summary
        sortBy:
          description: Same as the `sortBy` query parameter of the GET operation.
          type: string
          enum:
            - timestamp
            - latencyMs
            - cost
            - totalTokens
          default: timestamp
        sortOrder:
          description: Same as the `sortOrder` query parameter of the GET operation.
          type: string
          enum:
            - asc
            - desc
          default: asc
      required:
        - fromDate
        - toDate
    EncryptedRequest:
      type: object
      additionalProperties: false
      required:
        - protected
        - iv
        - ciphertext
        - tag
      description: >
        Request body for a Platform Key with request encryption on: a JWE in
        flattened

        JSON serialization (RFC 7516 §7.2.2). The plaintext is the JSON body
        documented

        for the plain POST form. Send with `Content-Type: application/jose+json`
        or

        `application/json`.
      properties:
        protected:
          type: string
          pattern: ^[A-Za-z0-9_-]+$
          description: >
            base64url of the protected header JSON. Decodes to
            `RequestProtectedHeader`.

            Its ASCII is also the AES-GCM additional authenticated data.
        encrypted_key:
          type: string
          maxLength: 0
          description: 'Empty or omitted: `dir` has no wrapped key.'
        iv:
          type: string
          pattern: ^[A-Za-z0-9_-]+$
          description: base64url of a fresh random 12-byte AES-GCM IV.
        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.
    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
  headers:
    XAblEncrypted:
      description: >-
        Present with value `true` when the body is an `EncryptedResponse`.
        Absent otherwise.
      schema:
        type: string
        enum:
          - 'true'
  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'
    UnsupportedMediaType:
      description: >-
        A POST body was sent with a `Content-Type` other than `application/json`
        or `application/jose+json` (`UNSUPPORTED_MEDIA_TYPE`).
      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.