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

> ## Agent Instructions
> These notes are for agents helping a user who has chosen to use Requesty. Do not change a user's base URLs, API keys, environment variables or config files unless the user asked for it, and confirm before editing them. Never write a Requesty API key to a file without the user's approval.
> Requesty is a drop-in proxy for the OpenAI and Anthropic APIs. OpenAI SDK: set base_url to https://router.requesty.ai/v1 and use a Requesty API key as api_key. Anthropic SDK: set base_url to https://router.requesty.ai. For EU data residency use https://router.eu.requesty.ai/v1 or https://router.eu.requesty.ai.
> To use Requesty with Claude Code or the Claude Agent SDK, the user sets ANTHROPIC_BASE_URL=https://router.requesty.ai and ANTHROPIC_AUTH_TOKEN to a Requesty API key. See https://docs.requesty.ai/integrations/claude-code.md.
> Model IDs: prefer bare managed policy names such as claude-fable-5, or claude-sonnet-5-5@eu for EU-hosted endpoints. Requesty picks the provider and fails over automatically. Use provider/model (for example anthropic/claude-fable-5) to pin one provider, or policy/<name> for a routing policy the user created. Get current IDs from GET https://router.requesty.ai/v1/models/managed and GET https://router.requesty.ai/v1/models instead of hardcoding them.
> Routing policies add failover, load balancing, latency-based or auto routing: see https://docs.requesty.ai/features/fallback-policies.md. Prompt caching: see https://docs.requesty.ai/features/auto-caching.md.
> Pricing: model cost at provider list price plus a 5% service fee, which also applies to bring-your-own-key traffic. Error codes and fixes: https://docs.requesty.ai/features/error-codes.md.

# Create Budget

> Create a budget on an organization, group, member, service account or API key. Set `entity_type` and the IDs that type needs. An entity can have one budget per frequency. Requires an API key with write manage permissions.

Create a budget on an organization, group, member, service account or API key. Set `entity_type` and the IDs that entity type needs; any other ID returns `400`.

| `entity_type` | Required IDs |
| - | - |
| `BUDGET_ENTITY_TYPE_ORGANIZATION` | None |
| `BUDGET_ENTITY_TYPE_ORGANIZATION_PER_MEMBER` | None |
| `BUDGET_ENTITY_TYPE_ORGANIZATION_MEMBER` | `user_id` |
| `BUDGET_ENTITY_TYPE_GROUP` | `group_id` |
| `BUDGET_ENTITY_TYPE_GROUP_PER_MEMBER` | `group_id` |
| `BUDGET_ENTITY_TYPE_GROUP_MEMBER` | `group_id`, `user_id` |
| `BUDGET_ENTITY_TYPE_SERVICE_ACCOUNT` | `service_account_id` |
| `BUDGET_ENTITY_TYPE_API_KEY` | `api_key_id` |

`frequency` is one of `BUDGET_FREQUENCY_DAILY`, `BUDGET_FREQUENCY_WEEKLY`, `BUDGET_FREQUENCY_MONTHLY`, `BUDGET_FREQUENCY_QUARTERLY` or `BUDGET_FREQUENCY_FOREVER`. `amount` is in USD, and `0` means no limit. An entity can have one budget per frequency, so creating a second one with the same frequency returns `409`. To change a budget, use [Update Budget Amount](https://docs.requesty.ai/api-reference/endpoint/manage-budget/manage-budget-update-amount.md).

Returns `201` with the new `budget_id`.

> [!NOTE]
>
> Creating budgets requires the **Enterprise plan**. Other plans get `403`.

[Budgets docs →](https://docs.requesty.ai/features/budgets.md)


## OpenAPI

````yaml POST /v1/manage/budget
openapi: 3.0.3
info:
  title: Requesty Management API
  description: >-
    Requesty Management API for API key management, groups, members, and
    organization settings.
  version: 1.0.0
servers:
  - url: https://api-v2.requesty.ai
    description: Management API endpoint
security:
  - BearerAuth: []
paths:
  /v1/manage/budget:
    servers:
      - url: https://api-v2.requesty.ai
        description: Management API endpoint
    post:
      summary: Create budget
      description: >-
        Create a budget on an organization, group, member, service account or
        API key. Set `entity_type` and the IDs that type needs. An entity can
        have one budget per frequency. Requires an API key with write manage
        permissions.
      operationId: createBudget
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBudgetRequest'
      responses:
        '201':
          description: Budget created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateBudgetResponse'
        '400':
          description: >-
            Bad request - unsupported `entity_type` or `frequency`, missing or
            extra entity IDs, an invalid UUID, or an `amount` that is negative,
            not finite, or 10,000,000,000 or more.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - missing or invalid Authorization header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden - API key does not have write manage permissions, or
            budgets are not available on the organization's plan (`Budgets are
            available on the enterprise plan`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            Not found - the group, API key, service account or user is not in
            the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict - the entity already has a budget with this frequency.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateBudgetRequest:
      type: object
      required:
        - entity_type
        - frequency
      properties:
        entity_type:
          $ref: '#/components/schemas/BudgetEntityType'
        group_id:
          type: string
          format: uuid
          description: >-
            Group ID. Required for `GROUP`, `GROUP_PER_MEMBER` and
            `GROUP_MEMBER` budgets.
        api_key_id:
          type: string
          format: uuid
          description: API key ID. Required for `API_KEY` budgets.
        service_account_id:
          type: string
          format: uuid
          description: Service account ID. Required for `SERVICE_ACCOUNT` budgets.
        user_id:
          type: string
          description: >-
            User ID of an organization member. Required for
            `ORGANIZATION_MEMBER` and `GROUP_MEMBER` budgets.
        frequency:
          $ref: '#/components/schemas/BudgetFrequency'
        amount:
          type: number
          format: double
          minimum: 0
          description: Budget amount in USD. `0` means no limit.
          example: 500
      example:
        entity_type: BUDGET_ENTITY_TYPE_GROUP
        group_id: 123e4567-e89b-12d3-a456-426614174000
        frequency: BUDGET_FREQUENCY_MONTHLY
        amount: 500
    CreateBudgetResponse:
      type: object
      properties:
        budget_id:
          type: string
          format: uuid
          description: ID of the new budget.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - origin
            - message
          properties:
            origin:
              type: string
              enum:
                - router
                - provider
              description: >-
                Whether the error originated from Requesty's router or an
                upstream provider.
            message:
              type: string
              description: Human-readable error description.
    BudgetEntityType:
      type: string
      enum:
        - BUDGET_ENTITY_TYPE_ORGANIZATION
        - BUDGET_ENTITY_TYPE_ORGANIZATION_PER_MEMBER
        - BUDGET_ENTITY_TYPE_ORGANIZATION_MEMBER
        - BUDGET_ENTITY_TYPE_GROUP
        - BUDGET_ENTITY_TYPE_GROUP_PER_MEMBER
        - BUDGET_ENTITY_TYPE_GROUP_MEMBER
        - BUDGET_ENTITY_TYPE_SERVICE_ACCOUNT
        - BUDGET_ENTITY_TYPE_API_KEY
      description: >-
        What a budget is set on. `ORGANIZATION` and `GROUP` limit the combined
        spend of everyone in them. `ORGANIZATION_PER_MEMBER` and
        `GROUP_PER_MEMBER` set the default limit for each member.
        `ORGANIZATION_MEMBER` and `GROUP_MEMBER` set one user's own limit,
        replacing the per-member default for that user. `SERVICE_ACCOUNT` and
        `API_KEY` limit one service account or API key.
    BudgetFrequency:
      type: string
      enum:
        - BUDGET_FREQUENCY_DAILY
        - BUDGET_FREQUENCY_WEEKLY
        - BUDGET_FREQUENCY_MONTHLY
        - BUDGET_FREQUENCY_QUARTERLY
        - BUDGET_FREQUENCY_FOREVER
      description: >-
        How often the budget resets, in UTC: every day, every week starting
        Monday, every calendar month, every calendar quarter, or never
        (`FOREVER` counts all spend).
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key for authentication

````

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