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

# Get subscription

> Retrieve the current organization's subscription details including status, plan, and billing period. Returns null if the organization has no subscription.



## OpenAPI

````yaml https://app.usechar.ai/api/spec.json get /subscriptions
openapi: 3.1.1
info:
  title: Char API
  version: 1.0.0
  description: >-
    REST API for managing organizations, identity providers, end users, skills,
    threads, usage, and subscriptions.


    ## Authentication


    This API uses Bearer token authentication with WorkOS JWT tokens. Include
    the token in the Authorization header:


    ```

    Authorization: Bearer <your-jwt-token>

    ```


    ## Authorization Levels


    - **Public endpoints**: No authentication required

    - **Protected endpoints**: Require valid JWT token (user authentication)

    - **Organization endpoints**: Require valid JWT token with organization
    context selected


    Most endpoints require organization context. Ensure your JWT token includes
    the `org_id` claim.


    ## Data Formats


    ### Allowed Domains

    The `allowed_domains` field is an array of origins (e.g.,
    `https://app.example.com`). It is stored as JSON internally but surfaced as
    an array in the API.


    ### Timestamps

    All timestamps are returned as ISO 8601 strings (e.g.,
    `"2025-01-15T10:30:00.000Z"`).


    ## Rate Limits


    No application-level rate limiting is currently enforced.


    ## Error Responses


    All errors follow a consistent format:


    ```json

    {
      "code": "ERROR_CODE",
      "status": 400,
      "message": "Human-readable error message",
      "data": { /* optional additional details */ }
    }

    ```


    ### Error Codes


    | data.code | Description |

    |-----------|-------------|

    | `VALIDATION_ERROR` | Invalid input data (400) |

    | `AUTH_REQUIRED` | Missing or invalid authentication (401) |

    | `ACCESS_DENIED` | Permission denied (403) |

    | `PAYMENT_REQUIRED` | Subscription required (403) |

    | `ORG_CONTEXT_REQUIRED` | Organization selection required (403) |

    | `RESOURCE_NOT_FOUND` | Resource missing (404) |

    | `DUPLICATE_RESOURCE` | Resource already exists (409) |

    | `INTERNAL_ERROR` | Server-side error (500) |
servers:
  - url: https://app.usechar.ai/api
    description: Production API
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: >-
      Authentication operations including session management and logout. All
      auth endpoints require a valid JWT token.
  - name: Users
    description: >-
      Access the current authenticated user's profile and organization
      memberships.
  - name: Organizations
    description: Organization details, members, and configuration such as allowed domains.
  - name: Identity Providers
    description: Manage SSO configuration and test IDP connectivity.
  - name: Directories
    description: Directory sync resources backed by WorkOS directories.
  - name: End Users
    description: End users who interact with embedded widgets, identified by IDP tokens.
  - name: Organization Skills
    description: CRUD for SKILL.md content following the Agent Skills spec.
  - name: Threads
    description: Conversation thread metadata and management.
  - name: Usage Analytics
    description: Usage and token analytics for the organization.
  - name: Plan Tiers
    description: Plan tiers and limit definitions.
  - name: Subscriptions
    description: Billing and subscription status via Polar integration.
  - name: OAuth
    description: OAuth 2.0 authorization flow endpoints for MCP client authentication.
  - name: OAuth Discovery
    description: RFC 8414/8707 well-known discovery endpoints for OAuth 2.0.
paths:
  /subscriptions:
    get:
      tags:
        - Subscriptions
      summary: Get subscription
      description: >-
        Retrieve the current organization's subscription details including
        status, plan, and billing period. Returns null if the organization has
        no subscription.
      operationId: subscriptions_get
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      id:
                        type: string
                        description: Internal subscription record ID.
                      organization_id:
                        type: string
                        description: WorkOS organization ID that owns the subscription.
                      polar_subscription_id:
                        anyOf:
                          - type: string
                            description: Polar subscription ID for this subscription.
                          - type: 'null'
                      polar_customer_id:
                        anyOf:
                          - type: string
                            description: >-
                              Polar customer ID associated with the
                              organization.
                          - type: 'null'
                      status:
                        type: string
                        description: >-
                          Current subscription status (active, canceled,
                          past_due, etc.).
                      plan_id:
                        anyOf:
                          - type: string
                            description: Polar product ID for the subscribed plan.
                          - type: 'null'
                      plan_tier_id:
                        anyOf:
                          - type: string
                            description: Internal plan tier ID mapped to the subscription.
                          - type: 'null'
                      seats_purchased:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: Total number of seats purchased in the subscription.
                      seats_used:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: Current number of seats in use by the organization.
                      current_period_start:
                        anyOf:
                          - type: string
                            format: date-time
                            x-native-type: date
                            description: Start timestamp of the current billing period.
                          - type: 'null'
                      current_period_end:
                        anyOf:
                          - type: string
                            format: date-time
                            x-native-type: date
                            description: End timestamp of the current billing period.
                          - type: 'null'
                      cancel_at:
                        anyOf:
                          - type: string
                            format: date-time
                            x-native-type: date
                            description: Scheduled cancellation timestamp, if set.
                          - type: 'null'
                      created_at:
                        type: string
                        format: date-time
                        x-native-type: date
                        description: Timestamp when the subscription record was created.
                      updated_at:
                        type: string
                        format: date-time
                        x-native-type: date
                        description: >-
                          Timestamp when the subscription record was last
                          updated.
                    required:
                      - id
                      - organization_id
                      - polar_subscription_id
                      - polar_customer_id
                      - status
                      - plan_id
                      - plan_tier_id
                      - seats_purchased
                      - seats_used
                      - current_period_start
                      - current_period_end
                      - cancel_at
                      - created_at
                      - updated_at
                    description: >-
                      Subscription resource representing an organization's
                      billing plan. Managed through Polar integration with
                      statuses like active, canceled, past_due.
                  - type: 'null'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: UNAUTHORIZED
                      status:
                        const: 401
                      message:
                        type: string
                        default: Authentication required
                      data:
                        type: object
                        properties:
                          code:
                            const: AUTH_REQUIRED
                        required:
                          - code
                        examples:
                          - code: AUTH_REQUIRED
                    required:
                      - defined
                      - code
                      - status
                      - message
                      - data
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '403':
          description: '403'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: FORBIDDEN
                      status:
                        const: 403
                      message:
                        type: string
                        default: Access denied
                      data:
                        type: object
                        properties:
                          code:
                            const: ACCESS_DENIED
                          reason:
                            type: string
                        required:
                          - code
                        examples:
                          - code: ACCESS_DENIED
                            reason: Insufficient permissions
                    required:
                      - defined
                      - code
                      - status
                      - message
                      - data
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: ORG_CONTEXT_REQUIRED
                      status:
                        const: 403
                      message:
                        type: string
                        default: Organization context required
                      data:
                        type: object
                        properties:
                          code:
                            const: ORG_CONTEXT_REQUIRED
                        required:
                          - code
                        examples:
                          - code: ORG_CONTEXT_REQUIRED
                    required:
                      - defined
                      - code
                      - status
                      - message
                      - data
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '404':
          description: '404'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: NOT_FOUND
                      status:
                        const: 404
                      message:
                        type: string
                        default: Resource not found
                      data:
                        type: object
                        properties:
                          code:
                            const: RESOURCE_NOT_FOUND
                          resource:
                            type: string
                          resourceId:
                            type: string
                        required:
                          - code
                        examples:
                          - code: RESOURCE_NOT_FOUND
                            resource: site
                            resourceId: site_123
                    required:
                      - defined
                      - code
                      - status
                      - message
                      - data
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '500':
          description: '500'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: INTERNAL_SERVER_ERROR
                      status:
                        const: 500
                      message:
                        type: string
                        default: An internal error occurred
                      data:
                        type: object
                        properties:
                          code:
                            const: INTERNAL_ERROR
                        required:
                          - code
                        examples:
                          - code: INTERNAL_ERROR
                    required:
                      - defined
                      - code
                      - status
                      - message
                      - data
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        WorkOS JWT token. Obtain via WorkOS AuthKit authentication flow. The
        token must include organization_id claim for organization-scoped
        endpoints.

````