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

# Get Agent Picks run trace

> Read one page of a project-owned run's console trace: redacted prompt, setup, narration, tool calls and results, file edits and errors, ordered by attempt then seq. An attempt's lines are available once that attempt finishes, so a running attempt has none yet; an attempt whose transcript could not be read has one error line, Trace unavailable for this attempt. availability says whether the run has stored lines, has none yet (pending: it is still running or finished within the last hour), or has none and none is expected (not_retained: it finished over an hour ago, as every run before traces were kept did), and attempts marks each attempt stored or not. A model_call item follows the first line of its attempt carrying its provider response id, else one of its tool-call ids, with tokens, cost and the running total of placed calls. Calls that match no line are in unplaced, 200 at a time in finish order: the first page (cursor 0, 0) carries the first 200 with unplaced_total, and passing unplaced_pagination.after_id as after_unplaced returns the next 200; other pages carry none. Each has a reason: failed, no_ids, pending while the run is running, or unmatched. Codex reports no ids, so its calls are never placed. totals counts every model proxy call. Each line carries preview, its first 65,536 characters, with preview_truncated when the stored text is longer; full=true with limit=1 returns one line's whole stored text (up to 1 MiB, detail.truncated beyond). Pass pagination.after_attempt and after_seq back until has_more is false. limit defaults to 50, maximum 100; a page also stops once 256 KiB of lines are included and always holds at least one line. Requires Agent Picks and visibility.read.



## OpenAPI

````yaml /openapi.json get /projects/{projectId}/agent-picks/runs/{runId}/trace
openapi: 3.1.0
info:
  title: DevTune API
  version: 2.0.0
  description: >-
    API for programmatic access to your AI visibility data, webhook
    subscriptions, and automation workflows. Use this API to integrate DevTune
    data into CI/CD pipelines, BI tools, AI agents, and operational systems.
servers:
  - url: https://devtune.ai/api/v2
    description: Production
security:
  - bearerAuth: []
paths:
  /projects/{projectId}/agent-picks/runs/{runId}/trace:
    get:
      summary: Get Agent Picks run trace
      description: >-
        Read one page of a project-owned run's console trace: redacted prompt,
        setup, narration, tool calls and results, file edits and errors, ordered
        by attempt then seq. An attempt's lines are available once that attempt
        finishes, so a running attempt has none yet; an attempt whose transcript
        could not be read has one error line, Trace unavailable for this
        attempt. availability says whether the run has stored lines, has none
        yet (pending: it is still running or finished within the last hour), or
        has none and none is expected (not_retained: it finished over an hour
        ago, as every run before traces were kept did), and attempts marks each
        attempt stored or not. A model_call item follows the first line of its
        attempt carrying its provider response id, else one of its tool-call
        ids, with tokens, cost and the running total of placed calls. Calls that
        match no line are in unplaced, 200 at a time in finish order: the first
        page (cursor 0, 0) carries the first 200 with unplaced_total, and
        passing unplaced_pagination.after_id as after_unplaced returns the next
        200; other pages carry none. Each has a reason: failed, no_ids, pending
        while the run is running, or unmatched. Codex reports no ids, so its
        calls are never placed. totals counts every model proxy call. Each line
        carries preview, its first 65,536 characters, with preview_truncated
        when the stored text is longer; full=true with limit=1 returns one
        line's whole stored text (up to 1 MiB, detail.truncated beyond). Pass
        pagination.after_attempt and after_seq back until has_more is false.
        limit defaults to 50, maximum 100; a page also stops once 256 KiB of
        lines are included and always holds at least one line. Requires Agent
        Picks and visibility.read.
      operationId: getAgentPicksRunTrace
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: runId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: after_attempt
          in: query
          schema:
            type: integer
            minimum: 0
            maximum: 2147483647
            default: 0
        - name: after_seq
          in: query
          schema:
            type: integer
            minimum: 0
            maximum: 2147483647
            default: 0
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: full
          in: query
          description: >-
            Adds each line's whole stored text as text. Only with limit=1: pass
            the line's attempt and its seq minus one as the cursor.
          schema:
            type: boolean
            default: false
        - name: after_unplaced
          in: query
          description: >-
            The unplaced_pagination.after_id of the previous page; returns the
            next 200 unplaced calls.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Agent Picks run trace
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AgentPicksRunTrace'
                  meta:
                    $ref: '#/components/schemas/Meta'
                required:
                  - data
                  - meta
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '429':
          $ref: '#/components/responses/RateLimitExceededError'
components:
  schemas:
    AgentPicksRunTrace:
      type: object
      additionalProperties: false
      required:
        - availability
        - attempts
        - items
        - unplaced
        - unplaced_total
        - unplaced_pagination
        - totals
        - pagination
      properties:
        availability:
          type: string
          enum:
            - stored
            - pending
            - not_retained
          description: >-
            stored: the run has stored lines. pending: none yet, because the run
            is still running or finished within the last hour. not_retained:
            none, and none is expected, because the run finished over an hour
            ago, as every run before traces were kept did.
        attempts:
          type: array
          description: >-
            Each attempt the run started, and whether its lines are stored. An
            attempt with stored false has no trace.
          items:
            type: object
            additionalProperties: false
            required:
              - attempt
              - stored
            properties:
              attempt:
                type: integer
                minimum: 1
              stored:
                type: boolean
        items:
          type: array
          items:
            type: object
            additionalProperties: false
            required:
              - attempt
              - seq
              - at
              - kind
              - preview
              - preview_truncated
              - detail
            properties:
              attempt:
                type: integer
                minimum: 1
              seq:
                type: integer
                minimum: 1
                description: >-
                  The line within its attempt. A model_call item carries the seq
                  of the line it follows.
              at:
                type: string
                format: date-time
              kind:
                type: string
                enum:
                  - prompt
                  - narration
                  - tool_call
                  - tool_result
                  - file_write
                  - file_edit
                  - error
                  - model_call
              preview:
                type: string
                description: >-
                  The line's first 65,536 characters, redacted. Empty for a
                  model_call item.
              preview_truncated:
                type: boolean
                description: The stored text is longer than the preview.
              text:
                type: string
                description: >-
                  The line's whole stored text, up to 1 MiB (detail.truncated
                  beyond). Only with full=true.
              detail:
                type: object
                additionalProperties: true
                description: >-
                  Tool name, arguments summary, path, command, URL, status, exit
                  code, line counts, packages and provider ids when the agent
                  reported them. A model_call item has model_call_id,
                  response_id, tool_call_ids, status, tokens, cost_usd,
                  started_at, finished_at, running_total_usd and
                  spend_is_lower_bound.
        unplaced:
          type: array
          maxItems: 500
          items:
            type: object
            additionalProperties: false
            required:
              - model_call_id
              - attempt
              - reason
              - response_id
              - tool_call_ids
              - status
              - input_tokens
              - output_tokens
              - cache_read_tokens
              - cache_write_tokens
              - cost_usd
              - started_at
              - finished_at
            properties:
              model_call_id:
                type: string
                format: uuid
              attempt:
                type:
                  - integer
                  - 'null'
              reason:
                type: string
                enum:
                  - failed
                  - no_ids
                  - pending
                  - unmatched
              response_id:
                type:
                  - string
                  - 'null'
              tool_call_ids:
                type: array
                items:
                  type: string
              status:
                type: string
                enum:
                  - completed
                  - failed
              input_tokens:
                type: integer
              output_tokens:
                type: integer
              cache_read_tokens:
                type: integer
              cache_write_tokens:
                type: integer
              cost_usd:
                type:
                  - number
                  - 'null'
              started_at:
                type: string
                format: date-time
              finished_at:
                type: string
                format: date-time
        unplaced_total:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Null on a page that carries no unplaced calls.
        unplaced_pagination:
          type:
            - object
            - 'null'
          additionalProperties: false
          required:
            - after_id
            - has_more
          description: >-
            Null on a page that carries no unplaced calls. Pass after_id as
            after_unplaced for the next 200.
          properties:
            after_id:
              type:
                - string
                - 'null'
              format: uuid
            has_more:
              type: boolean
        totals:
          type: object
          additionalProperties: false
          description: Every model proxy call of the run, placed or not.
          required:
            - calls_started
            - calls_finished
            - input_tokens
            - output_tokens
            - cache_read_tokens
            - cache_write_tokens
            - cost_usd
            - unpriced_calls
          properties:
            calls_started:
              type: integer
            calls_finished:
              type: integer
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            cache_read_tokens:
              type: integer
            cache_write_tokens:
              type: integer
            cost_usd:
              type: number
            unpriced_calls:
              type: integer
        pagination:
          type: object
          additionalProperties: false
          required:
            - after_attempt
            - after_seq
            - has_more
            - limit
          properties:
            after_attempt:
              type: integer
            after_seq:
              type: integer
            has_more:
              type: boolean
            limit:
              type: integer
    Meta:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
        projectId:
          type: string
          format: uuid
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        reason:
          type: string
          description: >-
            Why the request was refused, for an error with more than one cause,
            such as a refused content-draft start.
        status:
          type: integer
      required:
        - error
        - message
        - status
  responses:
    BadRequestError:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ForbiddenError:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFoundError:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimitExceededError:
      description: Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  headers:
    X-RateLimit-Limit:
      description: Maximum requests per window
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests remaining in current window
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix timestamp when the window resets
      schema:
        type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key with dtk_live_ prefix. Obtain it from API Keys in the account
        sidebar. New keys start with all supported scopes selected for the
        chosen project, and you can narrow them to specific read/write scopes as
        needed.

````

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