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

# Run logs

> GET /v1/workflows/runs/{id}/logs

The per-step model calls behind a run: which model, how many tokens, what it cost.

Use it to answer "why did this run cost that" — the run itself reports one total, and this is the breakdown.


## OpenAPI

````yaml openapi.json GET /v1/workflows/runs/{id}/logs
openapi: 3.0.0
info:
  title: Infery Gateway
  description: >-
    Infery Inference Gateway — OpenAI-compatible API for LLMs, embeddings,
    images, audio, and video
  version: '1.0'
  contact: {}
servers:
  - url: https://api.infery.ai
    description: Production
  - url: http://localhost:3001
    description: Local
security: []
tags: []
paths:
  /v1/workflows/runs/{id}/logs:
    get:
      tags:
        - Workflows
      summary: Get per-step model_call_logs for a workflow run
      description: >-
        The MODEL AND MEDIA CALLS this run made, one row per call attempt,
        oldest first — a narrower thing than `stepRuns`: a step type that calls
        no model (`http`, `transform`, `code`, the container steps) contributes
        no row here, so an empty `data` is a normal answer for such a workflow.
        RETENTION: rows are purged 7 days after they started, so this returns
        `[]` for an older run whose `stepRuns` are still intact. Free; same
        access rule as `GET /v1/workflows/runs/{id}`.
      operationId: PipelineRunsController_getLogs[0]
      parameters:
        - name: id
          required: true
          in: path
          description: Run UUID.
          schema:
            example: 3c9a7e51-8b24-4f0d-9a17-6e2b5c4d8a03
            type: string
      responses:
        '200':
          description: Model call rows for this run, oldest first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunLogsResponseDto'
        '401':
          description: Unauthorized — invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: >-
            No run with this id in this workspace, or it is not visible to this
            caller.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      security:
        - ApiKey: []
components:
  schemas:
    RunLogsResponseDto:
      type: object
      properties:
        data:
          description: >-
            The run's model and media calls, oldest first. `[]` is a normal
            answer — for a workflow whose steps call no model, and for any run
            older than the 7-day retention window.
          type: array
          items:
            $ref: '#/components/schemas/RunLogDto'
      required:
        - data
    ErrorResponseDto:
      type: object
      properties:
        error:
          description: >-
            The error envelope. Every non-2xx response from this API has this
            shape, so a client can parse failures without branching on the
            endpoint.
          allOf:
            - $ref: '#/components/schemas/ErrorDetailDto'
      required:
        - error
    RunLogDto:
      type: object
      properties:
        id:
          type: string
          description: model_call_logs row UUID
          example: d21f6c0e-1a44-4a92-9d0b-58c7e3a1b904
        step_id:
          type: string
          description: >-
            Workflow step identifier — the step id from the definition, matching
            `stepRuns[].id` on the run.
          example: summarise
        attempt:
          type: number
          description: 1-based retry counter for this step
          example: 1
        status:
          type: string
          enum:
            - in_flight
            - succeeded
            - failed
          description: >-
            Call outcome. `in_flight` is a call that was still open when this
            was read — or one whose process died before it could be closed,
            which is why an old `in_flight` row is not evidence of a live call.
          example: succeeded
        input_tokens:
          type: number
          nullable: true
          description: >-
            Provider-reported input tokens for this call. Null whenever the
            provider reported none — which is the normal case for media steps,
            and always the case for transcription, whose byte count is
            deliberately NOT written here to keep this column in one unit.
          example: 1240
        output_tokens:
          type: number
          nullable: true
          description: >-
            Provider-reported output tokens for this call. Null on the same
            terms as `input_tokens`.
          example: 380
        settled_credits:
          type: number
          nullable: true
          description: >-
            Credits actually settled for this call. Null while the call is
            `in_flight`, and for a failure that settled nothing. This is the
            per-call component of the run's `creditsUsed`.
          example: 1.284
        error_message:
          type: string
          nullable: true
          description: >-
            Provider or engine failure message for a `failed` call. Null
            otherwise.
          example: upstream provider returned 502
        started_at:
          type: string
          description: >-
            ISO-8601 timestamp the call was opened. Rows are returned
            oldest-first by this field.
          example: '2026-05-04T09:15:23.401Z'
        completed_at:
          type: string
          nullable: true
          description: ISO-8601 timestamp the call was closed. Null while `in_flight`.
          example: '2026-05-04T09:15:25.544Z'
      required:
        - id
        - step_id
        - attempt
        - status
        - input_tokens
        - output_tokens
        - settled_credits
        - error_message
        - started_at
        - completed_at
    ErrorDetailDto:
      type: object
      properties:
        message:
          type: string
          example: Model not found
          description: Human-readable error message
        type:
          type: string
          example: invalid_request_error
          description: Error category
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - quota_exceeded
            - rate_limit_error
            - server_error
        code:
          type: string
          example: model_not_found
          nullable: true
          description: >-
            Stable machine-readable error code. Branch on this rather than on
            `message`, which is prose and may be reworded.
        param:
          type: string
          example: model
          nullable: true
          description: >-
            Name of the request parameter that triggered the error. `null` when
            the error is not attributable to one field.
        job_id:
          type: string
          example: job_1hR9xTPZqK4mVLc2nJ7fY5wB
          description: >-
            Handle to work that is ALREADY RUNNING AND ALREADY BILLED, present
            on the few errors that carry one. When it is here, this is not a
            failure to retry — retrying pays twice. Collect the result from `GET
            /v1/images/jobs/{job_id}`, which serves every durable media job
            regardless of modality.


            Two situations produce it. A media generation that outruns the
            gateway's wait answers `504` with `code: "job_timeout"` and keeps
            working. And `POST /v1/audio/speech` answers **500** with `code:
            "artifact_unreadable"` when the speech was generated and settled but
            could not be read back from storage — the audio exists and is paid
            for; only this response failed.


            Declared here rather than per-endpoint because the rule is about the
            FIELD, not the status: if this is present, there is a paid-for
            result to collect. It was undeclared until now, so a client
            generated from this document could not see the one field that
            recovers money already spent.
      required:
        - message
        - type
        - code
        - param
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key in format: Bearer inf_***'

````