Source: https://docs.cumuluslabs.io/reference/runs.usage
Content version: e19fc599

# runs.usage

Read metered usage and cost of one run

## Request {#request}

`GET /api/v1/runs/{run_id}/usage`

- MCP: `runs_usage`
- SDK: `client.runs.usage` (SDK path arguments use `path`; MCP uses `params`).
- Minimum API key role: **viewer**.
- Idempotency: **none**.

Use the request schema below. Read IDs from earlier operation results.

## Input schema {#input-schema}

```json
{
  "parameters": [
    {
      "name": "run_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "requestBody": null
}
```

## Responses {#responses}

```json
{
  "200": {
    "description": "Read metered usage and cost of one run",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/RunsUsageResponse200"
        }
      }
    }
  },
  "4XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  },
  "5XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}
```

## Referenced schemas {#schemas}

```json
{
  "components": {
    "schemas": {
      "RunsUsageResponse200": {
        "type": "object",
        "properties": {
          "run_id": {
            "type": "string",
            "format": "uuid"
          },
          "connected_ms": {
            "type": "integer",
            "minimum": 0,
            "nullable": true
          },
          "llm_input_tokens": {
            "type": "integer",
            "minimum": 0,
            "nullable": true
          },
          "llm_output_tokens": {
            "type": "integer",
            "minimum": 0,
            "nullable": true
          },
          "stt_ms": {
            "type": "integer",
            "minimum": 0,
            "nullable": true
          },
          "tts_characters": {
            "type": "integer",
            "minimum": 0,
            "nullable": true
          },
          "measurements": {
            "type": "integer",
            "minimum": 0
          },
          "cost": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "enum": [
                  "USD"
                ]
              },
              "amount": {
                "allOf": [
                  {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,12})?$"
                  }
                ],
                "nullable": true
              },
              "completeness": {
                "type": "string",
                "enum": [
                  "complete",
                  "partial",
                  "unpriced"
                ]
              }
            },
            "required": [
              "currency",
              "amount",
              "completeness"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "run_id",
          "connected_ms",
          "llm_input_tokens",
          "llm_output_tokens",
          "stt_ms",
          "tts_characters",
          "measurements",
          "cost"
        ],
        "additionalProperties": false
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "unauthenticated",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "invalid_request",
                  "idempotency_conflict",
                  "policy_denied",
                  "capability_unavailable",
                  "provider_unavailable",
                  "knowledge_unavailable",
                  "publication_invalid",
                  "run_not_active",
                  "rate_limited",
                  "outcome_unknown",
                  "internal"
                ]
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "none",
                  "unknown"
                ]
              },
              "details": {
                "type": "object",
                "additionalProperties": {}
              }
            },
            "required": [
              "code",
              "message",
              "retryable",
              "outcome"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  }
}
```

## Errors and recovery {#errors}

See [API error handling](https://docs.cumuluslabs.io/api#errors) and [Troubleshooting](https://docs.cumuluslabs.io/troubleshooting).

## Related guides {#related-guides}

- [Using the API](https://docs.cumuluslabs.io/api)
- [Runs](https://docs.cumuluslabs.io/runs)
- [Troubleshooting](https://docs.cumuluslabs.io/troubleshooting)
