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

# Get a trace

> One trace with all of its spans, ordered by `started_at`.

**Auth:** session. **Permission:** member of the project's organization.



## OpenAPI

````yaml /api-reference/openapi.json get /projects/{projectId}/traces/{traceId}
openapi: 3.1.0
info:
  title: CorePillar API
  version: 1.0.0
  description: >-
    REST API for AgentHub and ModelHub. Ingestion endpoints authenticate with a
    project tracing key; all other endpoints use the signed-in user's browser
    session.
servers:
  - url: https://pillarforge.corepillar.ai/api/v1
    description: AgentHub
security: []
tags:
  - name: Ingestion
    description: 'Send traces with a tracing key: JSON ingest and OpenTelemetry (OTLP).'
  - name: Traces
    description: Read traces and spans.
  - name: Evaluations
    description: Evaluate traces with evaluator collections.
  - name: Evaluators
    description: Built-in and custom evaluators.
  - name: Evaluator collections
    description: Ordered groups of evaluators.
  - name: Organizations
    description: Organizations you belong to.
  - name: Members
    description: Organization members, invites and roles.
  - name: Projects
    description: Projects inside an organization.
  - name: SSO
    description: Okta SSO configuration.
  - name: Tracing keys
    description: Create, list and revoke project tracing keys.
  - name: Cost calculator
    description: Estimate, generate and execute scenario runs.
  - name: Synthetic
    description: Synthetic agent and data setup from source material.
  - name: Chat
    description: ModelHub chat. Served at https://modelhub.corepillar.ai/api/v1.
  - name: Auth
    description: Sign-in helpers.
  - name: E2E
    description: Internal end-to-end encryption key directory.
paths:
  /projects/{projectId}/traces/{traceId}:
    get:
      tags:
        - Traces
      summary: Get a trace
      description: |-
        One trace with all of its spans, ordered by `started_at`.

        **Auth:** session. **Permission:** member of the project's organization.
      operationId: getTrace
      parameters:
        - name: projectId
          in: path
          required: true
          description: Project id.
          schema:
            type: string
            format: uuid
        - name: traceId
          in: path
          required: true
          description: Your `trace_id`, URL-encoded.
          schema:
            type: string
      responses:
        '200':
          description: The trace and its spans.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      trace:
                        $ref: '#/components/schemas/Trace'
                      spans:
                        type: array
                        items:
                          $ref: '#/components/schemas/Span'
        '401':
          description: Not signed in (`UNAUTHORIZED`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: >-
            Not a member of the organization, or missing the required permission
            (`FORBIDDEN`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: >-
            Project not found (`PROJECT_NOT_FOUND`) or trace not found
            (`NOT_FOUND`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: Unexpected server error (`INTERNAL_ERROR`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - session: []
components:
  schemas:
    Trace:
      type: object
      properties:
        id:
          type: string
          format: uuid
        organization_id:
          type: string
          format: uuid
        project_id:
          type: string
          format: uuid
        trace_id:
          type: string
        root_name:
          type: string
        status:
          $ref: '#/components/schemas/Status'
        environment:
          type: string
        source:
          type: string
          enum:
            - live
            - simulation
        duration_ms:
          type: integer
          description: Wall-clock extent of all spans.
        llm_time_ms:
          type: integer
          description: Time covered by `llm` spans, overlaps counted once.
        http_time_ms:
          type: integer
          description: Time covered by `http` spans, overlaps counted once.
        span_count:
          type: integer
        llm_call_count:
          type: integer
        tool_call_count:
          type: integer
        tokens_in:
          type: integer
        tokens_out:
          type: integer
        cost_usd:
          type: number
        started_at:
          type: string
          format: date-time
        tags:
          type: array
          items:
            type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Span:
      type: object
      properties:
        id:
          type: string
          format: uuid
        organization_id:
          type: string
          format: uuid
        project_id:
          type: string
          format: uuid
        trace_id:
          type: string
        span_id:
          type: string
        parent_span_id:
          type:
            - string
            - 'null'
        name:
          type: string
        kind:
          $ref: '#/components/schemas/SpanKind'
        model:
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/Status'
        tokens_in:
          type: integer
        tokens_out:
          type: integer
        cost_usd:
          type: number
        latency_ms:
          type: integer
        input:
          type: object
          additionalProperties: true
        output:
          type: object
          additionalProperties: true
        attributes:
          type: object
          additionalProperties: true
        started_at:
          type: string
          format: date-time
        ended_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable code. Branch on this, not on `message`.
              examples:
                - VALIDATION_ERROR
            message:
              type: string
              description: Human-readable description. May change.
            details:
              type: object
              additionalProperties: true
              description: Extra context; often empty.
    Status:
      type: string
      enum:
        - OK
        - ERROR
    SpanKind:
      type: string
      enum:
        - llm
        - tool
        - http
        - db
        - function
        - evaluation
      description: >-
        Decides which trace totals the span counts towards: `llm` (LLM calls,
        LLM time), `tool` (tool calls), `http` (HTTP time).
  securitySchemes:
    session:
      type: apiKey
      in: cookie
      name: session
      description: >-
        The session cookie set when you sign in to AgentHub or ModelHub in a
        browser. The cookie name shown here is illustrative. There are no API
        tokens for these endpoints.

````

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