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

# Create billing checkout session



## OpenAPI

````yaml api-reference/openapi.account.json POST /billing/checkout-sessions
openapi: 3.1.0
info:
  title: Aether Account & Integrations API
  version: 0.1.0
  description: >-
    Account, billing, and integration-management endpoints used by the Aether
    web app and CLI. Root-mounted; NOT part of the versioned /v1 contract.
servers:
  - url: https://api.runaether.dev
security:
  - bearerAuth: []
paths:
  /billing/checkout-sessions:
    post:
      tags:
        - billing
      summary: Create billing checkout session
      operationId: createBillingCheckoutSession
      requestBody:
        content:
          application/json:
            schema:
              discriminator:
                mapping:
                  credit_pack:
                    $ref: >-
                      #/components/schemas/CreateBillingCreditPackCheckoutSessionRequest
                  subscription:
                    $ref: >-
                      #/components/schemas/CreateBillingSubscriptionCheckoutSessionRequest
                propertyName: checkout_type
              oneOf:
                - $ref: >-
                    #/components/schemas/CreateBillingSubscriptionCheckoutSessionRequest
                - $ref: >-
                    #/components/schemas/CreateBillingCreditPackCheckoutSessionRequest
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                discriminator:
                  mapping:
                    credit_pack:
                      $ref: '#/components/schemas/BillingCreditPackCheckoutSession'
                    subscription:
                      $ref: '#/components/schemas/BillingSubscriptionCheckoutSession'
                  propertyName: checkout_type
                oneOf:
                  - $ref: '#/components/schemas/BillingSubscriptionCheckoutSession'
                  - $ref: '#/components/schemas/BillingCreditPackCheckoutSession'
          description: Created
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Gateway
components:
  schemas:
    CreateBillingCreditPackCheckoutSessionRequest:
      additionalProperties: false
      properties:
        checkout_type:
          enum:
            - credit_pack
          type: string
        credit_pack_id:
          type: string
        return_path:
          maxLength: 500
          pattern: >-
            ^/(?:(?:\.{3,}[!-"$&-.0->A-\[\]-~]*|\.{0,2}[!-"$&--0->A-\[\]-~][!-"$&-.0->A-\[\]-~]*)/)*(?:\.{3,}[!-"$&-.0->A-\[\]-~]*|\.{0,2}[!-"$&--0->A-\[\]-~][!-"$&-.0->A-\[\]-~]*)?$
          type: string
      required:
        - checkout_type
        - credit_pack_id
        - return_path
      type: object
    CreateBillingSubscriptionCheckoutSessionRequest:
      additionalProperties: false
      properties:
        checkout_type:
          enum:
            - subscription
          type: string
        return_path:
          maxLength: 500
          pattern: >-
            ^/(?:(?:\.{3,}[!-"$&-.0->A-\[\]-~]*|\.{0,2}[!-"$&--0->A-\[\]-~][!-"$&-.0->A-\[\]-~]*)/)*(?:\.{3,}[!-"$&-.0->A-\[\]-~]*|\.{0,2}[!-"$&--0->A-\[\]-~][!-"$&-.0->A-\[\]-~]*)?$
          type: string
        tier:
          enum:
            - starter
            - pro
            - max
          type: string
      required:
        - checkout_type
        - tier
        - return_path
      type: object
    BillingCreditPackCheckoutSession:
      additionalProperties: false
      properties:
        amount_usd:
          format: double
          type: number
        checkout_session_id:
          format: uuid
          type: string
        checkout_session_token:
          pattern: ^pcs_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          type: string
        checkout_type:
          enum:
            - credit_pack
          type: string
        credit_pack_id:
          type: string
        credits:
          format: int64
          type: integer
        purchase_status:
          enum:
            - failed
            - granted
            - pending
            - pending_grant
          type: string
        status:
          enum:
            - created
            - completed
            - expired
            - failed
          type: string
        url:
          type: string
      required:
        - checkout_session_id
        - checkout_session_token
        - checkout_type
        - status
        - purchase_status
        - credit_pack_id
        - credits
        - amount_usd
      type: object
    BillingSubscriptionCheckoutSession:
      additionalProperties: false
      properties:
        checkout_session_id:
          format: uuid
          type: string
        checkout_session_token:
          pattern: ^pcs_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          type: string
        checkout_type:
          enum:
            - subscription
          type: string
        status:
          enum:
            - created
            - completed
            - expired
            - failed
          type: string
        subscription_status:
          enum:
            - active
            - failed
            - pending
            - pending_webhook
          type: string
        target_tier:
          enum:
            - starter
            - pro
            - max
          type: string
        url:
          type: string
      required:
        - checkout_session_id
        - checkout_session_token
        - checkout_type
        - status
        - target_tier
        - subscription_status
      type: object
    ErrorResponse:
      additionalProperties: false
      properties:
        code:
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````