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

# Replace billing plan

> Replace all mutable plan settings for future usage; omitted settings reset and mode remains immutable.



## OpenAPI

````yaml put /v1/ai/billing/plans/{id}
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/plans/{id}:
    put:
      tags:
        - AI > Billing
      summary: Replace billing plan
      description: >-
        Replace all mutable plan settings for future usage; omitted settings
        reset and mode remains immutable.
      operationId: replaceAgentPlan
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        description: Replace plan payload
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 120
                  description: Human-readable resource name.
                  example: Support agent plan
                rate_card_id:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  description: >-
                    Rate card reference. On policy writes, omission preserves
                    the current reference and null detaches it; on plan
                    replacement omission clears it.
                  example: airc_example
                overage_mode:
                  type:
                    - string
                    - 'null'
                  enum:
                    - refuse
                    - metered
                  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.
                  example: metered
                markup_percent:
                  type:
                    - string
                    - 'null'
                  maxLength: 40
                  pattern: ^\d+(\.\d+)?$
                  description: >-
                    Percentage added to resolved cost. Null on writes means no
                    override; an attached plan may supply the value.
                  example: '20'
                overage_markup_percent:
                  type:
                    - string
                    - 'null'
                  maxLength: 40
                  pattern: ^\d+(\.\d+)?$
                  description: >-
                    Percentage added to provider cost for overage. Mutually
                    exclusive with overage_rate_card_id.
                  example: '10'
                overage_rate_card_id:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  description: >-
                    Currency rate card used to price overage directly. Null
                    means provider cost plus the resolved overage markup.
                  example: airc_overage
                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
                  minItems: 1
                  maxItems: 8
                  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'
                per_seat_credits:
                  type:
                    - string
                    - 'null'
                  maxLength: 40
                  pattern: ^\d+(\.\d+)?$
                  description: >-
                    Credits granted per seat per billing period. Null grants no
                    credits.
                  example: '10000'
                grant_rollover_enabled:
                  type: boolean
                  description: >-
                    Whether granted credits survive renewal. Purchased credits
                    always roll over.
                  example: true
                settlement_interval_minutes:
                  type:
                    - integer
                    - 'null'
                  minimum: 60
                  maximum: 44640
                  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
              required:
                - name
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique Hyperline identifier for this resource.
                    example: d18603dd-7285-4bf5-a45e-88d7de8f37c9
                  name:
                    type: string
                    description: Human-readable resource name.
                    example: Support agent plan
                  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
                  rate_card_id:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Rate card reference. On policy writes, omission preserves
                      the current reference and null detaches it; on plan
                      replacement omission clears it.
                    example: airc_example
                  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'
                  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: '20'
                  overage_mode:
                    type: string
                    enum:
                      - refuse
                      - metered
                    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.
                    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.
                    example: '10'
                  overage_rate_card_id:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Currency rate card used to price overage directly. Null
                      means provider cost plus the resolved overage markup.
                    example: airc_overage
                  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
                  per_seat_credits:
                    type:
                      - string
                      - 'null'
                    pattern: ^-?\d+(\.\d+)?(e[+-]?\d+)?$/i
                    description: >-
                      Credits granted per seat per billing period. Null grants
                      no credits.
                    example: '10000'
                  grant_rollover_enabled:
                    type: boolean
                    description: >-
                      Whether granted credits survive renewal. Purchased credits
                      always roll over.
                    example: true
                  billing_item_ids:
                    type: array
                    items:
                      type: string
                    description: >-
                      Public product identifiers for this plan's invoice
                      charges, in creation order. Read-only; amounts are defined
                      by the corresponding price configurations.
                    example:
                      - prd_agent_plan
                  price_configuration_ids:
                    type: array
                    items:
                      type: string
                    description: >-
                      Public price configuration identifiers corresponding to
                      billing_item_ids. Read-only.
                    example:
                      - pcfg_agent_plan
                  using_policy_count:
                    type: number
                    description: >-
                      Number of customer policy scopes referencing this
                      resource.
                    example: 1
                  is_default:
                    type: boolean
                    description: Whether this is the default plan or shared customer scope.
                    example: false
                required:
                  - id
                  - name
                  - mode
                  - rate_card_id
                  - windows
                  - markup_percent
                  - overage_mode
                  - overage_markup_percent
                  - overage_rate_card_id
                  - settlement_interval_minutes
                  - settlement_schedule
                  - per_seat_credits
                  - grant_rollover_enabled
                  - billing_item_ids
                  - price_configuration_ids
                  - using_policy_count
                  - is_default
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '404':
          description: Plan 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.