openapi: 3.0.3
info:
  title: allfeeds.ai API - account_info
  description: >
    Returns information about your allfeeds.ai account, including your
    service level and how many API calls you have remaining today.
  version: "2025-08"
  contact:
    url: https://allfeeds.ai/api
servers:
  - url: https://allfeeds.ai/api
paths:
  /account_info:
    get:
      operationId: accountInfo
      summary: Get account status and usage
      description: >
        Returns your account's service level, daily call limit, and
        remaining calls for the current day.
      parameters:
        - name: key
          in: query
          required: true
          description: Your allfeeds.ai API key (20 alphanumeric characters).
          schema:
            type: string
            pattern: '^[a-z0-9]{20}$'
          example: YOUR_API_KEY
      responses:
        "200":
          description: Successful result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountInfoResponse'
              example:
                results:
                  api_key: "YOUR_API_KEY"
                  ip_address: "12.34.56.78"
                  status: "active"
                  level: "basic"
                  daily_limit: 1000
                  used_today: 355
                  remaining_today: 645
                total_results: 1
        "400":
          description: Malformed request, typically an unrecognized API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Server-side error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AccountInfo:
      type: object
      properties:
        api_key:
          type: string
        ip_address:
          type: string
          description: IP address on file for the account.
        status:
          type: string
          description: >
            "active", or a message such as "credit card failed, reverted to
            free service level" if the account's last charge attempt failed.
        level:
          type: string
          enum: [free, basic, pro]
        daily_limit:
          description: >
            Maximum calls allowed per day. An integer (100 for free, 1000
            for basic, 10 if the last billing charge failed) or the string
            "unlimited" for an active pro account.
          oneOf:
            - type: integer
            - type: string
              enum: [unlimited]
        used_today:
          type: integer
          description: Number of calls made so far today.
        remaining_today:
          description: >
            Calls remaining today. An integer, or the string "unlimited" for
            an active pro account.
          oneOf:
            - type: integer
            - type: string
              enum: [unlimited]
    AccountInfoResponse:
      type: object
      properties:
        results:
          $ref: '#/components/schemas/AccountInfo'
        total_results:
          type: integer
    ErrorResponse:
      type: object
      properties:
        results:
          type: object
          properties:
            error:
              type: string
              description: Human-readable description of the error.
