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

# Estimate packs against a model

> How much of the model's window the packs may fill, what each always
loads, and which can't be used here.



## OpenAPI

````yaml post /api/registry/context/budget
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/registry/context/budget:
    post:
      tags:
        - Context packs
      summary: Estimate packs against a model
      description: |-
        How much of the model's window the packs may fill, what each always
        loads, and which can't be used here.
      operationId: budget_api_registry_context_budget_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BudgetEstimateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BudgetEstimate'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    BudgetEstimateRequest:
      properties:
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        packs:
          items:
            $ref: '#/components/schemas/PackAttachment'
          type: array
          maxItems: 20
          title: Packs
      type: object
      title: BudgetEstimateRequest
      description: Packs to estimate, against a model.
    BudgetEstimate:
      properties:
        model:
          type: string
          title: Model
        tokenizer:
          type: string
          title: Tokenizer
        approximate:
          type: boolean
          title: Approximate
        context_window:
          type: integer
          title: Context Window
        window_budget:
          type: integer
          title: Window Budget
        packs:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Packs
      type: object
      required:
        - model
        - tokenizer
        - approximate
        - context_window
        - window_budget
        - packs
      title: BudgetEstimate
      description: How much of a model's window some packs would take.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PackAttachment:
      properties:
        artifact_id:
          type: string
          format: uuid
          title: Artifact Id
        version:
          type: string
          title: Version
        token_budget:
          anyOf:
            - type: integer
              minimum: 100
            - type: 'null'
          title: Token Budget
          description: Lower the pack's own budget here. Never higher than the pack's.
      additionalProperties: false
      type: object
      required:
        - artifact_id
        - version
      title: PackAttachment
      description: >-
        A pinned pack on an agent, a crew or a chat, with an optional lower
        budget.
    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
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

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