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

> ## Agent Instructions
> Use the public API base URL: https://api.teamfollowup.ai/api.
> Authenticate public API requests with Authorization: Bearer YOUR_API_KEY.
> Use product-owned terms: agents, campaigns, projects (GoHighLevel sub-accounts), contacts, calls, outcomes, skills, cadences, phone numbers.
> Scope requests by locationId rather than projectName.
> Read the guide linked from each API reference group before recommending an endpoint.

# Get billing usage

> What a window cost, with totals for calls, phone numbers and co-author usage, broken down by sub-account (the default) or by day.

`callCostUSD` is what the calls cost you at your platform rate, whichever wallet funded them. `billedToClientsUSD` is what rebilled sub-accounts were charged for the same calls.

Allowed customer roles: `agency_admin`. The agency is the one the credential belongs to; no parameter selects another.

Required API key scope: `billing:read`.



## OpenAPI

````yaml /openapi.yaml get /api/billing/usage
openapi: 3.1.0
info:
  title: TFUAI Server API
  version: 1.0.0
  description: >-
    API reference for the TFUAI SaaS server.


    All published endpoints are mounted under `/api`. Responses use a standard
    envelope: `{ "success": true, ... }` on success and `{ "success": false,
    "error": "..." }` on failure.


    Product API modules are being launched module by module. This spec currently
    exposes only contracted public modules.


    Authenticate public API requests with an API key in the `Authorization`
    header: `Authorization: Bearer YOUR_API_KEY`.
servers:
  - url: https://api.teamfollowup.ai
    description: Production API origin. Public API paths are under /api.
security: []
tags:
  - name: Agents
    description: Manage voice agents, campaigns, workflows, and outcomes.
  - name: Analytics
    description: >-
      Minimal, non-billing performance summary: volume, conversion, and pickup
      metrics.
  - name: Billing
    description: >-
      Billing for your own agency: balance, spend, transaction history, invoices
      and sub-account wallets; auto-recharge, rebilling, Credit Guard and Stripe
      customers; and, with the billing:charge scope, purchases and charges.
  - name: Calls
    description: Review calls, test runs, and execution history.
  - name: Campaign Workflows
    description: >-
      What runs after a call lands: for each outcome (booked, opted out, asked
      for a callback…), an ordered chain of actions — tag the contact, move a
      pipeline stage, send an SMS, book an appointment. Stored as a graph:
      `nodes` are the actions, `edges` say what follows what, and
      `dispositionEntries` maps each outcome to the node its chain starts at.


      **Pick the narrowest endpoint that does the job.**


      | To | Call | |

      | --- | --- | --- |

      | See what fires per outcome | `GET .../workflow/digest` | Reads as plain
      text, no graph walking |

      | Add steps to an outcome | `POST .../outcomes/{outcome}/nodes` | Server
      derives node ids, edge ids, handles, layout |

      | Change a message, tag or setting | `PATCH .../workflow` | Merges;
      carries no graph, so it cannot damage one |

      | Remove one step | `DELETE .../nodes/{nodeId}` | Also re-links the chain
      around it |

      | Author or replace the whole graph | `PUT .../workflow` | Replaces
      everything you send |


      `PUT` is the only one that can re-wire, position nodes, build an `if`,
      save an unconfigured draft, or copy a whole workflow — and the only one
      that can overwrite a change someone else made after you read it. Use it
      when you are genuinely authoring the graph, and send `expectedVersion`
      when you do. For everything else the narrower endpoints are both easier
      and safer.
  - name: Contacts
    description: Contact list, filters, contact call history, and do-not-call actions.
  - name: GHL
    description: CRM variables and contact helpers used by agent and campaign setup flows.
  - name: Phone Numbers
    description: >-
      Caller ID pool, number search, assignment, movement, and release
      endpoints.
  - name: Power Dialer
    description: >-
      Power Dialer queue, lead cadence, callback, parked lead, and campaign
      schedule endpoints.
  - name: Projects
    description: >-
      Project management endpoints: list, update, disconnect, configure project
      campaigns, and validate setup.
  - name: Skills and Tools
    description: Manage reusable agent behaviors and in-call tool descriptions.
  - name: Split Testing
    description: >-
      Split live campaign traffic across agent variants and shift the weights
      between them.
  - name: Voices
    description: Voice catalogue endpoints for choosing the voice used by an agent.
paths:
  /api/billing/usage:
    get:
      tags:
        - Billing
      summary: Get billing usage
      description: >-
        What a window cost, with totals for calls, phone numbers and co-author
        usage, broken down by sub-account (the default) or by day.


        `callCostUSD` is what the calls cost you at your platform rate,
        whichever wallet funded them. `billedToClientsUSD` is what rebilled
        sub-accounts were charged for the same calls.


        Allowed customer roles: `agency_admin`. The agency is the one the
        credential belongs to; no parameter selects another.


        Required API key scope: `billing:read`.
      operationId: get-billing-usage
      parameters:
        - name: dateFromUTC
          in: query
          required: false
          schema:
            type: string
          description: >-
            Start of the window. A UTC ISO 8601 timestamp is canonical; a plain
            `YYYY-MM-DD` date is accepted and read as that day at 00:00:00Z. A
            timestamp must carry `Z` or an explicit offset, since one without a
            zone would be read as server-local time and shift the window. An
            empty string clears the bound. Anything else is a 400 rather than a
            silently wrong window. Billing windows are whole UTC days, so a
            timestamp selects the day it falls on. Omit both bounds for the last
            30 days. The window can cover at most 366 days.
          example: '2026-09-01'
        - name: dateToUTC
          in: query
          required: false
          schema:
            type: string
          description: >-
            End of the window, inclusive. Defaults to today. A UTC ISO 8601
            timestamp is canonical; a plain `YYYY-MM-DD` date is accepted and
            covers that whole day, through 23:59:59.999Z. A timestamp must carry
            `Z` or an explicit offset, since one without a zone would be read as
            server-local time and shift the window. An empty string clears the
            bound. Anything else is a 400 rather than a silently wrong window.
            Billing windows are whole UTC days, so a timestamp selects the day
            it falls on.
          example: '2026-09-14'
        - name: groupBy
          in: query
          required: false
          schema:
            type: string
            enum:
              - day
              - sub_account
            default: sub_account
          description: Break the window down by `sub_account` (the default) or by `day`.
          example: day
      responses:
        '200':
          description: Usage for the window.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingUsageResponse'
              examples:
                default:
                  value:
                    success: true
                    data:
                      window:
                        from: '2026-08-16'
                        to: '2026-09-14'
                        days: 30
                      groupBy: sub_account
                      totals:
                        calls: 2610
                        minutes: 4702.3
                        callCostUSD: 1598.78
                        billedToClientsUSD: 1841.2
                        phoneNumbersUSD: 8
                        coAuthorUSD: 6.5
                        totalCostUSD: 1613.28
                      subAccounts:
                        - subAccount:
                            locationId: rrHDPw5RIR5ULeUlfSAR
                            name: Bright Dental
                          calls: 1540
                          minutes: 2890.1
                          callCostUSD: 982.63
                          billedToClientsUSD: 1300.55
                        - subAccount:
                            locationId: q8LmVt2ZzYQ4pWnKdRb1
                            name: Harbour Roofing
                          calls: 1070
                          minutes: 1812.2
                          callCostUSD: 616.15
                          billedToClientsUSD: 540.65
        '400':
          description: >-
            A query parameter is malformed, unknown, or the window cannot be
            formed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: BadRequest
                    message: The window can cover at most 366 days
        '401':
          description: Missing or invalid authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: Unauthorized
        '403':
          description: >-
            The credential lacks `billing:read` (`InsufficientScope`), or it is
            not an agency admin's (`Forbidden`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: InsufficientScope
                    message: This API key does not have the required scope.
                    requiredScope: billing:read
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: TooManyRequests
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: InternalError
                    message: Could not load billing usage.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.teamfollowup.ai/api/billing/usage \
              --header 'Authorization: Bearer YOUR_API_KEY'
components:
  schemas:
    BillingUsageResponse:
      type: object
      additionalProperties: false
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/BillingUsage'
    BillingErrorResponse:
      type: object
      additionalProperties: false
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: Machine-readable code.
        message:
          type: string
          description: For a person.
        requiredScope:
          type: string
          description: On `InsufficientScope`, the scope the credential was missing.
    BillingUsage:
      type: object
      additionalProperties: false
      required:
        - window
        - groupBy
        - totals
      properties:
        window:
          $ref: '#/components/schemas/BillingWindow'
        groupBy:
          type: string
          enum:
            - day
            - sub_account
          description: How the window is broken down.
        totals:
          $ref: '#/components/schemas/BillingUsageTotals'
        days:
          type: array
          description: 'Present with `groupBy=day`: every day of the window, oldest first.'
          items:
            $ref: '#/components/schemas/BillingUsageDay'
        subAccounts:
          type: array
          description: >-
            Present with `groupBy=sub_account`: highest cost first. Phone
            numbers and co-author usage are agency-level and appear only in
            `totals`.
          items:
            $ref: '#/components/schemas/BillingUsageSubAccount'
    BillingWindow:
      type: object
      additionalProperties: false
      description: The whole UTC days the answer covers.
      required:
        - from
        - to
        - days
      properties:
        from:
          type: string
          format: date
          description: First day, inclusive.
        to:
          type: string
          format: date
          description: Last day, inclusive.
        days:
          type: integer
          minimum: 0
          description: Days covered.
    BillingUsageTotals:
      type: object
      additionalProperties: false
      required:
        - calls
        - minutes
        - callCostUSD
        - billedToClientsUSD
        - phoneNumbersUSD
        - coAuthorUSD
        - totalCostUSD
      properties:
        calls:
          type: integer
          minimum: 0
          description: Calls placed in the window.
        minutes:
          type: number
          description: Call minutes in the window.
        callCostUSD:
          type: number
          description: >-
            What the calls cost you at your platform rate, whichever wallet
            funded them.
        billedToClientsUSD:
          type: number
          description: What rebilled sub-accounts were charged for those calls.
        phoneNumbersUSD:
          type: number
          description: Phone number purchases and renewals.
        coAuthorUSD:
          type: number
          description: Co-author usage settled into your wallet.
        totalCostUSD:
          type: number
          description: '`callCostUSD` plus `phoneNumbersUSD` plus `coAuthorUSD`.'
    BillingUsageDay:
      type: object
      additionalProperties: false
      required:
        - date
        - calls
        - minutes
        - callCostUSD
        - billedToClientsUSD
        - phoneNumbersUSD
        - coAuthorUSD
      properties:
        date:
          type: string
          format: date
          description: The day.
        calls:
          type: integer
          minimum: 0
          description: Calls placed.
        minutes:
          type: number
          description: Call minutes.
        callCostUSD:
          type: number
          description: What the calls cost you.
        billedToClientsUSD:
          type: number
          description: What rebilled sub-accounts were charged.
        phoneNumbersUSD:
          type: number
          description: Phone number charges.
        coAuthorUSD:
          type: number
          description: Co-author usage.
    BillingUsageSubAccount:
      type: object
      additionalProperties: false
      required:
        - subAccount
        - calls
        - minutes
        - callCostUSD
        - billedToClientsUSD
      properties:
        subAccount:
          $ref: '#/components/schemas/BillingSubAccountRef'
        calls:
          type: integer
          minimum: 0
          description: Calls placed.
        minutes:
          type: number
          description: Call minutes.
        callCostUSD:
          type: number
          description: What the calls cost you.
        billedToClientsUSD:
          type: number
          description: What the sub-account was charged.
    BillingSubAccountRef:
      type: object
      additionalProperties: false
      required:
        - locationId
        - name
      properties:
        locationId:
          type: string
          description: GoHighLevel Location ID.
        name:
          type:
            - string
            - 'null'
          description: Display name.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Send your API key as `Authorization: Bearer YOUR_API_KEY`.'

````