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

# Create Model Policy

> Create a rule restricting which LLM providers or models the organization can use.



## OpenAPI

````yaml POST /orgs/{org_id}/models/policies
openapi: 3.1.0
info:
  title: Timbal Platform API
  description: Public API documentation for the Timbal platform
  license:
    name: ''
  version: 2.0.0
servers:
  - url: https://api.timbal.ai
    description: Production
  - url: https://api.dev.timbal.ai
    description: Development
security: []
tags:
  - name: ace
    description: Action Control Engine (ACE) operations
  - name: analytics
    description: Org and project analytics
  - name: billing
    description: Subscriptions, usage, and payment-related operations
  - name: content
    description: Re-sign stored content URLs
  - name: files
    description: File operations
  - name: iam
    description: IAM — actions, roles, users, and authorization introspection
  - name: k2
    description: Knowledge Bases v2 operations
  - name: orgs
    description: Organization operations
  - name: projects
    description: Project operations
  - name: runs
    description: Execution operations
  - name: templates
    description: Public project template catalog
  - name: users
    description: Authenticated user profile
paths:
  /orgs/{org_id}/models/policies:
    post:
      tags:
        - orgs
      summary: Create a model policy
      description: >-
        Create a rule restricting which LLM providers or models the organization
        can use.
      operationId: create_org_model_policy
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateModelPolicyBody'
            examples:
              Disable a provider:
                value:
                  provider: byteplus
              Disable one model:
                value:
                  provider: openai
                  model_id: gpt-5
                  effect: deny
              Re-allow one model of a disabled provider:
                value:
                  provider: byteplus
                  model_id: seed-2-0-pro-260215
                  effect: allow
        required: true
      responses:
        '201':
          description: Policy rule created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelPolicy'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '409':
          description: Rule already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearer_auth: []
components:
  schemas:
    CreateModelPolicyBody:
      type: object
      description: Request body for `POST /orgs/{org_id}/models/policies`.
      required:
        - provider
      properties:
        effect:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ModelPolicyEffect'
              description: Rule effect. Defaults to `deny`.
        model_id:
          type:
            - string
            - 'null'
          description: Model to target. Omit to target every model of the provider.
        provider:
          type: string
          description: Model provider slug, e.g. `byteplus`, `openai`.
    ModelPolicy:
      type: object
      description: An organization policy rule restricting LLM provider or model usage.
      required:
        - id
        - provider
        - effect
        - created_at
      properties:
        created_at:
          type: string
          format: date-time
        created_by_user_id:
          type:
            - string
            - 'null'
          description: User who created the rule.
        effect:
          $ref: '#/components/schemas/ModelPolicyEffect'
        id:
          type: string
        model_id:
          type:
            - string
            - 'null'
          description: |-
            Model targeted by the rule. Omitted when the rule covers the whole
            provider.
        provider:
          type: string
          description: Model provider slug, e.g. `byteplus`, `openai`.
    ErrorMessage:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Machine-readable error code (e.g. `ALREADY_EXISTS`, `BAD_REQUEST`).
        message:
          type: string
          description: Human-readable description.
    ModelPolicyEffect:
      type: string
      description: >-
        Whether a policy rule allows or denies its target. A model-level rule

        beats a provider-level rule; `deny` beats `allow` at the same
        specificity.
      enum:
        - allow
        - deny
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: >-
        Timbal API key. Obtain your API key from the Timbal platform settings.
        See [Authentication](/api-reference/authentication) for more
        information.

````