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

# Policy Status

> Required permissions: `policies.read` and `usage.read`.



## OpenAPI

````yaml /lib/api-spec/openapi.yaml get /api/v1/organizations/{org_id}/workspaces/{workspace_ref}/policies/{policy_id}/status
openapi: 3.1.0
info:
  title: airmux Control Plane API
  description: >
    Manage airmux organizations, workspaces, management keys, provider
    credentials, and data-plane synchronization.


    Organization and workspace targets are part of each URL. Successful
    responses wrap their result in

    `{"data": ...}`. Authenticate with a control-plane management key or a
    browser session as documented by

    each operation. Inference keys authenticate model requests at the data plane
    and are not accepted here.
  version: 0.1.0
servers: []
security: []
tags:
  - name: Auth
    description: Sign in human users, manage browser sessions, and authorize the CLI
    x-displayName: Authentication
  - name: Enrollment
    description: List a user's organizations and create their personal organization
  - name: Instance Organizations
    description: List and create organizations on this airmux instance
    x-displayName: Organizations
  - name: Instance Users
    description: Manage human users and service accounts across the instance
    x-displayName: Users
  - name: Instance Management Keys
    description: >-
      List management keys across the instance, issue instance-scoped
      credentials, and revoke keys
    x-displayName: Management Keys
  - name: Instance Model Catalog
    description: Manage the providers and models available through this airmux instance
    x-displayName: Model Catalog
  - name: Instance Provider Credentials
    description: Manage provider API keys available across the airmux instance
    x-displayName: Provider Credentials
  - name: Data Plane Instances
    description: Inspect connected data-plane instances
    x-displayName: Data Planes
  - name: Instance Activity
    description: Inspect recent audited changes across the instance
    x-displayName: Activity
  - name: OSS
    description: Bootstrap a new self-hosted airmux deployment
    x-displayName: Self-hosting
  - name: Organization Settings
    description: View, update, and delete one organization
    x-displayName: Settings
  - name: Organization Members
    description: Manage organization membership and organization roles
    x-displayName: Members
  - name: Organization Service Accounts
    description: >-
      Create and delete organization-managed machine principals and their
      initial management credentials
    x-displayName: Service Accounts
  - name: Organization Invitations
    description: Invite human users to an organization and optionally one workspace
    x-displayName: Invitations
  - name: Organization Workspaces
    description: List and create workspaces within an organization
    x-displayName: Workspaces
  - name: Organization Management Keys
    description: >-
      List management keys within an organization, issue organization-scoped
      credentials, and revoke keys
    x-displayName: Management Keys
  - name: Organization Provider Credentials
    description: Manage provider API keys available across an organization
    x-displayName: Provider Credentials
  - name: Organization Usage Events
    description: Inspect usage events across an organization
    x-displayName: Usage Events
  - name: Organization Reports
    description: Explore usage and requests across an organization or one workspace
    x-displayName: Reports
  - name: Organization Activity
    description: Inspect recent audited changes in an organization
    x-displayName: Activity
  - name: Organization Model Catalog
    description: Inspect the provider and model catalog available to an organization
    x-displayName: Model Catalog
  - name: Workspace Settings
    description: View, update, and delete one workspace
    x-displayName: Settings
  - name: Workspace Policies
    description: Manage workspace inference restrictions and fallbacks
    x-displayName: Policies
  - name: Workspace Members
    description: Manage workspace membership and workspace roles
    x-displayName: Members
  - name: Workspace Management Keys
    description: List and issue management keys scoped to a workspace and revoke keys
    x-displayName: Management Keys
  - name: Workspace Playground
    description: Create and end short-lived browser sessions for playground model requests
    x-displayName: Playground
  - name: Workspace Inference Keys
    description: Issue and revoke credentials for model requests to a workspace
    x-displayName: Inference Keys
  - name: Workspace Provider Credentials
    description: Manage provider API keys available to one workspace
    x-displayName: Provider Credentials
  - name: Workspace Usage Events
    description: Inspect usage events for one workspace
    x-displayName: Usage Events
  - name: Workspace Model Catalog
    description: Inspect the provider and model catalog available to a workspace
    x-displayName: Model Catalog
  - name: Data Plane API
    description: Poll bundles, ingest usage events, and record data-plane heartbeats
    x-displayName: Synchronization
paths:
  /api/v1/organizations/{org_id}/workspaces/{workspace_ref}/policies/{policy_id}/status:
    get:
      tags:
        - Workspace Policies
      summary: Policy Status
      description: 'Required permissions: `policies.read` and `usage.read`.'
      operationId: policy_status
      parameters:
        - name: policy_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Policy Id
          description: Policy id
        - name: workspace_ref
          in: path
          required: true
          schema:
            type: string
            title: Workspace Ref
          description: Workspace ID or slug
        - name: org_id
          in: path
          required: true
          schema:
            type: string
            title: Org Id
          description: Organization ID or slug
        - name: rule_index
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 0
                exclusiveMaximum: 100
              - type: 'null'
            title: Rule Index
          description: Rule index
        - name: bucket_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 255
                minLength: 1
              - type: 'null'
            title: Bucket Id
          description: Bucket id
        - name: after_bucket
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 255
                minLength: 1
              - type: 'null'
            title: After Bucket
          description: After bucket
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 100
            title: Limit
          description: Maximum number of results to return
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope_PolicyBudgetStatus_'
        '401':
          description: Authentication failed
        '403':
          description: The credential does not have the required permission
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ManagementKey: []
        - SessionCookie: []
components:
  schemas:
    Envelope_PolicyBudgetStatus_:
      properties:
        data:
          $ref: '#/components/schemas/PolicyBudgetStatus'
      type: object
      required:
        - data
      title: Envelope[PolicyBudgetStatus]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PolicyBudgetStatus:
      properties:
        policy:
          $ref: '#/components/schemas/PolicyOut'
        computed_at:
          type: string
          format: date-time
          title: Computed At
        budgets:
          items:
            $ref: '#/components/schemas/BudgetRuleStatus'
          type: array
          title: Budgets
      type: object
      required:
        - policy
        - computed_at
        - budgets
      title: PolicyBudgetStatus
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PolicyOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        org_id:
          type: string
          format: uuid
          title: Org Id
        workspace_id:
          type: string
          format: uuid
          title: Workspace Id
        name:
          type: string
          title: Name
        enabled:
          type: boolean
          title: Enabled
        definition:
          $ref: '#/components/schemas/PolicyDefinition-Output'
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - org_id
        - workspace_id
        - name
        - enabled
        - definition
        - created_at
        - updated_at
      title: PolicyOut
    BudgetRuleStatus:
      properties:
        rule_index:
          type: integer
          exclusiveMaximum: 100
          minimum: 0
          title: Rule Index
        aggregation:
          type: string
          enum:
            - shared
            - per_key
          title: Aggregation
        amount_usd:
          type: string
          pattern: ^\d+(?:\.\d+)?$
          title: Amount Usd
        period:
          type: string
          enum:
            - day
            - month
          title: Period
        window_start:
          type: string
          format: date-time
          title: Window Start
        window_end:
          type: string
          format: date-time
          title: Window End
        buckets:
          items:
            $ref: '#/components/schemas/BudgetBucketStatus'
          type: array
          title: Buckets
        next_bucket:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/SharedBudgetBucket'
                - $ref: '#/components/schemas/KeyBudgetBucket'
              discriminator:
                propertyName: kind
                mapping:
                  key:
                    $ref: '#/components/schemas/KeyBudgetBucket'
                  shared:
                    $ref: '#/components/schemas/SharedBudgetBucket'
            - type: 'null'
          title: Next Bucket
      type: object
      required:
        - rule_index
        - aggregation
        - amount_usd
        - period
        - window_start
        - window_end
        - buckets
        - next_bucket
      title: BudgetRuleStatus
    PolicyDefinition-Output:
      properties:
        target:
          oneOf:
            - $ref: '#/components/schemas/WorkspaceTarget'
            - $ref: '#/components/schemas/SelectedUsers'
            - $ref: '#/components/schemas/SelectedKeys'
          title: Target
          discriminator:
            propertyName: kind
            mapping:
              selected_keys:
                $ref: '#/components/schemas/SelectedKeys'
              selected_users:
                $ref: '#/components/schemas/SelectedUsers'
              workspace:
                $ref: '#/components/schemas/WorkspaceTarget'
        rules:
          items:
            $ref: '#/components/schemas/RuleDefinition-Output'
          type: array
          maxItems: 100
          minItems: 1
          title: Rules
          description: >-
            Unordered inline rule definitions; a policy may contain at most one
            fallback rule
      additionalProperties: false
      type: object
      required:
        - target
        - rules
      title: PolicyDefinition
    BudgetBucketStatus:
      properties:
        bucket:
          oneOf:
            - $ref: '#/components/schemas/SharedBudgetBucket'
            - $ref: '#/components/schemas/KeyBudgetBucket'
          title: Bucket
          discriminator:
            propertyName: kind
            mapping:
              key:
                $ref: '#/components/schemas/KeyBudgetBucket'
              shared:
                $ref: '#/components/schemas/SharedBudgetBucket'
        spent_usd:
          type: string
          pattern: ^\d+(?:\.\d+)?$
          title: Spent Usd
        remaining_usd:
          type: string
          pattern: ^\d+(?:\.\d+)?$
          title: Remaining Usd
        exhausted:
          type: boolean
          title: Exhausted
      type: object
      required:
        - bucket
        - spent_usd
        - remaining_usd
        - exhausted
      title: BudgetBucketStatus
    SharedBudgetBucket:
      properties:
        kind:
          type: string
          const: shared
          title: Kind
          default: shared
      additionalProperties: false
      type: object
      required:
        - kind
      title: SharedBudgetBucket
    KeyBudgetBucket:
      properties:
        kind:
          type: string
          const: key
          title: Kind
          default: key
        key_id:
          type: string
          maxLength: 255
          minLength: 1
          title: Key Id
      additionalProperties: false
      type: object
      required:
        - kind
        - key_id
      title: KeyBudgetBucket
    WorkspaceTarget:
      properties:
        kind:
          type: string
          const: workspace
          title: Kind
      additionalProperties: false
      type: object
      required:
        - kind
      title: WorkspaceTarget
    SelectedUsers:
      properties:
        kind:
          type: string
          const: selected_users
          title: Kind
        user_ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 1000
          minItems: 1
          title: User Ids
      additionalProperties: false
      type: object
      required:
        - kind
        - user_ids
      title: SelectedUsers
    SelectedKeys:
      properties:
        kind:
          type: string
          const: selected_keys
          title: Kind
        key_ids:
          items:
            type: string
            maxLength: 255
            minLength: 1
          type: array
          maxItems: 1000
          minItems: 1
          title: Key Ids
      additionalProperties: false
      type: object
      required:
        - kind
        - key_ids
      title: SelectedKeys
    RuleDefinition-Output:
      properties:
        match:
          oneOf:
            - $ref: '#/components/schemas/AllRequests'
            - $ref: '#/components/schemas/RequestMatch-Output'
          title: Match
          discriminator:
            propertyName: kind
            mapping:
              all_requests:
                $ref: '#/components/schemas/AllRequests'
              request:
                $ref: '#/components/schemas/RequestMatch-Output'
        action:
          oneOf:
            - $ref: '#/components/schemas/AllowedModels'
            - $ref: '#/components/schemas/AllowedProviders'
            - $ref: '#/components/schemas/DenyRequest'
            - $ref: '#/components/schemas/StrictParameters'
            - $ref: '#/components/schemas/PriceLimit'
            - $ref: '#/components/schemas/RequestLimits'
            - $ref: '#/components/schemas/CredentialAccess'
            - $ref: '#/components/schemas/Fallback'
            - $ref: '#/components/schemas/Budget'
          title: Action
          discriminator:
            propertyName: kind
            mapping:
              budget:
                $ref: '#/components/schemas/Budget'
              credential_access:
                $ref: '#/components/schemas/CredentialAccess'
              deny:
                $ref: '#/components/schemas/DenyRequest'
              fallback:
                $ref: '#/components/schemas/Fallback'
              models:
                $ref: '#/components/schemas/AllowedModels'
              price_limit:
                $ref: '#/components/schemas/PriceLimit'
              providers:
                $ref: '#/components/schemas/AllowedProviders'
              request_limits:
                $ref: '#/components/schemas/RequestLimits'
              strict_parameters:
                $ref: '#/components/schemas/StrictParameters'
      additionalProperties: false
      type: object
      required:
        - match
        - action
      title: RuleDefinition
    AllRequests:
      properties:
        kind:
          type: string
          const: all_requests
          title: Kind
      additionalProperties: false
      type: object
      required:
        - kind
      title: AllRequests
    RequestMatch-Output:
      properties:
        kind:
          type: string
          const: request
          title: Kind
        models:
          items:
            type: string
            maxLength: 255
            minLength: 1
          type: array
          maxItems: 1000
          title: Models
          default: []
        stream:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Stream
        capabilities:
          items:
            type: string
            enum:
              - tools
              - reasoning
              - structured_output
          type: array
          maxItems: 3
          title: Capabilities
          default: []
      additionalProperties: false
      type: object
      required:
        - kind
        - models
        - stream
        - capabilities
      title: RequestMatch
    AllowedModels:
      properties:
        kind:
          type: string
          const: models
          title: Kind
        names:
          items:
            type: string
            maxLength: 255
            minLength: 1
          type: array
          maxItems: 1000
          minItems: 1
          title: Names
      additionalProperties: false
      type: object
      required:
        - kind
        - names
      title: AllowedModels
    AllowedProviders:
      properties:
        kind:
          type: string
          const: providers
          title: Kind
        names:
          items:
            type: string
            maxLength: 255
            minLength: 1
          type: array
          maxItems: 1000
          minItems: 1
          title: Names
      additionalProperties: false
      type: object
      required:
        - kind
        - names
      title: AllowedProviders
    DenyRequest:
      properties:
        kind:
          type: string
          const: deny
          title: Kind
        message:
          type: string
          maxLength: 200
          minLength: 1
          title: Message
      additionalProperties: false
      type: object
      required:
        - kind
        - message
      title: DenyRequest
    StrictParameters:
      properties:
        kind:
          type: string
          const: strict_parameters
          title: Kind
      additionalProperties: false
      type: object
      required:
        - kind
      title: StrictParameters
    PriceLimit:
      properties:
        kind:
          type: string
          const: price_limit
          title: Kind
        max_input_price_per_mtok:
          type: string
          pattern: ^\d+(?:\.\d+)?$
          title: Max Input Price Per Mtok
        max_output_price_per_mtok:
          type: string
          pattern: ^\d+(?:\.\d+)?$
          title: Max Output Price Per Mtok
      additionalProperties: false
      type: object
      required:
        - kind
        - max_input_price_per_mtok
        - max_output_price_per_mtok
      title: PriceLimit
    RequestLimits:
      properties:
        kind:
          type: string
          const: request_limits
          title: Kind
        max_output_tokens:
          type: integer
          minimum: 1
          title: Max Output Tokens
      additionalProperties: false
      type: object
      required:
        - kind
        - max_output_tokens
      title: RequestLimits
    CredentialAccess:
      properties:
        kind:
          type: string
          const: credential_access
          title: Kind
        scopes:
          items:
            type: string
            enum:
              - platform
              - org
              - workspace
          type: array
          maxItems: 3
          minItems: 1
          title: Scopes
      additionalProperties: false
      type: object
      required:
        - kind
        - scopes
      title: CredentialAccess
    Fallback:
      properties:
        kind:
          type: string
          const: fallback
          title: Kind
        models:
          items:
            type: string
            maxLength: 255
            minLength: 1
          type: array
          maxItems: 4
          minItems: 1
          title: Models
        'on':
          items:
            type: string
            enum:
              - rate_limited
              - upstream_unavailable
              - timeout
          type: array
          maxItems: 3
          minItems: 1
          title: 'On'
        max_attempts:
          type: integer
          maximum: 5
          minimum: 2
          title: Max Attempts
        timeout_ms:
          type: integer
          maximum: 120000
          minimum: 100
          title: Timeout Ms
      additionalProperties: false
      type: object
      required:
        - kind
        - models
        - 'on'
        - max_attempts
        - timeout_ms
      title: Fallback
    Budget:
      properties:
        kind:
          type: string
          const: budget
          title: Kind
        amount_usd:
          type: string
          pattern: ^\d+(?:\.\d+)?$
          title: Amount Usd
        period:
          type: string
          enum:
            - day
            - month
          title: Period
        aggregation:
          type: string
          enum:
            - shared
            - per_key
          title: Aggregation
      additionalProperties: false
      type: object
      required:
        - kind
        - amount_usd
        - period
        - aggregation
      title: Budget
  securitySchemes:
    ManagementKey:
      type: http
      description: >-
        A control-plane management key using the `sk-cp-` prefix. Inference keys
        are not accepted by control-plane endpoints.
      scheme: bearer
    SessionCookie:
      type: apiKey
      in: cookie
      name: airmux_session
      description: >-
        Browser session cookie returned by login or signup. Browser requests
        must also send `X-Requested-With`.

````