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

# Agent run-level billing

> Returns a paginated list of runs with their costs for a specific agent within the specified date range.

**Filtering**

- `usageTypes` — filter by usage type (comma-separated: `Server Time`, `Export GB`, `Agent Inputs`, `Proxy Data`, `Export CPM`)

**Sorting**

- `sortColumn` — `date` | `cost` | `duration` (default: `date`)
- `sortOrder` — `0` ascending (default) | `1` descending



## OpenAPI

````yaml GET /api/v1/billing/agents/{agentId}/runs
openapi: 3.0.1
info:
  title: Sequentum Cloud API
  description: API endpoints for Sequentum Cloud
  version: v1
servers: []
security:
  - ApiKey: []
    Bearer: []
paths:
  /api/v1/billing/agents/{agentId}/runs:
    get:
      tags:
        - ApiBilling
      summary: Get individual run costs for a specific agent
      description: >-
        Returns a paginated list of runs with their costs for a specific agent
        within the specified date range.


        **Filtering**


        - `usageTypes` — filter by usage type (comma-separated: `Server Time`,
        `Export GB`, `Agent Inputs`, `Proxy Data`, `Export CPM`)


        **Sorting**


        - `sortColumn` — `date` | `cost` | `duration` (default: `date`)

        - `sortOrder` — `0` ascending (default) | `1` descending
      parameters:
        - name: agentId
          in: path
          description: The agent ID
          required: true
          schema:
            type: integer
            format: int32
        - name: startDate
          in: query
          description: Start date for the range (ISO format, required)
          schema:
            type: string
            format: date-time
        - name: endDate
          in: query
          description: End date for the range (ISO format, required)
          schema:
            type: string
            format: date-time
        - name: pageIndex
          in: query
          description: 'Page number (1-based, default: 1)'
          schema:
            type: integer
            format: int32
            default: 1
        - name: recordsPerPage
          in: query
          description: 'Records per page (default: 50, max: 1000)'
          schema:
            type: integer
            format: int32
            default: 50
        - name: sortColumn
          in: query
          description: 'Column to sort by: date, cost, duration'
          schema:
            type: string
            default: date
        - name: sortOrder
          in: query
          description: 'Sort order: 0 = ascending (default), 1 = descending'
          schema:
            type: integer
            format: int32
            default: 0
        - name: usageTypes
          in: query
          description: Filter by usage types (comma-separated)
          schema:
            type: string
      responses:
        '200':
          description: Returns the paginated list of runs with costs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunsApiResponse'
        '400':
          description: If the request is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: If the API key is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: If the agent is not found or not accessible
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    AgentRunsApiResponse:
      type: object
      properties:
        runs:
          type: array
          items:
            $ref: '#/components/schemas/AgentRunCostApiModel'
          description: List of runs with their costs
          nullable: true
        totalRecordCount:
          type: integer
          description: Total number of runs matching the filter
          format: int32
        totalCost:
          type: number
          description: "Total cost across the runs in the current page.\r\nNote: this is a page-level sum, not a grand total across all pages."
          format: double
        agentId:
          type: integer
          description: Agent ID
          format: int32
        agentName:
          type: string
          description: Agent name
          nullable: true
      additionalProperties: false
      description: Paginated response for agent runs
    BadRequestError:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
        statusDescription:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
          readOnly: true
        severity:
          $ref: '#/components/schemas/ErrorSeverity'
        errorCode:
          type: string
          description: "Optional machine-readable error code. When present, clients should switch on this\r\nvalue rather than parsing Sequentum.Enterprise.Core.ControllerError.Message. Omitted from the response when null."
          nullable: true
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    AgentRunCostApiModel:
      type: object
      properties:
        runId:
          type: integer
          description: Run ID
          format: int64
        date:
          type: string
          description: Date of the run
          format: date-time
        startTime:
          type: string
          description: Start time of the run
          format: date-time
          nullable: true
        endTime:
          type: string
          description: End time of the run
          format: date-time
          nullable: true
        cost:
          type: number
          description: Cost for this run
          format: double
        billingType:
          type: string
          description: Billing type (e.g., "Server Time", "Export GB")
          nullable: true
      additionalProperties: false
      description: Individual agent run with cost (for billing purposes)
    ErrorSeverity:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
      type: integer
      description: >-
        `0` = `Error`; `1` = `Unexpected`; `2` = `Fatal`; `3` = `Warning`; `4` =
        `Info`
      format: int32
  securitySchemes:
    ApiKey:
      type: apiKey
      description: >-
        API Key authorization header. Example: "Authorization: ApiKey
        {your-api-key}"
      name: Authorization
      in: header
    Bearer:
      type: http
      description: 'OAuth 2.0 Bearer token. Example: "Authorization: Bearer {access-token}"'
      scheme: bearer
      bearerFormat: JWT

````