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

# Create Subscription Session

> Create a checkout session to start a subscription for the authenticated account. Returns a hosted checkout URL that the client should redirect to. The session is pre-configured with a 30-day trial period.



## OpenAPI

````yaml api-reference/openapi/accounts.json POST /api/subscriptions/sessions
openapi: 3.1.0
info:
  title: Recoup API - Accounts
  description: >-
    API documentation for the Recoup platform - an AI agent platform for the
    music industry
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.recoupable.dev
security: []
paths:
  /api/subscriptions/sessions:
    post:
      description: >-
        Create a checkout session to start a subscription for the authenticated
        account. Returns a hosted checkout URL that the client should redirect
        to. The session is pre-configured with a 30-day trial period.
      requestBody:
        description: Session creation parameters
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubscriptionSessionRequest'
      responses:
        '200':
          description: Checkout session created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSubscriptionSessionResponse'
        '400':
          description: Bad request - missing or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionSessionErrorResponse'
        '401':
          description: Unauthorized - invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionSessionErrorResponse'
      security:
        - apiKeyAuth: []
        - bearerAuth: []
components:
  schemas:
    CreateSubscriptionSessionRequest:
      type: object
      required:
        - successUrl
      properties:
        successUrl:
          type: string
          format: uri
          description: The URL to redirect to after a successful payment.
          example: https://chat.recoupable.com?subscription=success
        accountId:
          type: string
          format: uuid
          description: >-
            UUID of the account to create the session for. Only applicable when
            the authenticated account has admin access to multiple accounts. If
            not provided, creates a session for the API key's own account.
          example: 123e4567-e89b-12d3-a456-426614174000
    CreateSubscriptionSessionResponse:
      type: object
      required:
        - id
        - url
      properties:
        id:
          type: string
          description: The checkout session ID.
          example: cs_test_a1b2c3d4e5f6g7h8i9j0
        url:
          type: string
          format: uri
          description: >-
            The hosted checkout URL. Redirect to this URL to complete the
            payment.
          example: https://checkout.stripe.com/pay/cs_test_a1b2c3d4e5f6g7h8i9j0
    SubscriptionSessionErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
          example: successUrl is required
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Recoup API key. [Learn more](/quickstart#api-keys).
    bearerAuth:
      type: http
      scheme: bearer

````