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

# Get a thread

> One external agent thread turn by turn: every model call as an `llm` step and the tool calls between calls as `tool` steps. Message bodies come from the newest stored request trace (`bodies` says how much was found).



## OpenAPI

````yaml /api-reference/openapi.json get /v1/deployments/{deployment_id}/threads/{thread_id}
openapi: 3.1.0
info:
  title: Veri API
  description: >-
    REST API for the Veri RL post-training platform. All requests require a
    Bearer API key (`vk_` prefix).
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.veri.studio
    description: Production
security: []
tags:
  - name: Training jobs
    description: Create, monitor, and manage training jobs.
  - name: Datasets
    description: Upload and connect training datasets.
  - name: Deployments
    description: Serve trained models and run inference.
  - name: Volumes
    description: Persistent file storage mounted into jobs.
  - name: Models
    description: Custom model registry deployments serve from.
  - name: Regions
    description: Discover available launch regions.
  - name: GPU
    description: Live GPU availability by provider and region.
  - name: Code artifacts
    description: Upload custom training script bundles.
  - name: Billing
    description: Credit balance and transaction history.
  - name: API keys
    description: Create and revoke API keys.
  - name: Account
    description: The authenticated caller's identity.
  - name: Settings
    description: Account-level integrations (Weights & Biases).
  - name: Metrics
    description: Prometheus metrics export for your own observability stack.
  - name: Evaluators
    description: 'Evaluators: versioned scoring rules (LLM judge, code, human).'
  - name: Experiments
    description: >-
      Experiments: offline runs of a pinned dataset snapshot through a target,
      scored by pinned evaluators.
  - name: Annotation queues
    description: >-
      Human review: queue traces, threads and experiment items, reserve one at a
      time, score them and feed corrections back into datasets.
  - name: Monitors
    description: >-
      Monitors: evaluators scoring a sampled share of a deployment's live
      traffic.
  - name: Observability
    description: Agent conversations, agents and their traffic.
  - name: Public runs
    description: Unauthenticated reads of runs their owners published to Explore.
paths:
  /v1/deployments/{deployment_id}/threads/{thread_id}:
    get:
      tags:
        - Observability
      summary: Get a thread
      description: >-
        One external agent thread turn by turn: every model call as an `llm`
        step and the tool calls between calls as `tool` steps. Message bodies
        come from the newest stored request trace (`bodies` says how much was
        found).
      operationId: thread
      parameters:
        - name: deployment_id
          in: path
          description: Deployment ID
          required: true
          schema:
            type: string
        - name: thread_id
          in: path
          description: The X-Veri-Thread-Id the requests carried
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreadDetail'
        '400':
          description: Malformed thread id, or observability disabled
        '404':
          description: No such deployment in this workspace, or no thread requests
      security:
        - bearerAuth: []
components:
  schemas:
    ThreadDetail:
      type: object
      required:
        - object
        - id
        - deployment_id
        - deployment_name
        - thread_id
        - agent
        - status
        - started_at
        - last_activity_at
        - bodies
        - models
        - totals
        - turns
        - scores
      properties:
        object:
          type: string
          description: Always "thread".
        id:
          type: string
          description: '`{deployment_id}:{thread_id}`.'
        deployment_id:
          type: string
        deployment_name:
          type: string
        thread_id:
          type: string
        agent:
          $ref: '#/components/schemas/AgentRef'
        status:
          type: string
          description: active | idle
        started_at:
          type: string
          format: date-time
        last_activity_at:
          type: string
          format: date-time
        bodies:
          type: string
          description: |-
            captured (the newest call's body is stored) | partial (an older
            call's is) | none (no stored bodies: trace bodies off or purged).
        models:
          type: array
          items:
            type: string
        totals:
          $ref: '#/components/schemas/ThreadTotals'
        tools:
          type:
            - array
            - 'null'
          items:
            type: object
          description: The `tools` the agent declared, from the stored body.
        turns:
          type: array
          items:
            $ref: '#/components/schemas/Turn'
          description: The latest 1000 model calls, oldest first, grouped into turns.
        scores:
          type: array
          items:
            $ref: '#/components/schemas/ScoreResponse'
          description: Thread and trace scores on this thread, newest first.
    AgentRef:
      type: object
      description: Who a conversation belongs to.
      required:
        - key
        - name
        - kind
      properties:
        key:
          type: string
          description: |-
            `env:<environment_id>` (managed), `agent:<X-Veri-Agent>`, or
            `deployment:<deployment_id>` for threads sent without an agent name.
        name:
          type: string
        kind:
          type: string
          description: managed | external
    ThreadTotals:
      type: object
      required:
        - turns
        - llm_calls
        - tool_calls
        - tool_errors
        - messages
        - prompt_tokens
        - cached_prompt_tokens
        - completion_tokens
        - errors
        - duration_ms
      properties:
        turns:
          type: integer
          format: int64
        llm_calls:
          type: integer
          format: int64
        tool_calls:
          type: integer
          format: int64
        tool_errors:
          type: integer
          format: int64
        messages:
          type: integer
          format: int64
          description: Transcript messages (counted from the steps without a stored body).
        prompt_tokens:
          type: integer
          format: int64
        cached_prompt_tokens:
          type: integer
          format: int64
        completion_tokens:
          type: integer
          format: int64
        errors:
          type: integer
          format: int64
        duration_ms:
          type: integer
          format: int64
    Turn:
      type: object
      required:
        - index
        - started_at
        - latency_ms
        - prompt_tokens
        - completion_tokens
        - llm_calls
        - tool_calls
        - steps
      properties:
        index:
          type: integer
          format: int32
          description: 1-based.
        started_at:
          type: string
          format: date-time
        latency_ms:
          type: integer
          format: int64
        user:
          type:
            - string
            - 'null'
        reply:
          type:
            - string
            - 'null'
        prompt_tokens:
          type: integer
          format: int64
        completion_tokens:
          type: integer
          format: int64
        llm_calls:
          type: integer
          format: int64
        tool_calls:
          type: integer
          format: int64
        steps:
          type: array
          items:
            $ref: '#/components/schemas/ThreadStep'
    ScoreResponse:
      type: object
      description: One score.
      required:
        - object
        - id
        - evaluator_id
        - evaluator_version
        - name
        - target_type
        - value
        - source
        - status
        - created_at
      properties:
        object:
          type: string
          description: Always "score".
        id:
          type: string
          description: '`scr_...`'
        evaluator_id:
          type: string
        evaluator_version:
          type: integer
          format: int32
        name:
          type: string
          description: The evaluator's name at write time.
        target_type:
          type: string
          description: trace | thread
        request_id:
          type:
            - string
            - 'null'
          description: The scored request (trace targets). Trace id = `veri-<request_id>`.
        deployment_id:
          type:
            - string
            - 'null'
        thread_id:
          type:
            - string
            - 'null'
          description: |-
            The thread (thread targets; also stamped on trace targets whose
            request carried a thread id).
        target_revision:
          type:
            - string
            - 'null'
          description: 'Thread targets: the last request id the score covers.'
        experiment_id:
          type:
            - string
            - 'null'
          description: 'Experiment-item targets: the experiment.'
        item_id:
          type:
            - string
            - 'null'
          description: |-
            Experiment-item targets: `<row_id>.<trial>`, or
            `<row_id>.<trial>.t<turn>` for one turn of a replayed thread.
        value:
          description: boolean | label string | number; null for error and skipped scores.
        passed:
          type:
            - boolean
            - 'null'
          description: >-
            The evaluator version's pass rule applied to the value; null when
            the

            version has no pass rule or the score carries no value.
        reasoning:
          type:
            - string
            - 'null'
        source:
          type: string
          description: api | sdk | human | experiment | monitor
        status:
          type: string
          description: ok | error | skipped
        error:
          type:
            - string
            - 'null'
          description: Why an error / skipped score has no value.
        author:
          type:
            - string
            - 'null'
          description: The user who wrote the score.
        model_version_id:
          type:
            - string
            - 'null'
          description: The model version that answered the scored request, when known.
        monitor_id:
          type:
            - string
            - 'null'
          description: The monitor that wrote the score (source monitor).
        confidence:
          type:
            - number
            - 'null'
          format: double
          description: |-
            The judge's probability for its verdict, 0..1; null unless a
            decision-mode judge wrote the score.
        probabilities:
          type:
            - object
            - 'null'
          description: |-
            The Jev judge's distribution behind the value: noul
            `{"true": p, "false": 1 - p}`, choice `{option: p}`, score
            `{"<level>": p}`. Null for every other score.
        created_at:
          type: string
          format: date-time
    ThreadStep:
      oneOf:
        - allOf:
            - $ref: '#/components/schemas/LlmStep'
            - type: object
              required:
                - kind
              properties:
                kind:
                  type: string
                  enum:
                    - llm
        - allOf:
            - $ref: '#/components/schemas/ToolStep'
            - type: object
              required:
                - kind
              properties:
                kind:
                  type: string
                  enum:
                    - tool
    LlmStep:
      type: object
      description: One model call (one request row).
      required:
        - request_id
        - model
        - started_at
        - latency_ms
        - prompt_tokens
        - cached_prompt_tokens
        - completion_tokens
        - status_code
        - tool_calls
      properties:
        request_id:
          type: string
        model:
          type: string
        started_at:
          type: string
          format: date-time
        latency_ms:
          type: integer
          format: int64
        ttft_ms:
          type:
            - integer
            - 'null'
          format: int64
        prompt_tokens:
          type: integer
          format: int64
        cached_prompt_tokens:
          type: integer
          format: int64
        completion_tokens:
          type: integer
          format: int64
        status_code:
          type: integer
          format: int32
        error:
          type:
            - string
            - 'null'
        finish_reason:
          type:
            - string
            - 'null'
        content:
          type:
            - string
            - 'null'
          description: The reply text; null without a stored body for this call.
        reasoning:
          type:
            - string
            - 'null'
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/ToolCallRef'
    ToolStep:
      type: object
      description: One tool call the agent ran between two model calls.
      required:
        - name
      properties:
        tool_call_id:
          type:
            - string
            - 'null'
        name:
          type: string
        arguments:
          type:
            - string
            - 'null'
        result:
          type:
            - string
            - 'null'
        duration_ms:
          type:
            - integer
            - 'null'
          format: int64
          description: Next model call start minus this call's completion.
    ToolCallRef:
      type: object
      required:
        - name
      properties:
        id:
          type:
            - string
            - 'null'
        name:
          type: string
        arguments:
          type:
            - string
            - 'null'
          description: The call's JSON arguments, as the model wrote them.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: API key with the `vk_` prefix. Create one from the dashboard.

````

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