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

# Get a trace

> The persisted trace of one run: execution spans and the gateway request log for the trace id.


## OpenAPI

```yaml openapi.json get /v1/traces/{id}
openapi: 3.1.0
info:
  title: Ocean One API
  version: 2.2.0
servers:
  - url: https://api.plungeai.com
paths:
  /v1/traces/{id}:
    get:
      operationId: get-v1-traces-id
      summary: Persisted execution trace — spans + gateway request log for one trace id
      security:
        - ozkBearer: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Trace
          content:
            application/json:
              schema:
                type: object
                properties:
                  trace_id:
                    type: string
                  spans:
                    type: array
                    items:
                      $ref: "#/components/schemas/Span"
                  gateway_requests:
                    type: array
                    items:
                      $ref: "#/components/schemas/GatewayRequest"
        "404":
          description: "not_found — the id is unknown, or the trace belongs to another key (the same answer for both). Spans and request logs land asynchronously: retry in a few seconds after a run"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  schemas:
    Error:
      type: object
      description: Standard error envelope. Every error response also carries an `X-Error-Code` response header equal to error.code, so a client branches on the header regardless of the negotiated body format (json | yaml | markdown | text). When the request created an execution, the `X-Execution-Id` response header is also set. Errors follow the negotiated format like success bodies.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
          additionalProperties: true
      required:
        - error
    GatewayRequest:
      type: object
      description: One row of api_gateway_requests — this router’s own request log.
      properties:
        id:
          type: string
        trace_id:
          type:
            - string
            - "null"
        plane:
          type: string
        route:
          type: string
        user_id:
          type:
            - string
            - "null"
        status:
          type: integer
        upstream:
          type:
            - string
            - "null"
        duration_ms:
          type:
            - integer
            - "null"
        cost_usd:
          type:
            - number
            - "null"
        created_at:
          type: integer
      required:
        - id
        - plane
        - route
        - status
        - created_at
    Span:
      type: object
      description: One row of execution_trace_spans.
      properties:
        id:
          type: integer
        trace_id:
          type: string
        workflow_id:
          type: string
        task_id:
          type:
            - string
            - "null"
        ts:
          type: integer
        type:
          type: string
          description: request_received|task_dispatched|task_completed|workflow_result|…
        agent:
          type:
            - string
            - "null"
        status:
          type:
            - string
            - "null"
        duration_ms:
          type:
            - integer
            - "null"
        payload_ref:
          type:
            - string
            - "null"
          description: R2 key when large, else null
        payload_inline:
          type:
            - string
            - "null"
          description: guard-scanned, <=1KB
      required:
        - id
        - trace_id
        - workflow_id
        - ts
        - type
  securitySchemes:
    ozkBearer:
      type: http
      scheme: bearer
      description: "ozk_ platform API key (Authorization: Bearer ozk_…)"
```
