> ## 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.

# Per-agent billing summary

> Returns a paginated list of agents with their total costs within the specified date range.
Only returns agents the authenticated user has access to.

**Filtering**

- `name` — filter by agent name (case-insensitive contains match)
- `usageTypes` — filter by usage type (comma-separated: `Server Time`, `Export GB`, `Agent Inputs`, `Proxy Data`, `Export CPM`)

**Sorting**

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



## OpenAPI

````yaml GET /api/v1/billing/agents
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:
    get:
      tags:
        - ApiBilling
      summary: Get all agents with their costs for a date range
      description: >-
        Returns a paginated list of agents with their total costs within the
        specified date range.

        Only returns agents the authenticated user has access to.


        **Filtering**


        - `name` — filter by agent name (case-insensitive contains match)

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


        **Sorting**


        - `sortColumn` — `name` | `cost` (default: `name`)

        - `sortOrder` — `0` ascending (default) | `1` descending
      parameters:
        - 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: name, cost'
          schema:
            type: string
            default: name
        - name: sortOrder
          in: query
          description: 'Sort order: 0 = ascending (default), 1 = descending'
          schema:
            type: integer
            format: int32
            default: 0
        - name: name
          in: query
          description: Filter by agent name (contains match, case-insensitive)
          schema:
            type: string
        - name: usageTypes
          in: query
          description: Filter by usage types (comma-separated)
          schema:
            type: string
      responses:
        '200':
          description: Returns the paginated list of agents with costs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsUsageApiResponse'
        '400':
          description: If the request is invalid (e.g., missing date range)
          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'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    AgentsUsageApiResponse:
      type: object
      properties:
        agents:
          type: array
          items:
            $ref: '#/components/schemas/AgentUsageApiModel'
          description: List of agents with their costs
          nullable: true
        totalRecordCount:
          type: integer
          description: Total number of agents matching the filter
          format: int32
        totalCost:
          type: number
          description: Total cost across all agents in the date range
          format: double
        startDate:
          type: string
          description: Start date of the range
          format: date-time
        endDate:
          type: string
          description: End date of the range
          format: date-time
      additionalProperties: false
      description: Paginated response for agent usage list
    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: {}
    AgentUsageApiModel:
      type: object
      properties:
        agentId:
          type: integer
          description: Agent ID
          format: int32
        agentName:
          type: string
          description: Agent name
          nullable: true
        cost:
          type: number
          description: Total cost for the agent in the date range
          format: double
        spaceId:
          type: integer
          description: Space ID the agent belongs to (null for personal space)
          format: int32
          nullable: true
      additionalProperties: false
      description: Individual agent usage summary
    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

````