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

# Billing State



## OpenAPI

````yaml /openapi.json get /v1/workspaces/{workspace_id}/billing
openapi: 3.1.0
info:
  description: Versioned API for hosted Almanac wikis.
  title: Almanac V1 API
  version: 0.5.0
servers:
  - url: https://api.usealmanac.com
security:
  - bearerAuth: []
tags:
  - description: Session, onboarding, overview, and email preferences.
    name: Account
  - description: Workspace discovery and details.
    name: Workspaces
  - description: Wiki creation, listing, and details.
    name: Wikis
  - description: Wiki pages, search, topics, and provenance.
    name: Pages
  - description: Source records, trees, search, and original files.
    name: Sources
  - description: Source uploads and upload records.
    name: Uploads
  - description: Ingest and Garden jobs, events, and outcomes.
    name: Jobs
  - description: Workspace-scoped developer keys.
    name: API keys
  - description: Workspace membership and invitations.
    name: Members
  - description: Workspace plans, usage, and billing portal.
    name: Billing
paths:
  /v1/workspaces/{workspace_id}/billing:
    get:
      tags:
        - Billing
      summary: Billing State
      operationId: billing_state_v1_workspaces__workspace_id__billing_get
      parameters:
        - in: path
          name: workspace_id
          required: true
          schema:
            title: Workspace Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HostedBillingState'
          description: Successful Response
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  request_id:
                    type: string
                required:
                  - error
                  - message
                  - request_id
                type: object
          description: Invalid request
components:
  schemas:
    HostedBillingState:
      additionalProperties: false
      properties:
        manage:
          $ref: '#/components/schemas/HostedBillingManage'
        plans:
          items:
            $ref: '#/components/schemas/HostedBillingPlan'
          title: Plans
          type: array
        usage:
          items:
            $ref: '#/components/schemas/HostedBillingUsage'
          title: Usage
          type: array
        workspace_id:
          title: Workspace Id
          type: string
      required:
        - workspace_id
        - manage
        - plans
      title: HostedBillingState
      type: object
    HostedBillingManage:
      additionalProperties: false
      properties:
        allowed:
          title: Allowed
          type: boolean
        reason:
          $ref: '#/components/schemas/HostedBillingManageReason'
      required:
        - allowed
        - reason
      title: HostedBillingManage
      type: object
    HostedBillingPlan:
      additionalProperties: false
      properties:
        action:
          anyOf:
            - $ref: '#/components/schemas/HostedPlanAction'
            - type: 'null'
        features:
          items:
            $ref: '#/components/schemas/HostedPlanFeature'
          title: Features
          type: array
        group:
          anyOf:
            - type: string
            - type: 'null'
          title: Group
        interval:
          anyOf:
            - type: string
            - type: 'null'
          title: Interval
        name:
          title: Name
          type: string
        plan_id:
          title: Plan Id
          type: string
        price:
          anyOf:
            - type: number
            - type: 'null'
          title: Price
        status:
          anyOf:
            - $ref: '#/components/schemas/HostedPlanStatus'
            - type: 'null'
      required:
        - plan_id
        - name
      title: HostedBillingPlan
      type: object
    HostedBillingUsage:
      additionalProperties: false
      properties:
        feature_id:
          title: Feature Id
          type: string
        granted:
          title: Granted
          type: number
        next_reset_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Next Reset At
        overage_allowed:
          default: false
          title: Overage Allowed
          type: boolean
        remaining:
          title: Remaining
          type: number
        unlimited:
          default: false
          title: Unlimited
          type: boolean
        usage:
          title: Usage
          type: number
      required:
        - feature_id
        - granted
        - remaining
        - usage
      title: HostedBillingUsage
      type: object
    HostedBillingManageReason:
      enum:
        - permission
        - not_allowed
      title: HostedBillingManageReason
      type: string
    HostedPlanAction:
      enum:
        - activate
        - upgrade
        - downgrade
        - purchase
        - none
      title: HostedPlanAction
      type: string
    HostedPlanFeature:
      additionalProperties: false
      properties:
        feature_id:
          title: Feature Id
          type: string
        included:
          anyOf:
            - type: number
            - type: 'null'
          title: Included
      required:
        - feature_id
      title: HostedPlanFeature
      type: object
    HostedPlanStatus:
      enum:
        - active
        - scheduled
      title: HostedPlanStatus
      type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: Almanac access token or API key
      scheme: bearer
      type: http

````