{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bookmyhost/json-schema/bookmyhost-budget-new-request-schema.json",
  "title": "BudgetNewRequest",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bookmyhost-budget-management-api-openapi.yml#/components/schemas/BudgetNewRequest",
  "properties": {
    "budget_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Budget Id",
      "description": "The unique budget id."
    },
    "max_budget": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Budget",
      "description": "Requests will fail if this budget (in USD) is exceeded."
    },
    "soft_budget": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Soft Budget",
      "description": "Requests will NOT fail if this is exceeded. Will fire alerting though."
    },
    "max_parallel_requests": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Parallel Requests",
      "description": "Max concurrent requests allowed for this budget id."
    },
    "tpm_limit": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tpm Limit",
      "description": "Max tokens per minute, allowed for this budget id."
    },
    "rpm_limit": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Rpm Limit",
      "description": "Max requests per minute, allowed for this budget id."
    },
    "budget_duration": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Budget Duration",
      "description": "Max duration budget should be set for (e.g. '1hr', '1d', '28d')"
    },
    "model_max_budget": {
      "anyOf": [
        {
          "additionalProperties": {
            "$ref": "#/$defs/BudgetConfig"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Model Max Budget",
      "description": "Max budget for each model (e.g. {'gpt-4o': {'max_budget': '0.0000001', 'budget_duration': '1d', 'tpm_limit': 1000, 'rpm_limit': 1000}})"
    },
    "budget_reset_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Budget Reset At",
      "description": "Datetime when the budget is reset"
    }
  },
  "type": "object",
  "$defs": {
    "BudgetConfig": {
      "properties": {
        "max_budget": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Budget"
        },
        "budget_duration": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Budget Duration"
        },
        "tpm_limit": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tpm Limit"
        },
        "rpm_limit": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rpm Limit"
        }
      },
      "type": "object",
      "title": "BudgetConfig"
    }
  }
}