> ## 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 billing detail

> Returns the cost breakdown by usage type for a specific agent within the specified date range.
Useful for visualizing agent costs over time in charts.



## OpenAPI

````yaml GET /api/v1/billing/agents/{agentId}
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}:
    get:
      tags:
        - ApiBilling
      summary: Get cost breakdown for a specific agent over time
      description: >-
        Returns the cost breakdown by usage type for a specific agent within the
        specified date range.

        Useful for visualizing agent costs over time in charts.
      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: timeUnit
          in: query
          description: 'Time unit for grouping data: day (default), month'
          schema:
            type: string
            default: day
        - name: usageTypes
          in: query
          description: Filter by usage types (comma-separated)
          schema:
            type: string
      responses:
        '200':
          description: Returns the cost breakdown
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentCostBreakdownApiModel'
        '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:
    AgentCostBreakdownApiModel:
      type: object
      properties:
        agentId:
          type: integer
          description: Agent ID
          format: int32
        agentName:
          type: string
          description: Agent name
          nullable: true
        labels:
          type: array
          items:
            type: string
          description: Date labels for the chart (e.g., "2024-01-01", "2024-01-02")
          nullable: true
        usageTypes:
          type: array
          items:
            $ref: '#/components/schemas/UsageTypeDataApiModel'
          description: Usage data grouped by type
          nullable: true
        totalCost:
          type: number
          description: Total cost across all usage types
          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: Cost breakdown for a specific agent over time
    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: {}
    UsageTypeDataApiModel:
      type: object
      properties:
        type:
          type: string
          description: >-
            Usage type name (e.g., "Server Time", "Export GB", "Agent Inputs",
            "Proxy Data", "Export CPM")
          nullable: true
        data:
          type: array
          items:
            type: number
            format: double
          description: Cost data points corresponding to the date labels
          nullable: true
        totalCost:
          type: number
          description: Total cost for this usage type
          format: double
      additionalProperties: false
      description: Usage data for a specific usage type (e.g., Server Time, Export GB)
    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

````