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

# Get plan attachment

> Get the customer's additional attachment to planId, returning 404 when it has none (a plan on the default policy is read there).



## OpenAPI

````yaml get /v1/ai/billing/customers/{id}/policies/plans/{planId}
openapi: 3.1.0
info:
  title: Hyperline API
  version: 0.0.0
servers:
  - url: https://api.hyperline.co
  - url: https://sandbox.api.hyperline.co
security: []
paths:
  /v1/ai/billing/customers/{id}/policies/plans/{planId}:
    get:
      tags:
        - AI > Billing
      summary: Get plan attachment
      description: >-
        Get the customer's additional attachment to planId, returning 404 when
        it has none (a plan on the default policy is read there).
      operationId: getPlanCustomerBillingPolicy
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
        - schema:
            type: string
          required: true
          name: planId
          in: path
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Resource ID.
                    example: d18603dd-7285-4bf5-a45e-88d7de8f37c9
                  customer_id:
                    type: string
                    description: ID of the customer the policy applies to.
                    example: cus_example
                  agent_slug:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Agent scope identifier. Null is the customer's shared pool
                      or a plan attachment.
                    example: support
                  is_default:
                    type: boolean
                    description: Whether this is the default plan or shared customer scope.
                    example: false
                  scope:
                    type: string
                    enum:
                      - default
                      - plan
                      - agent
                    description: >-
                      What this policy is: `default` (the customer's first
                      attachment, a plan or custom terms), `plan` (an additional
                      plan attachment, addressed by plan) or `agent` (a legacy
                      per-agent policy, which bills that agent first).
                    example: default
                  mode:
                    type: string
                    enum:
                      - wallet
                      - credits
                      - windows
                    description: >-
                      Billing mode.


                      - wallet: Charges a monetary wallet.

                      - credits: Consumes a credit balance.

                      - windows: Meters weighted units against rolling
                      allowances.
                    example: wallet
                  wallet_id:
                    type:
                      - string
                      - 'null'
                    description: >-
                      ID of the customer wallet the policy charges. Omit on
                      wallet policy writes to provision or reuse the customer's
                      wallet.
                    example: wal_example
                  credit_product_id:
                    type:
                      - string
                      - 'null'
                    description: >-
                      ID of the credit product whose balance this policy
                      consumes. The plan's credit product when the plan names
                      one. On policy writes, may be omitted when the plan names
                      one, and a different product is rejected.
                    example: prd_credits
                  parent_balance_enabled:
                    type: boolean
                    description: >-
                      Whether this plan attachment draws from its parent
                      organisation's balance: the parent's attachment to the
                      same plan, or further up while that one has the option on
                      too. Usage, prices and the ledger stay on this customer.
                      Plan attachments only. On policy writes, omission keeps
                      the current value (false on creation), and enabling it is
                      rejected while the parent chain has no balance to draw
                      from.
                    example: false
                  balance_customer_id:
                    type:
                      - string
                      - 'null'
                    description: >-
                      ID of the customer whose balance this policy draws from:
                      the policy's own customer, or the parent organisation
                      holding it when `parent_balance_enabled` is true. Null
                      when the parent chain has no balance to draw from, in
                      which case consumption is rejected as for a policy with no
                      balance.
                    example: cus_example
                  markup_percent:
                    type: string
                    pattern: ^-?\d+(\.\d+)?(e[+-]?\d+)?$/i
                    description: >-
                      Percentage added to resolved cost. Null on writes means no
                      override; an attached plan may supply the value.
                    example: '20'
                  overage_mode:
                    type: string
                    enum:
                      - refuse
                      - metered
                      - usage_events
                    description: >-
                      Behavior when credits or an allowance are exhausted.
                      Policy values may inherit the attached plan.


                      - refuse: Rejects the call that crosses the boundary
                      without deducting usage.

                      - metered: Prices the whole call as monetary overage,
                      using the overage card or USD provider cost plus markup.

                      - usage_events: Accepts the call as overage and bills it
                      as usage events (`event_type: ai_overage_usage`, one per
                      item with its `units`) priced by your catalog.
                      overage_markup_percent and overage_rate_card_id must be
                      null. Not available in wallet mode.
                    example: metered
                  overage_markup_percent:
                    type:
                      - string
                      - 'null'
                    pattern: ^-?\d+(\.\d+)?(e[+-]?\d+)?$/i
                    description: >-
                      Percentage added to provider cost for overage. Mutually
                      exclusive with overage_rate_card_id. Null when
                      overage_mode is usage_events.
                    example: '10'
                  overage_rate_card_id:
                    type:
                      - string
                      - 'null'
                    description: >-
                      ID of the currency rate card used to price overage
                      directly. Null means provider cost plus the resolved
                      overage markup.
                    example: airc_overage
                  overage_rate_card_source:
                    type:
                      - string
                      - 'null'
                    enum:
                      - policy
                      - plan
                    description: >-
                      Source of the effective overage rate card. Null when no
                      card is configured.


                      - policy: Selected directly on the customer policy.

                      - plan: Inherited from the attached plan.
                    example: plan
                  overage_wallet_id:
                    type:
                      - string
                      - 'null'
                    description: >-
                      ID of the wallet charged for overage. Null bills overage
                      in arrears.
                    example: wal_example
                  floor:
                    type: string
                    pattern: ^-?\d+(\.\d+)?(e[+-]?\d+)?$/i
                    description: >-
                      Minimum available balance a spend check requires, in the
                      policy's denomination.
                    example: '0'
                  windows:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                          minLength: 1
                          maxLength: 32
                          pattern: ^[a-z0-9][a-z0-9_-]*$
                          description: >-
                            Dimension or allowance identifier used by usage
                            payloads and meter results.
                          example: cached_input_tokens
                        duration_minutes:
                          type: integer
                          minimum: 1
                          maximum: 527040
                          description: >-
                            Rolling allowance duration in whole minutes, from 1
                            through 527040.
                          example: 1440
                        included_units:
                          type: string
                          maxLength: 40
                          pattern: ^\d+(\.\d+)?$
                          description: >-
                            Weighted units included in one allowance window, as
                            an exact decimal string.
                          example: '10000'
                      required:
                        - key
                        - duration_minutes
                        - included_units
                    description: >-
                      Rolling allowances. Required for windows plans; each
                      window meters every call. A plan replacement replaces the
                      entire array.
                    example:
                      - key: daily
                        duration_minutes: 1440
                        included_units: '10000'
                  rate_card_id:
                    type:
                      - string
                      - 'null'
                    description: >-
                      ID of the attached rate card. On policy writes, omission
                      preserves the current reference and null detaches it; on
                      plan replacement omission clears it.
                    example: airc_example
                  rate_card_source:
                    type:
                      - string
                      - 'null'
                    enum:
                      - policy
                      - plan
                    description: >-
                      Source of the effective rate card. Null when no card is
                      configured.


                      - policy: Selected directly on the customer policy.

                      - plan: Inherited from the attached plan.
                    example: policy
                  agent_rate_cards:
                    type: array
                    items:
                      type: object
                      properties:
                        agent_id:
                          type: string
                          description: ID of the agent this entry prices.
                          example: aiap_example
                        agent_slug:
                          type: string
                          description: >-
                            Slug of the agent this entry prices, as its records
                            report it (trimmed, lowercase). Must name an agent
                            of the workspace.
                          example: support
                        rate_card_id:
                          type: string
                          description: >-
                            ID of the rate card that prices this agent for this
                            customer. Its denomination must match the policy's
                            mode, and its currency the wallet's in wallet mode.
                          example: airc_support
                      required:
                        - agent_id
                        - agent_slug
                        - rate_card_id
                    description: >-
                      The customer's rate card for one agent at a time. It
                      prices that agent's records first and falls through row by
                      row to the policy's card, the plan's card for the agent,
                      then the plan's card. At most one entry per agent. On
                      writes, omission keeps the current list and an empty list
                      clears it.
                    example:
                      - agent_id: aiap_example
                        agent_slug: support
                        rate_card_id: airc_support
                  plan_id:
                    type:
                      - string
                      - 'null'
                    description: >-
                      ID of the attached billing plan. On policy writes,
                      omission preserves the current plan and null detaches it.
                    example: aiplan_example
                  settlement_interval_minutes:
                    type:
                      - number
                      - 'null'
                    description: >-
                      Settlement interval in minutes. Null means no interval
                      override. Mutually exclusive with settlement_schedule.
                    example: 60
                  settlement_schedule:
                    type:
                      - string
                      - 'null'
                    enum:
                      - calendar_month
                    description: >-
                      Calendar settlement schedule. Null clears the override;
                      mutually exclusive with settlement_interval_minutes.


                      - calendar_month: Settles at the end of each UTC calendar
                      month.
                    example: calendar_month
                  resolved_rate_card:
                    type:
                      - object
                      - 'null'
                    properties:
                      fallback_per_usd:
                        type:
                          - string
                          - 'null'
                        pattern: ^-?\d+(\.\d+)?(e[+-]?\d+)?$/i
                        description: >-
                          Credits, allowance units, or major currency units per
                          USD of provider cost. Null leaves unmatched usage
                          unpriced, except a vendor's unlisted items that a
                          vendor default makes free.
                        example: '1'
                      layer_count:
                        type: number
                        description: >-
                          Number of rate cards stacked for an agent with no card
                          of its own: the policy's, the plan's, then the credit
                          product's default.
                        example: 1
                      llm_rows:
                        type: number
                        description: Number of LLM pricing rows.
                        example: 1
                      item_rows:
                        type: number
                        description: Number of item rows.
                        example: 0
                      has_default_llm_row:
                        type: boolean
                        description: >-
                          Whether a wildcard LLM row supplies rates for
                          otherwise unmatched models.
                        example: true
                    required:
                      - fallback_per_usd
                      - layer_count
                      - llm_rows
                      - item_rows
                      - has_default_llm_row
                    description: >-
                      Summary of the effective pricing after applying rate-card
                      inheritance. Null when no card resolves.
                    example:
                      fallback_per_usd: '1000'
                      layer_count: 1
                      llm_rows: 1
                      item_rows: 0
                      has_default_llm_row: true
                  overrides:
                    type: object
                    properties:
                      rate_card_id:
                        type:
                          - string
                          - 'null'
                        description: >-
                          ID of the attached rate card. On policy writes,
                          omission preserves the current reference and null
                          detaches it; on plan replacement omission clears it.
                        example: null
                      markup_percent:
                        type:
                          - string
                          - 'null'
                        pattern: ^-?\d+(\.\d+)?(e[+-]?\d+)?$/i
                        description: >-
                          Percentage added to resolved cost. Null on writes
                          means no override; an attached plan may supply the
                          value.
                        example: null
                      overage_markup_percent:
                        type:
                          - string
                          - 'null'
                        pattern: ^-?\d+(\.\d+)?(e[+-]?\d+)?$/i
                        description: >-
                          Percentage added to provider cost for overage.
                          Mutually exclusive with overage_rate_card_id. Null
                          when overage_mode is usage_events.
                        example: null
                      overage_rate_card_id:
                        type:
                          - string
                          - 'null'
                        description: >-
                          ID of the currency rate card used to price overage
                          directly. Null means provider cost plus the resolved
                          overage markup.
                        example: null
                      settlement_interval_minutes:
                        type:
                          - number
                          - 'null'
                        description: >-
                          Settlement interval in minutes. Null means no interval
                          override. Mutually exclusive with settlement_schedule.
                        example: null
                      settlement_schedule:
                        type:
                          - string
                          - 'null'
                        enum:
                          - calendar_month
                        description: >-
                          Calendar settlement schedule. Null clears the
                          override; mutually exclusive with
                          settlement_interval_minutes.


                          - calendar_month: Settles at the end of each UTC
                          calendar month.
                        example: null
                      windows:
                        type:
                          - array
                          - 'null'
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                              minLength: 1
                              maxLength: 32
                              pattern: ^[a-z0-9][a-z0-9_-]*$
                              description: >-
                                Dimension or allowance identifier used by usage
                                payloads and meter results.
                              example: cached_input_tokens
                            duration_minutes:
                              type: integer
                              minimum: 1
                              maximum: 527040
                              description: >-
                                Rolling allowance duration in whole minutes,
                                from 1 through 527040.
                              example: 1440
                            included_units:
                              type: string
                              maxLength: 40
                              pattern: ^\d+(\.\d+)?$
                              description: >-
                                Weighted units included in one allowance window,
                                as an exact decimal string.
                              example: '10000'
                          required:
                            - key
                            - duration_minutes
                            - included_units
                        description: >-
                          Rolling allowances. Required for windows plans; each
                          window meters every call. A plan replacement replaces
                          the entire array.
                        example: null
                    required:
                      - rate_card_id
                      - markup_percent
                      - overage_markup_percent
                      - overage_rate_card_id
                      - settlement_interval_minutes
                      - settlement_schedule
                      - windows
                    description: >-
                      Pricing, window and settlement overrides before plan
                      inheritance; null means no override. Use these values when
                      editing configuration.
                    example:
                      rate_card_id: null
                      markup_percent: null
                      overage_markup_percent: null
                      overage_rate_card_id: null
                      settlement_interval_minutes: null
                      settlement_schedule: null
                      windows: null
                  effective_settlement_interval_minutes:
                    type:
                      - number
                      - 'null'
                    description: Settlement interval after plan inheritance.
                    example: 60
                  effective_settlement_schedule:
                    type:
                      - string
                      - 'null'
                    enum:
                      - calendar_month
                    description: Settlement schedule after plan inheritance.
                    example: null
                  blocked:
                    type: boolean
                    description: Whether spending is disabled for this billing scope.
                    example: false
                  created_at:
                    type: string
                    format: date-time
                    description: Creation time as a UTC ISO 8601 timestamp.
                    example: '2026-09-01T00:00:00Z'
                  updated_at:
                    type: string
                    format: date-time
                    description: Last update time as a UTC ISO 8601 timestamp.
                    example: '2026-09-02T12:00:00Z'
                required:
                  - id
                  - customer_id
                  - agent_slug
                  - is_default
                  - scope
                  - mode
                  - wallet_id
                  - credit_product_id
                  - parent_balance_enabled
                  - balance_customer_id
                  - markup_percent
                  - overage_mode
                  - overage_markup_percent
                  - overage_rate_card_id
                  - overage_rate_card_source
                  - overage_wallet_id
                  - floor
                  - windows
                  - rate_card_id
                  - rate_card_source
                  - agent_rate_cards
                  - plan_id
                  - settlement_interval_minutes
                  - settlement_schedule
                  - resolved_rate_card
                  - overrides
                  - effective_settlement_interval_minutes
                  - effective_settlement_schedule
                  - blocked
                  - created_at
                  - updated_at
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '404':
          description: Policy not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '409':
          description: The request conflicts with the current configuration.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
      security:
        - bearer: []
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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