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

# Get Usage Route



## OpenAPI

````yaml https://api.somya.ai/openapi.json get /v1/usage
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /v1/usage:
    get:
      tags:
        - usage
      summary: Get Usage Route
      operationId: get_usage_route_v1_usage_get
      parameters:
        - name: source
          in: query
          required: false
          schema:
            type: string
            pattern: ^(web|api_key|all)$
            default: all
            title: Source
        - name: api_key_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Api Key Id
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UsageResponse:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          $ref: '#/components/schemas/UsageData'
      type: object
      required:
        - data
      title: UsageResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UsageData:
      properties:
        source:
          type: string
          title: Source
        period:
          $ref: '#/components/schemas/UsagePeriod'
        credits:
          $ref: '#/components/schemas/UsageCredits'
        requests:
          $ref: '#/components/schemas/UsageRequests'
      type: object
      required:
        - source
        - period
        - credits
        - requests
      title: UsageData
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UsagePeriod:
      properties:
        from:
          type: string
          format: date
          title: From
        to:
          type: string
          format: date
          title: To
      type: object
      required:
        - from
        - to
      title: UsagePeriod
    UsageCredits:
      properties:
        tts_remaining:
          type: integer
          title: Tts Remaining
        asr_remaining:
          type: integer
          title: Asr Remaining
      type: object
      required:
        - tts_remaining
        - asr_remaining
      title: UsageCredits
    UsageRequests:
      properties:
        tts_count:
          type: integer
          title: Tts Count
        asr_count:
          type: integer
          title: Asr Count
        tts_characters_processed:
          type: integer
          title: Tts Characters Processed
        asr_seconds_processed:
          type: number
          title: Asr Seconds Processed
      type: object
      required:
        - tts_count
        - asr_count
        - tts_characters_processed
        - asr_seconds_processed
      title: UsageRequests

````