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

# 取消套餐

> 取消计费计划

<script src="/locale-bridge.js" />


## OpenAPI

````yaml /openapi.zh-cn.json POST /v1/public/accounts/{account_id}/billing/cancel-plan
openapi: 3.1.0
info:
  title: Code API (Public)
  version: 1.0.0
servers:
  - url: https://api.hybridbox.io
security: []
paths:
  /v1/public/accounts/{account_id}/billing/cancel-plan:
    post:
      tags:
        - public-accounts
        - public-billing
      summary: 取消计费计划
      description: 取消帐户计费计划。
      operationId: >-
        cancel_public_billing_plan_v1_public_accounts__account_id__billing_cancel_plan_post
      parameters:
        - in: path
          name: account_id
          required: true
          schema:
            format: uuid
            title: Account Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingCancelPlanRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicBillingPlanOperationResponse'
          description: ''
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 验证错误
      security:
        - PublicBearerAuth: []
components:
  schemas:
    BillingCancelPlanRequest:
      description: 用于取消账户订阅计划的客户请求架构。
      properties:
        cancel_at_period_end:
          default: true
          description: 在计费周期结束时取消计划
          title: 在周期结束时取消
          type: boolean
        cancel_immediately:
          default: false
          description: 立即取消计划
          title: 立即取消
          type: boolean
      title: BillingCancelPlanRequest
      type: object
    PublicBillingPlanOperationResponse:
      properties:
        account_status:
          anyOf:
            - type: string
            - type: 'null'
          description: 操作后账户状态
          title: 账户状态
        effective_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: 计费变更何时生效
          title: 有效时间
        eligible:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 账户是否符合操作条件
          title: 符合条件
        previous_plan_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 以前的结算计划 ID
          title: 之前的计划 ID
        status:
          description: 计费运行状态
          title: 状态
          type: string
        target_plan_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 目标计费计划 ID
          title: 目标计划 ID
      required:
        - status
      title: PublicBillingPlanOperationResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: 详情
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: 位置
          type: array
        msg:
          title: 消息
          type: string
        type:
          title: 错误类型
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    PublicBearerAuth:
      bearerFormat: JWT or Hybridbox Service account token
      description: >-
        Public API bearer credential sent as `Authorization: Bearer <token>`.
        Use either an OAuth access token or a Hybridbox Service account token.
      scheme: bearer
      type: http

````