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

# Lister les sous-comptes

> Listez vos sous-comptes avec la consommation du mois en cours.



## OpenAPI

````yaml GET /v1/sub-accounts
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:
    get:
      tags:
        - Sub-accounts
      summary: List sub-accounts
      description: >-
        Your sub-accounts, oldest first, each with this UTC month's usage. Pass
        nextCursor back as cursor for the next page.
      operationId: listSubAccounts
      parameters:
        - name: externalId
          in: query
          description: Only the sub-account with this externalId.
          schema:
            type: string
        - name: limit
          in: query
          description: Page size, 1 to 1,000. Default 100.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
        - name: cursor
          in: query
          description: nextCursor from the previous page.
          schema:
            type: string
      responses:
        '200':
          description: A page of sub-accounts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubAccountListResponse'
        '400':
          description: A field is missing, out of range or unknown.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: VALIDATION_ERROR
                  message: >-
                    unknown field creditLimit; allowed: name, externalId,
                    monthlyCreditLimit, concurrencyLimit
                  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:
    SubAccountListResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          const: true
        data:
          type: object
          required:
            - subAccounts
            - nextCursor
          properties:
            subAccounts:
              type: array
              items:
                $ref: '#/components/schemas/SubAccount'
            nextCursor:
              type:
                - string
                - 'null'
              description: Pass as cursor for the next page. Null on the last page.
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorDetail'
    SubAccount:
      type: object
      required:
        - id
        - name
        - externalId
        - status
        - monthlyCreditLimit
        - concurrencyLimit
        - createdAt
        - suspendedAt
        - usage
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        externalId:
          type:
            - string
            - 'null'
          description: Your id for this customer, unique among your sub-accounts.
        status:
          type: string
          enum:
            - active
            - suspended
        monthlyCreditLimit:
          type:
            - number
            - 'null'
          minimum: 0.01
          multipleOf: 0.01
          maximum: 20000000
          description: Credits it may be charged per UTC calendar month. Null means no cap.
        concurrencyLimit:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 100000
          description: >-
            Its queued and running tasks, inside your own limit. Null means it
            shares your limit.
        createdAt:
          type: string
          format: date-time
        suspendedAt:
          type:
            - string
            - 'null'
          format: date-time
        usage:
          type: object
          required:
            - month
            - credits
            - tasks
            - reservedCredits
          description: This UTC month.
          properties:
            month:
              type: string
              description: YYYY-MM, UTC.
            credits:
              type: number
              description: Credits charged this month.
            tasks:
              type: integer
              description: Tasks charged this month.
            reservedCredits:
              type: number
              description: >-
                Credits held by its tasks still queued or running. The monthly
                limit counts these too.
    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.