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

# Get credit usage

> Returns your organization's credit utilization for a billing month (default: current month) or a custom date range, plus a per-agent consumption breakdown. Amounts are in whole credits.

In **month mode** the response includes allocation, remaining, and `percentageUsed`; the organization `spent` figure is authoritative and may differ slightly from the sum of `agents[]`. In **range mode** allocation, remaining, and `percentageUsed` are `null`, and organization `spent` equals the sum of per-agent spend.



## OpenAPI

````yaml /openapi.json get /credits/usage
openapi: 3.1.0
info:
  title: Julian API
  version: 1.0.0
  description: >-
    API for Julian, 11x's AI calling platform. Programmatically enroll contacts
    into agent calling sequences, manage sequences, and track credit usage. All
    requests are authenticated with an organization API key in the `x-api-key`
    header and rate limited to 10 requests per second per key (HTTP 429 when
    exceeded).
servers:
  - url: https://julian.11x.ai/api/v1
security:
  - apiKeyAuth: []
tags:
  - name: Scheduling
    description: Enroll contacts into an agent's calling sequence.
  - name: Sequences
    description: Manage active sequences.
  - name: Agents
    description: Read agent configuration.
  - name: Conversation Meetings
    description: >-
      Manage the meeting booked during a conversation — list its attendees, add
      attendees before it starts, and cancel it. Every endpoint is addressed by
      an `entityId` that identifies the conversation. Today only voice calls are
      supported, with the form of the call prefix followed by the call ID (e.g.
      `call.abc123`). The meeting is resolved from the calendar booking created
      during the conversation, and the calendar provider remains the source of
      truth.
  - name: Conversation Metadata
    description: >-
      Retrieve completed conversation data asynchronously — designed for batch
      ingestion, backfills, and reconciliation jobs that pull conversation
      metadata instead of receiving it through a webhook.


      **Recommended batch ingestion flow:**


      1. Call `GET /conversations/search/{agentId}` with the time window you
      want to ingest (e.g. yesterday or the last seven days).

      2. Iterate through the returned `sequenceIds`.

      3. For each sequence ID, call `GET /conversations/metadata/{sequenceId}`.

      4. Store the returned `metadata` array in your warehouse.

      5. Use `limit`, `offset`, and `hasMore` to paginate through larger
      backfills.
  - name: Credits
    description: Track credit utilization.
  - name: Webhooks
    description: Events Julian sends to your endpoint.
paths:
  /credits/usage:
    get:
      tags:
        - Credits
      summary: Get credit usage
      description: >-
        Returns your organization's credit utilization for a billing month
        (default: current month) or a custom date range, plus a per-agent
        consumption breakdown. Amounts are in whole credits.


        In **month mode** the response includes allocation, remaining, and
        `percentageUsed`; the organization `spent` figure is authoritative and
        may differ slightly from the sum of `agents[]`. In **range mode**
        allocation, remaining, and `percentageUsed` are `null`, and organization
        `spent` equals the sum of per-agent spend.
      operationId: getCreditUsage
      parameters:
        - name: month
          in: query
          required: false
          description: >-
            Billing month as `YYYY-MM`. Defaults to the current month. Must not
            be in the future. Mutually exclusive with `startDate`/`endDate`.
          schema:
            type: string
            pattern: ^\d{4}-\d{2}$
            example: 2026-05
        - name: startDate
          in: query
          required: false
          description: >-
            Start of a custom range as `YYYY-MM-DD` (inclusive, UTC). Requires
            `endDate`. Range cannot exceed 366 days.
          schema:
            type: string
            format: date
        - name: endDate
          in: query
          required: false
          description: >-
            End of a custom range as `YYYY-MM-DD` (inclusive, UTC). Requires
            `startDate`. Cannot be in the future.
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Credit usage report.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditUsageResponse'
        '400':
          description: >-
            `INVALID_REQUEST` — invalid or conflicting period parameters (e.g.
            `month` combined with `startDate`/`endDate`, future month, range
            over 366 days).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CreditUsageResponse:
      type: object
      required:
        - period
        - organization
        - agents
      properties:
        period:
          type: object
          description: >-
            Echo of the resolved reporting period. `month` is present in month
            mode only.
          required:
            - type
            - startDate
            - endDate
          properties:
            type:
              type: string
              enum:
                - month
                - range
            month:
              type: string
              description: Billing month (`YYYY-MM`). Month mode only.
              example: 2026-05
            startDate:
              type: string
              format: date
            endDate:
              type: string
              format: date
        organization:
          type: object
          required:
            - allocatedCredits
            - spentCredits
            - remainingCredits
            - percentageUsed
          properties:
            allocatedCredits:
              type:
                - number
                - 'null'
              description: >-
                Credits allocated for the month. `null` in range mode or when no
                allocation is configured.
            spentCredits:
              type: number
              description: >-
                Credits spent in the period. Authoritative monthly figure in
                month mode; sum of per-agent spend in range mode.
            remainingCredits:
              type:
                - number
                - 'null'
              description: Credits remaining. `null` in range mode.
            percentageUsed:
              type:
                - number
                - 'null'
              description: >-
                Spent as a percentage of allocation, rounded to two decimals.
                `null` in range mode.
        agents:
          type: array
          description: Per-agent consumption breakdown from the credit ledger.
          items:
            type: object
            required:
              - agentId
              - agentName
              - spentCredits
              - transactionCount
            properties:
              agentId:
                type:
                  - string
                  - 'null'
                description: '`null` for spend not attributable to a specific agent.'
              agentName:
                type:
                  - string
                  - 'null'
              spentCredits:
                type: number
              transactionCount:
                type: integer
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Machine-readable error code.
          example: INVALID_PHONE_NUMBER
        message:
          type: string
          description: Human-readable explanation.
  responses:
    Unauthorized:
      description: >-
        `UNAUTHORIZED` or `INVALID_API_KEY` — API key missing, invalid, or not
        authorized for this agent's organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error: UNAUTHORIZED
                message: >-
                  API key is required. Please provide your API key in the
                  x-api-key header.
            invalidApiKey:
              summary: Invalid API key
              value:
                error: INVALID_API_KEY
                message: The provided API key is invalid.
    InternalServerError:
      description: >-
        `INTERNAL_SERVER_ERROR` — unexpected server error. Retry with backoff
        and contact the 11x team if it persists.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: INTERNAL_SERVER_ERROR
            message: Internal Server Error. Please contact 11x team.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Organization API key. Get it from the 11x team or from the platform.

````