> ## 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 portal session



## OpenAPI

````yaml api-reference/openapi.json POST /billing/portal-sessions
openapi: 3.1.0
info:
  title: Aether API
  version: 0.1.0
servers:
  - url: https://api.runaether.dev
security:
  - bearerAuth: []
paths:
  /billing/portal-sessions:
    post:
      tags:
        - billing
      summary: Create billing portal session
      operationId: createBillingPortalSession
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                request_id:
                  type: string
                target_tier:
                  description: >-
                    Open the portal on the confirmation step for switching the
                    active paid subscription to this tier.
                  enum:
                    - starter
                    - pro
                    - max
                    - team
                  type: string
              required:
                - request_id
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingPortalSessionResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/BillingErrorResponse'
                  - $ref: '#/components/schemas/OrgAuthorizationErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
          description: Bad Gateway
components:
  schemas:
    BillingPortalSessionResponse:
      additionalProperties: false
      properties:
        url:
          type: string
      required:
        - url
      type: object
    BillingErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - bad_gateway
            - bad_request
            - checkout_pending
            - conflict
            - enterprise_invoice
            - forbidden
            - free_tier
            - gateway_timeout
            - gone
            - internal_error
            - invalid_surface
            - managed_elsewhere
            - method_not_allowed
            - no_billing_history
            - not_acceptable
            - not_found
            - not_implemented
            - payment_delinquent
            - payment_required
            - personal_org_requires_personal_plan
            - precondition_failed
            - provider_unavailable
            - rate_limited
            - request_canceled
            - request_timeout
            - request_too_large
            - requires_org_admin
            - service_unavailable
            - subscription_active
            - subscription_pending
            - team_org_requires_team_plan
            - team_plan_web_only
            - team_seats_via_membership
            - unauthenticated
            - unsupported_media_type
            - validation_failed
            - warm_slot_occupied
            - web_only
          minLength: 1
          type: string
        error:
          minLength: 1
          type: string
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
      required:
        - error
        - code
      type: object
    OrgAuthorizationErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - org_membership_required
            - org_role_insufficient
            - org_suspended
            - account_deleting
            - agent_host_route_not_allowed
            - credential_kind_not_admitted
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
        - code
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.