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

# Nutzung aller Unterkonten auflisten

> Lesen Sie Credits und Tasks jedes Unterkontos über einen Bereich von UTC-Daten.



## OpenAPI

````yaml GET /v1/sub-accounts/usage
openapi: 3.1.0
info:
  title: querying.ai
  description: >-
    One API for every AI answer engine. Every task is asynchronous: submit, then
    collect the result via webhook or polling.
  version: 1.0.0
servers:
  - url: https://api.querying.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/sub-accounts/usage:
    get:
      tags:
        - Sub-accounts
      summary: Usage of every sub-account
      description: >-
        Credits and tasks charged to each sub-account over an inclusive range of
        UTC dates, largest first. Sub-accounts with no charge in the range are
        left out. Failed tasks are never charged.
      operationId: listSubAccountUsage
      parameters:
        - name: from
          in: query
          description: >-
            First UTC date, inclusive. Default: the first day of the current UTC
            month.
          schema:
            type: string
            format: date
        - name: to
          in: query
          description: >-
            Last UTC date, inclusive. Default: today (UTC). The range spans at
            most 366 days, from and to included.
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Totals per sub-account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubAccountUsageResponse'
        '400':
          description: >-
            from or to is not a YYYY-MM-DD date, to is before from, or the range
            spans more than 366 days.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: VALIDATION_ERROR
                  message: to must not be before from
                  timestamp: '2026-10-09T09:00:00.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            The key cannot manage sub-accounts: it has an engine scope or a
            daily credit limit, it is a sub-account's key, or it is an operator
            key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: SUB_ACCOUNT_FORBIDDEN
                  message: >-
                    Managing sub-accounts needs an API key without an engine
                    scope or a daily credit limit
                  timestamp: '2026-10-09T09:00:00.000Z'
components:
  schemas:
    SubAccountUsageResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          const: true
        data:
          type: object
          required:
            - from
            - to
            - credits
            - tasks
            - subAccounts
          properties:
            from:
              type: string
              format: date
            to:
              type: string
              format: date
            credits:
              type: number
              description: Total over every sub-account in the range.
            tasks:
              type: integer
            subAccounts:
              type: array
              items:
                type: object
                required:
                  - id
                  - name
                  - externalId
                  - credits
                  - tasks
                properties:
                  id:
                    type: string
                    format: uuid
                  name:
                    type: string
                  externalId:
                    type:
                      - string
                      - 'null'
                  credits:
                    type: number
                  tasks:
                    type: integer
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorDetail'
    ErrorDetail:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable, safe to branch on. See the Errors guide for the full list.
        message:
          type: string
          description: For humans. May change.
        details:
          description: >-
            Context for the error. An array of `{field, message}` on most
            `VALIDATION_ERROR`s; an object elsewhere (for example `{id}` on
            `RESOURCE_NOT_FOUND`, `retryAfterSec` on 429 and 503 codes). Omitted
            when there is nothing to add.
          oneOf:
            - type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
            - type: object
              additionalProperties: true
        timestamp:
          type: string
          format: date-time
  responses:
    Unauthorized:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: MISSING_API_KEY
              message: Missing or invalid API key
              timestamp: '2026-07-09T04:12:00.000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as `Authorization: Bearer <key>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.