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

# Update Subscription Plan

> Change the user's subscription to a different plan (upgrade or downgrade). Proration is applied by default.



## OpenAPI

````yaml cloud-api/openapi.json post /api/v1/payments/stripe/update-subscription
openapi: 3.1.0
info:
  title: Dev Kit for AI API
  description: 'API for Dev Kit for AI: Developer Toolkit for AI-Powered Web Applications'
  version: 1.6.1
servers:
  - url: https://api.devkit4ai.com
    description: Dev Kit for AI Production Server
  - url: https://api.vibecoding.ad
    description: Vibe Coding Production Server
security: []
paths:
  /api/v1/payments/stripe/update-subscription:
    post:
      tags:
        - Stripe Subscriptions
      summary: Update Subscription Plan
      description: >-
        Change the user's subscription to a different plan (upgrade or
        downgrade). Proration is applied by default.
      operationId: update_subscription_api_v1_payments_stripe_update_subscription_post
      parameters:
        - name: test_mode
          in: query
          required: false
          schema:
            type: boolean
            description: Use test mode
            default: true
            title: Test Mode
          description: Use test mode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateSubscriptionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateSubscriptionRequest:
      properties:
        new_price_id:
          type: string
          minLength: 1
          title: New Price Id
        proration_behavior:
          type: string
          pattern: ^(create_prorations|none|always_invoice)$
          title: Proration Behavior
          default: create_prorations
      type: object
      required:
        - new_price_id
      title: UpdateSubscriptionRequest
      description: Request to update/change subscription plan.
    UpdateSubscriptionResponse:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
        status:
          type: string
          title: Status
        price_id:
          type: string
          title: Price Id
        message:
          type: string
          title: Message
      type: object
      required:
        - subscription_id
        - status
        - price_id
        - message
      title: UpdateSubscriptionResponse
      description: Update subscription response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````