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

# Get Agent Usage

> Returns the usage in minutes for an agent in a given time period.



## OpenAPI

````yaml POST /api/developers/v1/agents/{id}/usage
openapi: 3.0.3
info:
  title: Developer API
  version: 1.0.0
servers:
  - url: https://app.fluently.at
security:
  - bearerAuth: []
paths:
  /api/developers/v1/agents/{id}/usage:
    post:
      tags:
        - Agents
      summary: Get agent usage
      description: Returns the usage in minutes for an agent in a given time period.
      operationId: getAgentUsage
      parameters:
        - name: id
          in: path
          description: The agent’s ID
          required: true
          schema:
            type: string
      requestBody:
        description: Time period for which to fetch usage data.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentUsageRequest'
      responses:
        '200':
          description: Agent usage data
          content:
            application/json:
              schema:
                type: object
                properties:
                  usage:
                    $ref: '#/components/schemas/DeveloperAgentUsageObject'
                required:
                  - usage
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
components:
  schemas:
    AgentUsageRequest:
      type: object
      properties:
        from:
          type: string
          format: date-time
          description: Start date for the usage period (ISO 8601 format)
        to:
          type: string
          format: date-time
          description: End date for the usage period (ISO 8601 format)
      required:
        - from
        - to
    DeveloperAgentUsageObject:
      type: object
      properties:
        id:
          type: string
          description: The agent's ID
        usage:
          type: number
          description: The usage metric for the agent within the specified period.
      required:
        - id
        - usage
    BadRequestResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    UnauthorizedResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
      required:
        - success
        - message
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
      required:
        - success
        - message
  responses:
    BadRequest:
      description: Invalid or missing parameter
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BadRequestResponse'
    Unauthorized:
      description: Missing or invalid Authorization header or token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedResponse'
    InternalError:
      description: Internal server error during authentication or processing
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````