openapi: 3.2.0 info: title: LiteLLM key management API description: "Enterprise Edition \n\nProxy Server to call 100+ LLMs in the OpenAI format. [**Customize Swagger Docs**](https://docs.litellm.ai/docs/proxy/enterprise#swagger-docs---custom-routes--branding)\n\n\U0001F449 [```LiteLLM Admin Panel on /ui```](/ui). Create, Edit Keys with SSO. Having issues? Try [```Fallback Login```](/fallback/login)\n\n\U0001F4B8 [```LiteLLM Model Cost Map```](https://models.litellm.ai/).\n\n\U0001F50E [```LiteLLM Model Hub```](/ui/model_hub_table). See available models on the proxy. [**Docs**](https://docs.litellm.ai/docs/proxy/ai_hub)" version: 1.95.0 x-operator: institution x-provenance: method: probed source: https://llmproxy.uva.nl/openapi.json retrieved: '2026-08-19' note: Document is generated by the LiteLLM proxy software the University of Amsterdam self-hosts; the deployment, the key issuance and the host (llmproxy.uva.nl, UvA Azure) are the institution's. servers[] added by API Evangelist because the served document omits it; nothing else altered. servers: - url: https://llmproxy.uva.nl description: University of Amsterdam / Amsterdam University of Applied Sciences shared AI gateway tags: - name: key management paths: /key/generate: post: tags: - key management summary: Generate Key Fn description: "Generate an API key based on the provided data.\n\nDocs: https://docs.litellm.ai/docs/proxy/virtual_keys\n\nParameters:\n- duration: Optional[str] - Specify the length of time the token is valid for. You can set duration as seconds (\"30s\"), minutes (\"30m\"), hours (\"30h\"), days (\"30d\").\n- key_alias: Optional[str] - User defined key alias\n- key: Optional[str] - User defined key value. Must start with 'sk-' and be at least 16 characters long. If not set, a 16-digit unique sk-key is created for you.\n- team_id: Optional[str] - The team id of the key\n- user_id: Optional[str] - The user id of the key\n- agent_id: Optional[str] - The agent id associated with the key.\n- organization_id: Optional[str] - The organization id of the key. If not set, and team_id is set, the organization id will be the same as the team id. If conflict, an error will be raised.\n- project_id: Optional[str] - The project id of the key. When set, models and max_budget are validated against the project's limits.\n- budget_id: Optional[str] - The budget id associated with the key. Created by calling `/budget/new`.\n- models: Optional[list] - Model_name's a user is allowed to call. (if empty, key is allowed to call all models)\n- aliases: Optional[dict] - Any alias mappings, on top of anything in the config.yaml model list. - https://docs.litellm.ai/docs/proxy/virtual_keys#managing-auth---upgradedowngrade-models\n- config: Optional[dict] - any key-specific configs, overrides config in config.yaml\n- spend: Optional[int] - Amount spent by key. Default is 0. Will be updated by proxy whenever key is used. https://docs.litellm.ai/docs/proxy/virtual_keys#managing-auth---tracking-spend\n- send_invite_email: Optional[bool] - Whether to send an invite email to the user_id, with the generate key\n- max_budget: Optional[float] - Specify max budget for a given key.\n- budget_duration: Optional[str] - Budget is reset at the end of specified duration. If not set, budget is never reset. You can set duration as seconds (\"30s\"), minutes (\"30m\"), hours (\"30h\"), days (\"30d\").\n- max_parallel_requests: Optional[int] - Rate limit a user based on the number of parallel requests. Raises 429 error, if user's parallel requests > x.\n- metadata: Optional[dict] - Metadata for key, store information for key. Example metadata = {\"team\": \"core-infra\", \"app\": \"app2\", \"email\": \"ishaan@berri.ai\" }\n- guardrails: Optional[List[str]] - List of active guardrails for the key\n- policies: Optional[List[str]] - List of policy names to apply to the key. Policies define guardrails, conditions, and inheritance rules.\n- disable_global_guardrails: Optional[bool] - Whether to disable global guardrails for the key.\n- throttle_on_budget_exceeded: Optional[bool] - When the key exceeds its max_budget, throttle its tpm/rpm to the global budget_exceeded_throttle_percentage instead of blocking the key entirely.\n- permissions: Optional[dict] - key-specific permissions. Currently just used for turning off pii masking (if connected). Example - {\"pii\": false}\n- model_max_budget: Optional[Dict[str, BudgetConfig]] - Model-specific budgets {\"gpt-4\": {\"budget_limit\": 0.0005, \"time_period\": \"30d\"}}}. IF null or {} then no model specific budget.\n- budget_fallbacks: Optional[Dict[str, List[str]]] - Per-model fallback chain tried in order when that model's own `model_max_budget` is exceeded, e.g. {\"gpt-4o\": [\"gpt-4o-mini\"]}.\n- model_rpm_limit: Optional[dict] - key-specific model rpm limit. Example - {\"text-davinci-002\": 1000, \"gpt-3.5-turbo\": 1000}. IF null or {} then no model specific rpm limit.\n- model_tpm_limit: Optional[dict] - key-specific model tpm limit. Example - {\"text-davinci-002\": 1000, \"gpt-3.5-turbo\": 1000}. IF null or {} then no model specific tpm limit.\n- mcp_rpm_limit: Optional[dict] - key-specific per-MCP-server rpm limit, keyed by MCP server name (alias if set, else the configured name). Example - {\"github\": 100, \"slack\": 200}. IF null or {} then no MCP-specific rpm limit.\n- tag_rpm_limit: Optional[dict] - key-specific per-request-tag rpm limit, keyed by request tag. Example - {\"cell-1\": 1000, \"cell-2\": 500}. Each tag gets an independent counter; requests whose tag is absent fall back to the key-level rpm limit.\n- tpm_limit_type: Optional[str] - Type of tpm limit. Options: \"best_effort_throughput\" (no error if we're overallocating tpm), \"guaranteed_throughput\" (raise an error if we're overallocating tpm), \"dynamic\" (dynamically exceed limit when no 429 errors). Defaults to \"best_effort_throughput\".\n- rpm_limit_type: Optional[str] - Type of rpm limit. Options: \"best_effort_throughput\" (no error if we're overallocating rpm), \"guaranteed_throughput\" (raise an error if we're overallocating rpm), \"dynamic\" (dynamically exceed limit when no 429 errors). Defaults to \"best_effort_throughput\".\n- allowed_cache_controls: Optional[list] - List of allowed cache control values. Example - [\"no-cache\", \"no-store\"]. See all values - https://docs.litellm.ai/docs/proxy/caching#turn-on--off-caching-per-request\n- blocked: Optional[bool] - Whether the key is blocked.\n- rpm_limit: Optional[int] - Specify rpm limit for a given key (Requests per minute)\n- tpm_limit: Optional[int] - Specify tpm limit for a given key (Tokens per minute)\n- soft_budget: Optional[float] - Specify soft budget for a given key. Will trigger a slack alert when this soft budget is reached.\n- tags: Optional[List[str]] - Tags for [tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags) and/or doing [tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing).\n- prompts: Optional[List[str]] - List of prompts that the key is allowed to use.\n- enforced_params: Optional[List[str]] - List of enforced params for the key (Enterprise only). [Docs](https://docs.litellm.ai/docs/proxy/enterprise#enforce-required-params-for-llm-requests)\n- prompts: Optional[List[str]] - List of prompts that the key is allowed to use.\n- allowed_routes: Optional[list] - List of allowed routes for the key. Store the actual route or store a wildcard pattern for a set of routes. Example - [\"/chat/completions\", \"/embeddings\", \"/keys/*\"]\n- allowed_passthrough_routes: Optional[list] - List of allowed pass through endpoints for the key. Store the actual endpoint or store a wildcard pattern for a set of endpoints. Example - [\"/my-custom-endpoint\"]. Use this instead of allowed_routes, if you just want to specify which pass through endpoints the key can access, without specifying the routes. If allowed_routes is specified, allowed_pass_through_endpoints is ignored.\n- object_permission: Optional[LiteLLM_ObjectPermissionBase] - key-specific object permission. Example - {\"vector_stores\": [\"vector_store_1\", \"vector_store_2\"], \"agents\": [\"agent_1\", \"agent_2\"], \"agent_access_groups\": [\"dev_group\"]}. IF null or {} then no object permission.\n- key_type: Optional[str] - Type of key that determines default allowed routes. Options: \"llm_api\" (can call LLM API routes), \"management\" (can call management routes), \"read_only\" (can only call info/read routes), \"default\" (uses default allowed routes). Defaults to \"default\".\n- prompts: Optional[List[str]] - List of allowed prompts for the key. If specified, the key will only be able to use these specific prompts.\n- auto_rotate: Optional[bool] - Whether this key should be automatically rotated (regenerated)\n- rotation_interval: Optional[str] - How often to auto-rotate this key (e.g., '30s', '30m', '30h', '30d'). Required if auto_rotate=True.\n- allowed_vector_store_indexes: Optional[List[dict]] - List of allowed vector store indexes for the key. Example - [{\"index_name\": \"my-index\", \"index_permissions\": [\"write\", \"read\"]}]. If specified, the key will only be able to use these specific vector store indexes. Create index, using `/v1/indexes` endpoint.\n- router_settings: Optional[UpdateRouterConfig] - key-specific router settings. Example - {\"model_group_retry_policy\": {\"gpt-4\": {\"RateLimitErrorRetries\": 5}}}. IF null or {} then no router settings.\n- access_group_ids: Optional[List[str]] - List of access group IDs to associate with the key. Access groups define which models a key can access. Example - [\"access_group_1\", \"access_group_2\"].\n- budget_limits: Optional[list] - List of concurrent budget windows for the key. Each window specifies a budget_limit, time_period, and optional budget_duration. Example - [{\"budget_limit\": 10.0, \"time_period\": \"1d\"}, {\"budget_limit\": 50.0, \"time_period\": \"7d\"}].\n\nExamples:\n\n1. Allow users to turn on/off pii masking\n\n```bash\ncurl --location 'http://0.0.0.0:4000/key/generate' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{\n \"permissions\": {\"allow_pii_controls\": true}\n}'\n```\n\nReturns:\n- key: (str) The generated api key\n- expires: (datetime) Datetime object for when key expires.\n- user_id: (str) Unique user id - used for tracking spend across multiple keys for same user id." operationId: generate_key_fn_key_generate_post security: - APIKeyHeader: [] parameters: - name: litellm-changed-by in: header required: false schema: anyOf: - type: string - type: 'null' description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability title: Litellm-Changed-By description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/GenerateKeyRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/GenerateKeyResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/service-account/generate: post: tags: - key management summary: Generate Service Account Key Fn description: "Generate a Service Account API key based on the provided data. This key does not belong to any user. It belongs to the team.\n\nWhy use a service account key?\n- Prevent key from being deleted when user is deleted.\n- Apply team limits, not team member limits to key.\n\nDocs: https://docs.litellm.ai/docs/proxy/virtual_keys\n\nParameters:\n- duration: Optional[str] - Specify the length of time the token is valid for. You can set duration as seconds (\"30s\"), minutes (\"30m\"), hours (\"30h\"), days (\"30d\").\n- key_alias: Optional[str] - User defined key alias\n- key: Optional[str] - User defined key value. Must start with 'sk-' and be at least 16 characters long. If not set, a 16-digit unique sk-key is created for you.\n- team_id: Optional[str] - The team id of the key\n- user_id: Optional[str] - [NON-FUNCTIONAL] THIS WILL BE IGNORED. The user id of the key\n- budget_id: Optional[str] - The budget id associated with the key. Created by calling `/budget/new`.\n- models: Optional[list] - Model_name's a user is allowed to call. (if empty, key is allowed to call all models)\n- aliases: Optional[dict] - Any alias mappings, on top of anything in the config.yaml model list. - https://docs.litellm.ai/docs/proxy/virtual_keys#managing-auth---upgradedowngrade-models\n- config: Optional[dict] - any key-specific configs, overrides config in config.yaml\n- spend: Optional[int] - Amount spent by key. Default is 0. Will be updated by proxy whenever key is used. https://docs.litellm.ai/docs/proxy/virtual_keys#managing-auth---tracking-spend\n- send_invite_email: Optional[bool] - Whether to send an invite email to the user_id, with the generate key\n- max_budget: Optional[float] - Specify max budget for a given key.\n- budget_duration: Optional[str] - Budget is reset at the end of specified duration. If not set, budget is never reset. You can set duration as seconds (\"30s\"), minutes (\"30m\"), hours (\"30h\"), days (\"30d\").\n- max_parallel_requests: Optional[int] - Rate limit a user based on the number of parallel requests. Raises 429 error, if user's parallel requests > x.\n- metadata: Optional[dict] - Metadata for key, store information for key. Example metadata = {\"team\": \"core-infra\", \"app\": \"app2\", \"email\": \"ishaan@berri.ai\" }\n- guardrails: Optional[List[str]] - List of active guardrails for the key\n- permissions: Optional[dict] - key-specific permissions. Currently just used for turning off pii masking (if connected). Example - {\"pii\": false}\n- model_max_budget: Optional[Dict[str, BudgetConfig]] - Model-specific budgets {\"gpt-4\": {\"budget_limit\": 0.0005, \"time_period\": \"30d\"}}}. IF null or {} then no model specific budget.\n- budget_fallbacks: Optional[Dict[str, List[str]]] - Per-model fallback chain tried in order when that model's own `model_max_budget` is exceeded, e.g. {\"gpt-4o\": [\"gpt-4o-mini\"]}.\n- model_rpm_limit: Optional[dict] - key-specific model rpm limit. Example - {\"text-davinci-002\": 1000, \"gpt-3.5-turbo\": 1000}. IF null or {} then no model specific rpm limit.\n- model_tpm_limit: Optional[dict] - key-specific model tpm limit. Example - {\"text-davinci-002\": 1000, \"gpt-3.5-turbo\": 1000}. IF null or {} then no model specific tpm limit.\n- mcp_rpm_limit: Optional[dict] - key-specific per-MCP-server rpm limit, keyed by MCP server name (alias if set, else the configured name). Example - {\"github\": 100, \"slack\": 200}. IF null or {} then no MCP-specific rpm limit.\n- tpm_limit_type: Optional[str] - TPM rate limit type - \"best_effort_throughput\", \"guaranteed_throughput\", or \"dynamic\"\n- rpm_limit_type: Optional[str] - RPM rate limit type - \"best_effort_throughput\", \"guaranteed_throughput\", or \"dynamic\"\n- allowed_cache_controls: Optional[list] - List of allowed cache control values. Example - [\"no-cache\", \"no-store\"]. See all values - https://docs.litellm.ai/docs/proxy/caching#turn-on--off-caching-per-request\n- blocked: Optional[bool] - Whether the key is blocked.\n- rpm_limit: Optional[int] - Specify rpm limit for a given key (Requests per minute)\n- tpm_limit: Optional[int] - Specify tpm limit for a given key (Tokens per minute)\n- soft_budget: Optional[float] - Specify soft budget for a given key. Will trigger a slack alert when this soft budget is reached.\n- tags: Optional[List[str]] - Tags for [tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags) and/or doing [tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing).\n- enforced_params: Optional[List[str]] - List of enforced params for the key (Enterprise only). [Docs](https://docs.litellm.ai/docs/proxy/enterprise#enforce-required-params-for-llm-requests)\n- allowed_routes: Optional[list] - List of allowed routes for the key. Store the actual route or store a wildcard pattern for a set of routes. Example - [\"/chat/completions\", \"/embeddings\", \"/keys/*\"]\n- object_permission: Optional[LiteLLM_ObjectPermissionBase] - key-specific object permission. Example - {\"vector_stores\": [\"vector_store_1\", \"vector_store_2\"], \"agents\": [\"agent_1\", \"agent_2\"], \"agent_access_groups\": [\"dev_group\"]}. IF null or {} then no object permission.\nExamples:\n- allowed_vector_store_indexes: Optional[List[dict]] - List of allowed vector store indexes for the key. Example - [{\"index_name\": \"my-index\", \"index_permissions\": [\"write\", \"read\"]}]. If specified, the key will only be able to use these specific vector store indexes. Create index, using `/v1/indexes` endpoint.\n\n\n1. Allow users to turn on/off pii masking\n\n```bash\ncurl --location 'http://0.0.0.0:4000/key/generate' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{\n \"permissions\": {\"allow_pii_controls\": true}\n}'\n```\n\nReturns:\n- key: (str) The generated api key\n- expires: (datetime) Datetime object for when key expires.\n- user_id: (str) Unique user id - used for tracking spend across multiple keys for same user id." operationId: generate_service_account_key_fn_key_service_account_generate_post security: - APIKeyHeader: [] parameters: - name: litellm-changed-by in: header required: false schema: anyOf: - type: string - type: 'null' description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability title: Litellm-Changed-By description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/GenerateKeyRequest' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/update: post: tags: - key management summary: Update Key Fn description: "Update an existing API key's parameters.\n\nParameters:\n- key: str - The key to update\n- key_alias: Optional[str] - User-friendly key alias\n- user_id: Optional[str] - User ID associated with key\n- team_id: Optional[str] - Team ID associated with key\n- agent_id: Optional[str] - The agent id associated with the key.\n- organization_id: Optional[str] - The organization id of the key.\n- budget_id: Optional[str] - The budget id associated with the key. Created by calling `/budget/new`.\n- models: Optional[list] - Model_name's a user is allowed to call\n- tags: Optional[List[str]] - Tags for organizing keys (Enterprise only)\n- prompts: Optional[List[str]] - List of prompts that the key is allowed to use.\n- enforced_params: Optional[List[str]] - List of enforced params for the key (Enterprise only). [Docs](https://docs.litellm.ai/docs/proxy/enterprise#enforce-required-params-for-llm-requests)\n- spend: Optional[float] - Amount spent by key\n- max_budget: Optional[float] - Max budget for key\n- model_max_budget: Optional[Dict[str, BudgetConfig]] - Model-specific budgets {\"gpt-4\": {\"budget_limit\": 0.0005, \"time_period\": \"30d\"}}\n- budget_fallbacks: Optional[Dict[str, List[str]]] - Per-model fallback chain tried in order when that model's own `model_max_budget` is exceeded, e.g. {\"gpt-4o\": [\"gpt-4o-mini\"]}.\n- budget_duration: Optional[str] - Budget reset period (\"30d\", \"1h\", etc.)\n- soft_budget: Optional[float] - [TODO] Soft budget limit (warning vs. hard stop). Will trigger a slack alert when this soft budget is reached.\n- max_parallel_requests: Optional[int] - Rate limit for parallel requests\n- metadata: Optional[dict] - Metadata for key. Example {\"team\": \"core-infra\", \"app\": \"app2\"}\n- tpm_limit: Optional[int] - Tokens per minute limit\n- rpm_limit: Optional[int] - Requests per minute limit\n- model_rpm_limit: Optional[dict] - Model-specific RPM limits {\"gpt-4\": 100, \"claude-v1\": 200}\n- mcp_rpm_limit: Optional[dict] - Per-MCP-server RPM limits, keyed by MCP server name {\"github\": 100, \"slack\": 200}\n- tag_rpm_limit: Optional[dict] - Per-request-tag RPM limits, keyed by request tag {\"cell-1\": 1000, \"cell-2\": 500}. Each tag gets an independent counter; absent tags fall back to the key-level rpm limit.\n- model_tpm_limit: Optional[dict] - Model-specific TPM limits {\"gpt-4\": 100000, \"claude-v1\": 200000}\n- tpm_limit_type: Optional[str] - TPM rate limit type - \"best_effort_throughput\", \"guaranteed_throughput\", or \"dynamic\"\n- rpm_limit_type: Optional[str] - RPM rate limit type - \"best_effort_throughput\", \"guaranteed_throughput\", or \"dynamic\"\n- allowed_cache_controls: Optional[list] - List of allowed cache control values\n- duration: Optional[str] - Key validity duration (\"30d\", \"1h\", etc.), null to never expire, or \"-1\" to never expire (deprecated, use null)\n- permissions: Optional[dict] - Key-specific permissions\n- send_invite_email: Optional[bool] - Send invite email to user_id\n- guardrails: Optional[List[str]] - List of active guardrails for the key\n- policies: Optional[List[str]] - List of policy names to apply to the key. Policies define guardrails, conditions, and inheritance rules.\n- disable_global_guardrails: Optional[bool] - Whether to disable global guardrails for the key.\n- throttle_on_budget_exceeded: Optional[bool] - When the key exceeds its max_budget, throttle its tpm/rpm to the global budget_exceeded_throttle_percentage instead of blocking the key entirely.\n- prompts: Optional[List[str]] - List of prompts that the key is allowed to use.\n- blocked: Optional[bool] - Whether the key is blocked\n- aliases: Optional[dict] - Model aliases for the key - [Docs](https://litellm.vercel.app/docs/proxy/virtual_keys#model-aliases)\n- config: Optional[dict] - [DEPRECATED PARAM] Key-specific config.\n- temp_budget_increase: Optional[float] - Temporary budget increase for the key (Enterprise only).\n- temp_budget_expiry: Optional[str] - Expiry time for the temporary budget increase (Enterprise only).\n- allowed_routes: Optional[list] - List of allowed routes for the key. Store the actual route or store a wildcard pattern for a set of routes. Example - [\"/chat/completions\", \"/embeddings\", \"/keys/*\"]\n- allowed_passthrough_routes: Optional[list] - List of allowed pass through routes for the key. Store the actual route or store a wildcard pattern for a set of routes. Example - [\"/my-custom-endpoint\"]. Use this instead of allowed_routes, if you just want to specify which pass through routes the key can access, without specifying the routes. If allowed_routes is specified, allowed_passthrough_routes is ignored.\n- prompts: Optional[List[str]] - List of allowed prompts for the key. If specified, the key will only be able to use these specific prompts.\n- object_permission: Optional[LiteLLM_ObjectPermissionBase] - key-specific object permission. Example - {\"vector_stores\": [\"vector_store_1\", \"vector_store_2\"], \"agents\": [\"agent_1\", \"agent_2\"], \"agent_access_groups\": [\"dev_group\"]}. IF null or {} then no object permission.\n- auto_rotate: Optional[bool] - Whether this key should be automatically rotated\n- rotation_interval: Optional[str] - How often to rotate this key (e.g., '30d', '90d'). Required if auto_rotate=True\n- allowed_vector_store_indexes: Optional[List[dict]] - List of allowed vector store indexes for the key. Example - [{\"index_name\": \"my-index\", \"index_permissions\": [\"write\", \"read\"]}]. If specified, the key will only be able to use these specific vector store indexes. Create index, using `/v1/indexes` endpoint.\n- router_settings: Optional[UpdateRouterConfig] - key-specific router settings. Example - {\"model_group_retry_policy\": {\"gpt-4\": {\"RateLimitErrorRetries\": 5}}}. IF null or {} then no router settings.\n- access_group_ids: Optional[List[str]] - List of access group IDs to associate with the key. Access groups define which models a key can access. Example - [\"access_group_1\", \"access_group_2\"].\n- budget_limits: Optional[list] - List of concurrent budget windows for the key. Each window specifies a budget_limit, time_period, and optional budget_duration. Example - [{\"budget_limit\": 10.0, \"time_period\": \"1d\"}, {\"budget_limit\": 50.0, \"time_period\": \"7d\"}].\n\nExample:\n```bash\ncurl --location 'http://0.0.0.0:4000/key/update' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{\n \"key\": \"sk-1234\",\n \"key_alias\": \"my-key\",\n \"user_id\": \"user-1234\",\n \"team_id\": \"team-1234\",\n \"max_budget\": 100,\n \"metadata\": {\"any_key\": \"any-val\"},\n}'\n```" operationId: update_key_fn_key_update_post security: - APIKeyHeader: [] parameters: - name: litellm-changed-by in: header required: false schema: anyOf: - type: string - type: 'null' description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability title: Litellm-Changed-By description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateKeyRequest' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/bulk_update: post: tags: - key management summary: Bulk Update Keys description: "Bulk update multiple keys at once.\n\nThis endpoint allows updating multiple keys in a single request. Each key update\nis processed independently - if some updates fail, others will still succeed.\n\nParameters:\n- keys: List[BulkUpdateKeyRequestItem] - List of key update requests, each containing:\n - key: str - The key identifier (token) to update\n - budget_id: Optional[str] - Budget ID associated with the key\n - max_budget: Optional[float] - Max budget for key\n - team_id: Optional[str] - Team ID associated with key\n - tags: Optional[List[str]] - Tags for organizing keys\n\nReturns:\n- total_requested: int - Total number of keys requested for update\n- successful_updates: List[SuccessfulKeyUpdate] - List of successfully updated keys with their updated info\n- failed_updates: List[FailedKeyUpdate] - List of failed updates with key_info and failed_reason\n\nExample request:\n```bash\ncurl --location 'http://0.0.0.0:4000/key/bulk_update' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{\n \"keys\": [\n {\n \"key\": \"sk-1234\",\n \"max_budget\": 100.0,\n \"team_id\": \"team-123\",\n \"tags\": [\"production\", \"api\"]\n },\n {\n \"key\": \"sk-5678\",\n \"budget_id\": \"budget-456\",\n \"tags\": [\"staging\"]\n }\n ]\n}'\n```" operationId: bulk_update_keys_key_bulk_update_post security: - APIKeyHeader: [] parameters: - name: litellm-changed-by in: header required: false schema: anyOf: - type: string - type: 'null' description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability title: Litellm-Changed-By description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BulkUpdateKeyRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BulkUpdateKeyResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /team/key/bulk_update: post: tags: - key management summary: Bulk Update Team Keys description: 'Apply one update payload to many keys inside a single team. Pass `team_id` plus either `key_ids` or `all_keys_in_team=True`. The `update_fields` payload is broadcast to every selected key. Per-key failures are returned in `failed_updates` rather than aborting the batch. Callable by proxy admins, or by team admins with `KEY_UPDATE` permission.' operationId: bulk_update_team_keys_team_key_bulk_update_post security: - APIKeyHeader: [] parameters: - name: litellm-changed-by in: header required: false schema: anyOf: - type: string - type: 'null' description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability title: Litellm-Changed-By description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BulkUpdateTeamKeysRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BulkUpdateKeyResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/delete: post: tags: - key management summary: Delete Key Fn description: "Delete a key from the key management system.\n\nParameters::\n- keys (List[str]): A list of keys or hashed keys to delete. Example {\"keys\": [\"sk-QWrxEynunsNpV1zT48HIrw\", \"837e17519f44683334df5291321d97b8bf1098cd490e49e215f6fea935aa28be\"]}\n- key_aliases (List[str]): A list of key aliases to delete. Can be passed instead of `keys`.Example {\"key_aliases\": [\"alias1\", \"alias2\"]}\n\nReturns:\n- deleted_keys (List[str]): A list of deleted keys. Example {\"deleted_keys\": [\"sk-QWrxEynunsNpV1zT48HIrw\", \"837e17519f44683334df5291321d97b8bf1098cd490e49e215f6fea935aa28be\"]}\n\nExample:\n```bash\ncurl --location 'http://0.0.0.0:4000/key/delete' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{\n \"keys\": [\"sk-QWrxEynunsNpV1zT48HIrw\"]\n}'\n```\n\nRaises:\n HTTPException: If an error occurs during key deletion." operationId: delete_key_fn_key_delete_post security: - APIKeyHeader: [] parameters: - name: litellm-changed-by in: header required: false schema: anyOf: - type: string - type: 'null' description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability title: Litellm-Changed-By description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/KeyRequest' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/info: get: tags: - key management summary: Info Key Fn description: "Retrieve information about a key.\nParameters:\n key: Optional[str] = Query parameter representing the key in the request\n user_api_key_dict: UserAPIKeyAuth = Dependency representing the user's API key\nReturns:\n Dict containing the key and its associated information\n\nExample Curl:\n```\ncurl -X GET \"http://0.0.0.0:4000/key/info?key=sk-test-example-key-123\" -H \"Authorization: Bearer sk-1234\"\n```\n\nExample Curl - if no key is passed, it will use the Key Passed in Authorization Header\n```\ncurl -X GET \"http://0.0.0.0:4000/key/info\" -H \"Authorization: Bearer sk-test-example-key-123\"\n```" operationId: info_key_fn_key_info_get security: - APIKeyHeader: [] parameters: - name: key in: query required: false schema: anyOf: - type: string - type: 'null' description: Key in the request parameters title: Key description: Key in the request parameters responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/regenerate: post: tags: - key management summary: Regenerate Key Fn description: "Regenerate an existing API key while optionally updating its parameters.\n\nParameters:\n- key: str (path parameter) - The key to regenerate\n- data: Optional[RegenerateKeyRequest] - Request body containing optional parameters to update\n - key: Optional[str] - The key to regenerate.\n - new_master_key: Optional[str] - The new master key to use, if key is the master key.\n - new_key: Optional[str] - The new key to use, if key is not the master key. Must start with 'sk-' and be at least 16 characters long. If both set, new_master_key will be used.\n - key_alias: Optional[str] - User-friendly key alias\n - user_id: Optional[str] - User ID associated with key\n - team_id: Optional[str] - Team ID associated with key\n - models: Optional[list] - Model_name's a user is allowed to call\n - tags: Optional[List[str]] - Tags for organizing keys (Enterprise only)\n - spend: Optional[float] - Amount spent by key\n - max_budget: Optional[float] - Max budget for key\n - model_max_budget: Optional[Dict[str, BudgetConfig]] - Model-specific budgets {\"gpt-4\": {\"budget_limit\": 0.0005, \"time_period\": \"30d\"}}\n - budget_fallbacks: Optional[Dict[str, List[str]]] - Per-model fallback chain tried in order when that model's own `model_max_budget` is exceeded, e.g. {\"gpt-4o\": [\"gpt-4o-mini\"]}.\n - budget_duration: Optional[str] - Budget reset period (\"30d\", \"1h\", etc.)\n - soft_budget: Optional[float] - Soft budget limit (warning vs. hard stop). Will trigger a slack alert when this soft budget is reached.\n - max_parallel_requests: Optional[int] - Rate limit for parallel requests\n - metadata: Optional[dict] - Metadata for key. Example {\"team\": \"core-infra\", \"app\": \"app2\"}\n - tpm_limit: Optional[int] - Tokens per minute limit\n - rpm_limit: Optional[int] - Requests per minute limit\n - model_rpm_limit: Optional[dict] - Model-specific RPM limits {\"gpt-4\": 100, \"claude-v1\": 200}\n - model_tpm_limit: Optional[dict] - Model-specific TPM limits {\"gpt-4\": 100000, \"claude-v1\": 200000}\n - allowed_cache_controls: Optional[list] - List of allowed cache control values\n - duration: Optional[str] - Key validity duration (\"30d\", \"1h\", etc.)\n - permissions: Optional[dict] - Key-specific permissions\n - guardrails: Optional[List[str]] - List of active guardrails for the key\n - blocked: Optional[bool] - Whether the key is blocked\n - grace_period: Optional[str] - Duration to keep old key valid after rotation (e.g. \"24h\", \"2d\"). Omitted = immediate revoke. Env: LITELLM_KEY_ROTATION_GRACE_PERIOD\n\n\nReturns:\n- GenerateKeyResponse containing the new key and its updated parameters\n\nExample:\n```bash\ncurl --location --request POST 'http://localhost:4000/key/sk-1234/regenerate' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data-raw '{\n \"max_budget\": 100,\n \"metadata\": {\"team\": \"core-infra\"},\n \"models\": [\"gpt-4\", \"gpt-3.5-turbo\"]\n}'\n```\n\nNote: This is an Enterprise feature. It requires a premium license to use." operationId: regenerate_key_fn_key_regenerate_post security: - APIKeyHeader: [] parameters: - name: key in: query required: false schema: anyOf: - type: string - type: 'null' title: Key - name: litellm-changed-by in: header required: false schema: anyOf: - type: string - type: 'null' description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability title: Litellm-Changed-By description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability requestBody: content: application/json: schema: anyOf: - $ref: '#/components/schemas/RegenerateKeyRequest' - type: 'null' title: Data responses: '200': description: Successful Response content: application/json: schema: anyOf: - $ref: '#/components/schemas/GenerateKeyResponse' - type: 'null' title: Response Regenerate Key Fn Key Regenerate Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/{key}/regenerate: post: tags: - key management summary: Regenerate Key Fn description: "Regenerate an existing API key while optionally updating its parameters.\n\nParameters:\n- key: str (path parameter) - The key to regenerate\n- data: Optional[RegenerateKeyRequest] - Request body containing optional parameters to update\n - key: Optional[str] - The key to regenerate.\n - new_master_key: Optional[str] - The new master key to use, if key is the master key.\n - new_key: Optional[str] - The new key to use, if key is not the master key. Must start with 'sk-' and be at least 16 characters long. If both set, new_master_key will be used.\n - key_alias: Optional[str] - User-friendly key alias\n - user_id: Optional[str] - User ID associated with key\n - team_id: Optional[str] - Team ID associated with key\n - models: Optional[list] - Model_name's a user is allowed to call\n - tags: Optional[List[str]] - Tags for organizing keys (Enterprise only)\n - spend: Optional[float] - Amount spent by key\n - max_budget: Optional[float] - Max budget for key\n - model_max_budget: Optional[Dict[str, BudgetConfig]] - Model-specific budgets {\"gpt-4\": {\"budget_limit\": 0.0005, \"time_period\": \"30d\"}}\n - budget_fallbacks: Optional[Dict[str, List[str]]] - Per-model fallback chain tried in order when that model's own `model_max_budget` is exceeded, e.g. {\"gpt-4o\": [\"gpt-4o-mini\"]}.\n - budget_duration: Optional[str] - Budget reset period (\"30d\", \"1h\", etc.)\n - soft_budget: Optional[float] - Soft budget limit (warning vs. hard stop). Will trigger a slack alert when this soft budget is reached.\n - max_parallel_requests: Optional[int] - Rate limit for parallel requests\n - metadata: Optional[dict] - Metadata for key. Example {\"team\": \"core-infra\", \"app\": \"app2\"}\n - tpm_limit: Optional[int] - Tokens per minute limit\n - rpm_limit: Optional[int] - Requests per minute limit\n - model_rpm_limit: Optional[dict] - Model-specific RPM limits {\"gpt-4\": 100, \"claude-v1\": 200}\n - model_tpm_limit: Optional[dict] - Model-specific TPM limits {\"gpt-4\": 100000, \"claude-v1\": 200000}\n - allowed_cache_controls: Optional[list] - List of allowed cache control values\n - duration: Optional[str] - Key validity duration (\"30d\", \"1h\", etc.)\n - permissions: Optional[dict] - Key-specific permissions\n - guardrails: Optional[List[str]] - List of active guardrails for the key\n - blocked: Optional[bool] - Whether the key is blocked\n - grace_period: Optional[str] - Duration to keep old key valid after rotation (e.g. \"24h\", \"2d\"). Omitted = immediate revoke. Env: LITELLM_KEY_ROTATION_GRACE_PERIOD\n\n\nReturns:\n- GenerateKeyResponse containing the new key and its updated parameters\n\nExample:\n```bash\ncurl --location --request POST 'http://localhost:4000/key/sk-1234/regenerate' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data-raw '{\n \"max_budget\": 100,\n \"metadata\": {\"team\": \"core-infra\"},\n \"models\": [\"gpt-4\", \"gpt-3.5-turbo\"]\n}'\n```\n\nNote: This is an Enterprise feature. It requires a premium license to use." operationId: regenerate_key_fn_key__key__regenerate_post security: - APIKeyHeader: [] parameters: - name: key in: path required: true schema: anyOf: - type: string - type: 'null' title: Key - name: litellm-changed-by in: header required: false schema: anyOf: - type: string - type: 'null' description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability title: Litellm-Changed-By description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability requestBody: content: application/json: schema: anyOf: - $ref: '#/components/schemas/RegenerateKeyRequest' - type: 'null' title: Data responses: '200': description: Successful Response content: application/json: schema: anyOf: - $ref: '#/components/schemas/GenerateKeyResponse' - type: 'null' title: Response Regenerate Key Fn Key Key Regenerate Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/{key}/reset_spend: post: tags: - key management summary: Reset Key Spend Fn operationId: reset_key_spend_fn_key__key__reset_spend_post security: - APIKeyHeader: [] parameters: - name: key in: path required: true schema: type: string title: Key - name: litellm-changed-by in: header required: false schema: anyOf: - type: string - type: 'null' description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability title: Litellm-Changed-By description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ResetSpendRequest' responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Reset Key Spend Fn Key Key Reset Spend Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/list: get: tags: - key management summary: List Keys description: "List all keys for a given user / team / organization.\n\nParameters:\n expand: Optional[List[str]] - Expand related objects (e.g. 'user' to include user information)\n status: Optional[str] - Filter by status. Currently supports \"deleted\" to query deleted keys.\n\nReturns:\n {\n \"keys\": List[str] or List[UserAPIKeyAuth],\n \"total_count\": int,\n \"current_page\": int,\n \"total_pages\": int,\n }\n\nWhen expand includes \"user\", each key object will include a \"user\" field with the associated user object.\nNote: When expand=user is specified, full key objects are returned regardless of the return_full_object parameter." operationId: list_keys_key_list_get security: - APIKeyHeader: [] parameters: - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: size in: query required: false schema: type: integer maximum: 100 minimum: 1 description: Page size default: 10 title: Size description: Page size - name: user_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter keys by user ID. Exact match by default; set substring_matching=true (admin only) for case-insensitive substring matching. title: User Id description: Filter keys by user ID. Exact match by default; set substring_matching=true (admin only) for case-insensitive substring matching. - name: team_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter keys by team ID title: Team Id description: Filter keys by team ID - name: organization_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter keys by organization ID title: Organization Id description: Filter keys by organization ID - name: key_hash in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter keys by key hash title: Key Hash description: Filter keys by key hash - name: key_alias in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter keys by key alias. Exact match by default; set substring_matching=true (admin only) for case-insensitive substring matching. title: Key Alias description: Filter keys by key alias. Exact match by default; set substring_matching=true (admin only) for case-insensitive substring matching. - name: return_full_object in: query required: false schema: type: boolean description: Return full key object default: false title: Return Full Object description: Return full key object - name: include_team_keys in: query required: false schema: type: boolean description: Include all keys for teams that user is an admin of. default: false title: Include Team Keys description: Include all keys for teams that user is an admin of. - name: include_created_by_keys in: query required: false schema: type: boolean description: Include keys created by the user default: false title: Include Created By Keys description: Include keys created by the user - name: sort_by in: query required: false schema: anyOf: - type: string - type: 'null' description: Column to sort by (e.g. 'user_id', 'created_at', 'spend') title: Sort By description: Column to sort by (e.g. 'user_id', 'created_at', 'spend') - name: sort_order in: query required: false schema: type: string description: Sort order ('asc' or 'desc') default: desc title: Sort Order description: Sort order ('asc' or 'desc') - name: expand in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Expand related objects (e.g. 'user') title: Expand description: Expand related objects (e.g. 'user') - name: status in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by status (e.g. 'deleted') title: Status description: Filter by status (e.g. 'deleted') - name: project_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter keys by project ID title: Project Id description: Filter keys by project ID - name: access_group_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter keys by access group ID title: Access Group Id description: Filter keys by access group ID - name: agent_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter keys by agent ID title: Agent Id description: Filter keys by agent ID - name: substring_matching in: query required: false schema: type: boolean description: 'If true (proxy admins only), match user_id/key_alias as case-insensitive substrings instead of exact values. Defaults to false: /key/list matched these exactly before substring search was added, and an exact user_id/key_alias filter must never return another user''s keys.' default: false title: Substring Matching description: 'If true (proxy admins only), match user_id/key_alias as case-insensitive substrings instead of exact values. Defaults to false: /key/list matched these exactly before substring search was added, and an exact user_id/key_alias filter must never return another user''s keys.' - name: expires in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter keys by expiration. 'expired' returns keys whose expires is in the past; 'active' returns keys that never expire or expire in the future. Omit to return keys regardless of expiration. title: Expires description: Filter keys by expiration. 'expired' returns keys whose expires is in the past; 'active' returns keys that never expire or expire in the future. Omit to return keys regardless of expiration. responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/KeyListResponseObject' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/aliases: get: tags: - key management summary: Key Aliases description: "Lists key aliases with pagination and optional search.\n\nNon-admin users only see aliases for keys they own or keys belonging to\ntheir teams.\n\nReturns:\n {\n \"aliases\": List[str],\n \"total_count\": int,\n \"current_page\": int,\n \"total_pages\": int,\n \"size\": int,\n }" operationId: key_aliases_key_aliases_get security: - APIKeyHeader: [] parameters: - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: size in: query required: false schema: type: integer maximum: 100 minimum: 1 description: Page size default: 50 title: Size description: Page size - name: search in: query required: false schema: anyOf: - type: string - type: 'null' description: Search key aliases (case-insensitive partial match) title: Search description: Search key aliases (case-insensitive partial match) - name: team_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter aliases to keys belonging to this team title: Team Id description: Filter aliases to keys belonging to this team responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Key Aliases Key Aliases Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/block: post: tags: - key management summary: Block Key description: "Block an Virtual key from making any requests.\n\nParameters:\n- key: str - The key to block. Can be either the unhashed key (sk-...) or the hashed key value\n\n Example:\n```bash\ncurl --location 'http://0.0.0.0:4000/key/block' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{\n \"key\": \"sk-Fn8Ej39NxjAXrvpUGKghGw\"\n}'\n```\n\nNote: This is an admin-only endpoint. Only proxy admins, team admins, or org admins can block keys." operationId: block_key_key_block_post security: - APIKeyHeader: [] parameters: - name: litellm-changed-by in: header required: false schema: anyOf: - type: string - type: 'null' description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability title: Litellm-Changed-By description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BlockKeyRequest' responses: '200': description: Successful Response content: application/json: schema: anyOf: - $ref: '#/components/schemas/LiteLLM_VerificationToken' - type: 'null' title: Response Block Key Key Block Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/unblock: post: tags: - key management summary: Unblock Key description: "Unblock a Virtual key to allow it to make requests again.\n\nParameters:\n- key: str - The key to unblock. Can be either the unhashed key (sk-...) or the hashed key value\n\nExample:\n```bash\ncurl --location 'http://0.0.0.0:4000/key/unblock' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{\n \"key\": \"sk-Fn8Ej39NxjAXrvpUGKghGw\"\n}'\n```\n\nNote: This is an admin-only endpoint. Only proxy admins, team admins, or org admins can unblock keys." operationId: unblock_key_key_unblock_post security: - APIKeyHeader: [] parameters: - name: litellm-changed-by in: header required: false schema: anyOf: - type: string - type: 'null' description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability title: Litellm-Changed-By description: The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BlockKeyRequest' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /key/health: post: tags: - key management summary: Key Health description: "Check the health of the key\n\nChecks:\n- If key based logging is configured correctly - sends a test log\n\nUsage \n\nPass the key in the request header\n\n```bash\ncurl -X POST \"http://localhost:4000/key/health\" -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\"\n```\n\nResponse when logging callbacks are setup correctly:\n\n```json\n{\n \"key\": \"healthy\",\n \"logging_callbacks\": {\n \"callbacks\": [\n \"gcs_bucket\"\n ],\n \"status\": \"healthy\",\n \"details\": \"No logger exceptions triggered, system is healthy. Manually check if logs were sent to ['gcs_bucket']\"\n }\n}\n```\n\n\nResponse when logging callbacks are not setup correctly:\n```json\n{\n \"key\": \"unhealthy\",\n \"logging_callbacks\": {\n \"callbacks\": [\n \"gcs_bucket\"\n ],\n \"status\": \"unhealthy\",\n \"details\": \"Logger exceptions triggered, system is unhealthy: Failed to load vertex credentials. Check to see if credentials containing partial/invalid information.\"\n }\n}\n```" operationId: key_health_key_health_post responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/KeyHealthResponse' security: - APIKeyHeader: [] components: schemas: AllowedVectorStoreIndexItem: properties: index_name: type: string title: Index Name index_permissions: items: type: string enum: - read - write type: array title: Index Permissions type: object required: - index_name - index_permissions title: AllowedVectorStoreIndexItem LitellmUserRoles: type: string enum: - proxy_admin - proxy_admin_viewer - org_admin - internal_user - internal_user_viewer - team - customer title: LitellmUserRoles description: 'Admin Roles: PROXY_ADMIN: admin over the platform PROXY_ADMIN_VIEW_ONLY: can login, view all own keys, view all spend ORG_ADMIN: admin over a specific organization, can create teams, users only within their organization Internal User Roles: INTERNAL_USER: can login, view/create/delete their own keys, view their spend INTERNAL_USER_VIEW_ONLY: can login, view their own keys, view their own spend Team Roles: TEAM: used for JWT auth Customer Roles: CUSTOMER: External users -> these are customers' UserAPIKeyAuth: properties: token: anyOf: - type: string - type: 'null' title: Token key_name: anyOf: - type: string - type: 'null' title: Key Name key_alias: anyOf: - type: string - type: 'null' title: Key Alias spend: type: number title: Spend default: 0.0 max_budget: anyOf: - type: number - type: 'null' title: Max Budget expires: anyOf: - type: string - type: string format: date-time - type: 'null' title: Expires models: items: {} type: array title: Models default: [] aliases: additionalProperties: true type: object title: Aliases default: {} config: additionalProperties: true type: object title: Config default: {} user_id: anyOf: - type: string - type: 'null' title: User Id team_id: anyOf: - type: string - type: 'null' title: Team Id agent_id: anyOf: - type: string - type: 'null' title: Agent Id project_id: anyOf: - type: string - type: 'null' title: Project Id max_parallel_requests: anyOf: - type: integer - type: 'null' title: Max Parallel Requests metadata: additionalProperties: true type: object title: Metadata default: {} tpm_limit: anyOf: - type: integer - type: 'null' title: Tpm Limit rpm_limit: anyOf: - type: integer - type: 'null' title: Rpm Limit budget_duration: anyOf: - type: string - type: 'null' title: Budget Duration budget_reset_at: anyOf: - type: string format: date-time - type: 'null' title: Budget Reset At allowed_cache_controls: anyOf: - items: {} type: array - type: 'null' title: Allowed Cache Controls default: [] allowed_routes: anyOf: - items: {} type: array - type: 'null' title: Allowed Routes default: [] key_type: anyOf: - type: string - type: 'null' title: Key Type permissions: additionalProperties: true type: object title: Permissions default: {} model_spend: additionalProperties: true type: object title: Model Spend default: {} model_max_budget: additionalProperties: true type: object title: Model Max Budget default: {} budget_fallbacks: additionalProperties: items: type: string type: array type: object title: Budget Fallbacks default: {} soft_budget_cooldown: type: boolean title: Soft Budget Cooldown default: false blocked: anyOf: - type: boolean - type: 'null' title: Blocked litellm_budget_table: anyOf: - additionalProperties: true type: object - type: 'null' title: Litellm Budget Table budget_id: anyOf: - type: string - type: 'null' title: Budget Id org_id: anyOf: - type: string - type: 'null' title: Org Id created_at: anyOf: - type: string format: date-time - type: 'null' title: Created At created_by: anyOf: - type: string - type: 'null' title: Created By updated_at: anyOf: - type: string format: date-time - type: 'null' title: Updated At updated_by: anyOf: - type: string - type: 'null' title: Updated By last_active: anyOf: - type: string format: date-time - type: 'null' title: Last Active object_permission_id: anyOf: - type: string - type: 'null' title: Object Permission Id object_permission: anyOf: - $ref: '#/components/schemas/LiteLLM_ObjectPermissionTable' - type: 'null' access_group_ids: anyOf: - items: type: string type: array - type: 'null' title: Access Group Ids rotation_count: anyOf: - type: integer - type: 'null' title: Rotation Count default: 0 auto_rotate: anyOf: - type: boolean - type: 'null' title: Auto Rotate default: false rotation_interval: anyOf: - type: string - type: 'null' title: Rotation Interval last_rotation_at: anyOf: - type: string format: date-time - type: 'null' title: Last Rotation At key_rotation_at: anyOf: - type: string format: date-time - type: 'null' title: Key Rotation At router_settings: anyOf: - additionalProperties: true type: object - type: 'null' title: Router Settings budget_limits: anyOf: - items: additionalProperties: true type: object type: array - type: 'null' title: Budget Limits team_spend: anyOf: - type: number - type: 'null' title: Team Spend team_alias: anyOf: - type: string - type: 'null' title: Team Alias team_tpm_limit: anyOf: - type: integer - type: 'null' title: Team Tpm Limit team_rpm_limit: anyOf: - type: integer - type: 'null' title: Team Rpm Limit team_max_budget: anyOf: - type: number - type: 'null' title: Team Max Budget team_soft_budget: anyOf: - type: number - type: 'null' title: Team Soft Budget team_models: items: {} type: array title: Team Models default: [] team_blocked: type: boolean title: Team Blocked default: false soft_budget: anyOf: - type: number - type: 'null' title: Soft Budget team_model_aliases: anyOf: - additionalProperties: true type: object - type: 'null' title: Team Model Aliases team_member: anyOf: - $ref: '#/components/schemas/Member' - type: 'null' team_metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Team Metadata team_object_permission_id: anyOf: - type: string - type: 'null' title: Team Object Permission Id team_member_spend: anyOf: - type: number - type: 'null' title: Team Member Spend team_member_tpm_limit: anyOf: - type: integer - type: 'null' title: Team Member Tpm Limit team_member_rpm_limit: anyOf: - type: integer - type: 'null' title: Team Member Rpm Limit end_user_id: anyOf: - type: string - type: 'null' title: End User Id end_user_tpm_limit: anyOf: - type: integer - type: 'null' title: End User Tpm Limit end_user_rpm_limit: anyOf: - type: integer - type: 'null' title: End User Rpm Limit end_user_max_budget: anyOf: - type: number - type: 'null' title: End User Max Budget end_user_model_max_budget: anyOf: - additionalProperties: true type: object - type: 'null' title: End User Model Max Budget organization_alias: anyOf: - type: string - type: 'null' title: Organization Alias organization_max_budget: anyOf: - type: number - type: 'null' title: Organization Max Budget organization_tpm_limit: anyOf: - type: integer - type: 'null' title: Organization Tpm Limit organization_rpm_limit: anyOf: - type: integer - type: 'null' title: Organization Rpm Limit organization_metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Organization Metadata project_alias: anyOf: - type: string - type: 'null' title: Project Alias project_metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Project Metadata last_refreshed_at: anyOf: - type: number - type: 'null' title: Last Refreshed At api_key: anyOf: - type: string - type: 'null' title: Api Key user_role: anyOf: - $ref: '#/components/schemas/LitellmUserRoles' - type: 'null' allowed_model_region: anyOf: - type: string enum: - eu - us - type: 'null' title: Allowed Model Region parent_otel_span: anyOf: - {} - type: 'null' title: Parent Otel Span rpm_limit_per_model: anyOf: - additionalProperties: type: integer type: object - type: 'null' title: Rpm Limit Per Model tpm_limit_per_model: anyOf: - additionalProperties: type: integer type: object - type: 'null' title: Tpm Limit Per Model user_tpm_limit: anyOf: - type: integer - type: 'null' title: User Tpm Limit user_rpm_limit: anyOf: - type: integer - type: 'null' title: User Rpm Limit user_email: anyOf: - type: string - type: 'null' title: User Email user_spend: anyOf: - type: number - type: 'null' title: User Spend user_max_budget: anyOf: - type: number - type: 'null' title: User Max Budget request_route: anyOf: - type: string - type: 'null' title: Request Route is_session_token: type: boolean title: Is Session Token default: false user: anyOf: - {} - type: 'null' title: User created_by_user: anyOf: - {} - type: 'null' title: Created By User end_user_object_permission: anyOf: - $ref: '#/components/schemas/LiteLLM_ObjectPermissionTable' - type: 'null' team_object_permission: anyOf: - $ref: '#/components/schemas/LiteLLM_ObjectPermissionTable' - type: 'null' jwt_claims: anyOf: - additionalProperties: true type: object - type: 'null' title: Jwt Claims type: object title: UserAPIKeyAuth description: Return the row in the db KeyRequest: properties: keys: anyOf: - items: type: string type: array - type: 'null' title: Keys key_aliases: anyOf: - items: type: string type: array - type: 'null' title: Key Aliases type: object title: KeyRequest BulkUpdateTeamKeysRequest: properties: team_id: type: string title: Team Id key_ids: anyOf: - items: type: string type: array - type: 'null' title: Key Ids all_keys_in_team: type: boolean title: All Keys In Team default: false update_fields: $ref: '#/components/schemas/KeyUpdateFields' type: object required: - team_id - update_fields title: BulkUpdateTeamKeysRequest description: Apply one update payload to many keys inside a team; provide either `key_ids` or `all_keys_in_team=True`. RetryPolicy: properties: BadRequestErrorRetries: anyOf: - type: integer - type: 'null' title: Badrequesterrorretries AuthenticationErrorRetries: anyOf: - type: integer - type: 'null' title: Authenticationerrorretries TimeoutErrorRetries: anyOf: - type: integer - type: 'null' title: Timeouterrorretries RateLimitErrorRetries: anyOf: - type: integer - type: 'null' title: Ratelimiterrorretries ContentPolicyViolationErrorRetries: anyOf: - type: integer - type: 'null' title: Contentpolicyviolationerrorretries InternalServerErrorRetries: anyOf: - type: integer - type: 'null' title: Internalservererrorretries type: object title: RetryPolicy description: 'Use this to set a custom number of retries per exception type If RateLimitErrorRetries = 3, then 3 retries will be made for RateLimitError Mapping of Exception type to number of retries https://docs.litellm.ai/docs/exception_mapping' GenerateKeyRequest: properties: key_alias: anyOf: - type: string - type: 'null' title: Key Alias duration: anyOf: - type: string - type: 'null' title: Duration models: anyOf: - items: {} type: array - type: 'null' title: Models default: [] spend: anyOf: - type: number - type: 'null' title: Spend default: 0 max_budget: anyOf: - type: number - type: 'null' title: Max Budget user_id: anyOf: - type: string - type: 'null' title: User Id team_id: anyOf: - type: string - type: 'null' title: Team Id agent_id: anyOf: - type: string - type: 'null' title: Agent Id max_parallel_requests: anyOf: - type: integer - type: 'null' title: Max Parallel Requests metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata default: {} tpm_limit: anyOf: - type: integer - type: 'null' title: Tpm Limit rpm_limit: anyOf: - type: integer - type: 'null' title: Rpm Limit budget_duration: anyOf: - type: string - type: 'null' title: Budget Duration budget_limits: anyOf: - items: $ref: '#/components/schemas/BudgetLimitEntry' type: array - type: 'null' title: Budget Limits allowed_cache_controls: anyOf: - items: {} type: array - type: 'null' title: Allowed Cache Controls default: [] config: anyOf: - additionalProperties: true type: object - type: 'null' title: Config default: {} permissions: anyOf: - additionalProperties: true type: object - type: 'null' title: Permissions default: {} model_max_budget: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Max Budget default: {} budget_fallbacks: anyOf: - additionalProperties: items: type: string type: array type: object - type: 'null' title: Budget Fallbacks model_rpm_limit: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Rpm Limit model_tpm_limit: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Tpm Limit mcp_rpm_limit: anyOf: - additionalProperties: type: integer type: object - type: 'null' title: Mcp Rpm Limit tag_rpm_limit: anyOf: - additionalProperties: type: integer type: object - type: 'null' title: Tag Rpm Limit guardrails: anyOf: - items: type: string type: array - type: 'null' title: Guardrails policies: anyOf: - items: type: string type: array - type: 'null' title: Policies prompts: anyOf: - items: type: string type: array - type: 'null' title: Prompts blocked: anyOf: - type: boolean - type: 'null' title: Blocked aliases: anyOf: - additionalProperties: true type: object - type: 'null' title: Aliases default: {} object_permission: anyOf: - $ref: '#/components/schemas/LiteLLM_ObjectPermissionBase' - type: 'null' key: anyOf: - type: string - type: 'null' title: Key budget_id: anyOf: - type: string - type: 'null' title: Budget Id tags: anyOf: - items: type: string type: array - type: 'null' title: Tags disable_global_guardrails: anyOf: - type: boolean - type: 'null' title: Disable Global Guardrails throttle_on_budget_exceeded: anyOf: - type: boolean - type: 'null' title: Throttle On Budget Exceeded enforced_params: anyOf: - items: type: string type: array - type: 'null' title: Enforced Params allowed_routes: anyOf: - items: {} type: array - type: 'null' title: Allowed Routes default: [] allowed_passthrough_routes: anyOf: - items: {} type: array - type: 'null' title: Allowed Passthrough Routes allowed_vector_store_indexes: anyOf: - items: $ref: '#/components/schemas/AllowedVectorStoreIndexItem' type: array - type: 'null' title: Allowed Vector Store Indexes rpm_limit_type: anyOf: - type: string enum: - guaranteed_throughput - best_effort_throughput - dynamic - type: 'null' title: Rpm Limit Type tpm_limit_type: anyOf: - type: string enum: - guaranteed_throughput - best_effort_throughput - dynamic - type: 'null' title: Tpm Limit Type router_settings: anyOf: - $ref: '#/components/schemas/UpdateRouterConfig' - type: 'null' access_group_ids: anyOf: - items: type: string type: array - type: 'null' title: Access Group Ids soft_budget: anyOf: - type: number - type: 'null' title: Soft Budget send_invite_email: anyOf: - type: boolean - type: 'null' title: Send Invite Email key_type: anyOf: - $ref: '#/components/schemas/LiteLLMKeyType' - type: 'null' description: Type of key that determines default allowed routes. default: default auto_rotate: anyOf: - type: boolean - type: 'null' title: Auto Rotate description: Whether this key should be automatically rotated default: false rotation_interval: anyOf: - type: string - type: 'null' title: Rotation Interval description: How often to rotate this key (e.g., '30d', '90d'). Required if auto_rotate=True organization_id: anyOf: - type: string - type: 'null' title: Organization Id project_id: anyOf: - type: string - type: 'null' title: Project Id type: object title: GenerateKeyRequest LiteLLM_VerificationToken: properties: token: anyOf: - type: string - type: 'null' title: Token key_name: anyOf: - type: string - type: 'null' title: Key Name key_alias: anyOf: - type: string - type: 'null' title: Key Alias spend: type: number title: Spend default: 0.0 max_budget: anyOf: - type: number - type: 'null' title: Max Budget expires: anyOf: - type: string - type: string format: date-time - type: 'null' title: Expires models: items: {} type: array title: Models default: [] aliases: additionalProperties: true type: object title: Aliases default: {} config: additionalProperties: true type: object title: Config default: {} user_id: anyOf: - type: string - type: 'null' title: User Id team_id: anyOf: - type: string - type: 'null' title: Team Id agent_id: anyOf: - type: string - type: 'null' title: Agent Id project_id: anyOf: - type: string - type: 'null' title: Project Id max_parallel_requests: anyOf: - type: integer - type: 'null' title: Max Parallel Requests metadata: additionalProperties: true type: object title: Metadata default: {} tpm_limit: anyOf: - type: integer - type: 'null' title: Tpm Limit rpm_limit: anyOf: - type: integer - type: 'null' title: Rpm Limit budget_duration: anyOf: - type: string - type: 'null' title: Budget Duration budget_reset_at: anyOf: - type: string format: date-time - type: 'null' title: Budget Reset At allowed_cache_controls: anyOf: - items: {} type: array - type: 'null' title: Allowed Cache Controls default: [] allowed_routes: anyOf: - items: {} type: array - type: 'null' title: Allowed Routes default: [] key_type: anyOf: - type: string - type: 'null' title: Key Type permissions: additionalProperties: true type: object title: Permissions default: {} model_spend: additionalProperties: true type: object title: Model Spend default: {} model_max_budget: additionalProperties: true type: object title: Model Max Budget default: {} budget_fallbacks: additionalProperties: items: type: string type: array type: object title: Budget Fallbacks default: {} soft_budget_cooldown: type: boolean title: Soft Budget Cooldown default: false blocked: anyOf: - type: boolean - type: 'null' title: Blocked litellm_budget_table: anyOf: - additionalProperties: true type: object - type: 'null' title: Litellm Budget Table budget_id: anyOf: - type: string - type: 'null' title: Budget Id org_id: anyOf: - type: string - type: 'null' title: Org Id created_at: anyOf: - type: string format: date-time - type: 'null' title: Created At created_by: anyOf: - type: string - type: 'null' title: Created By updated_at: anyOf: - type: string format: date-time - type: 'null' title: Updated At updated_by: anyOf: - type: string - type: 'null' title: Updated By last_active: anyOf: - type: string format: date-time - type: 'null' title: Last Active object_permission_id: anyOf: - type: string - type: 'null' title: Object Permission Id object_permission: anyOf: - $ref: '#/components/schemas/LiteLLM_ObjectPermissionTable' - type: 'null' access_group_ids: anyOf: - items: type: string type: array - type: 'null' title: Access Group Ids rotation_count: anyOf: - type: integer - type: 'null' title: Rotation Count default: 0 auto_rotate: anyOf: - type: boolean - type: 'null' title: Auto Rotate default: false rotation_interval: anyOf: - type: string - type: 'null' title: Rotation Interval last_rotation_at: anyOf: - type: string format: date-time - type: 'null' title: Last Rotation At key_rotation_at: anyOf: - type: string format: date-time - type: 'null' title: Key Rotation At router_settings: anyOf: - additionalProperties: true type: object - type: 'null' title: Router Settings budget_limits: anyOf: - items: additionalProperties: true type: object type: array - type: 'null' title: Budget Limits type: object title: LiteLLM_VerificationToken KeyUpdateFields: properties: max_budget: anyOf: - type: number - type: 'null' title: Max Budget budget_id: anyOf: - type: string - type: 'null' title: Budget Id budget_duration: anyOf: - type: string - type: 'null' title: Budget Duration budget_limits: anyOf: - items: {} type: array - type: 'null' title: Budget Limits model_max_budget: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Max Budget tpm_limit: anyOf: - type: integer - type: 'null' title: Tpm Limit rpm_limit: anyOf: - type: integer - type: 'null' title: Rpm Limit model_tpm_limit: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Tpm Limit model_rpm_limit: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Rpm Limit max_parallel_requests: anyOf: - type: integer - type: 'null' title: Max Parallel Requests rpm_limit_type: anyOf: - type: string enum: - guaranteed_throughput - best_effort_throughput - dynamic - type: 'null' title: Rpm Limit Type tpm_limit_type: anyOf: - type: string enum: - guaranteed_throughput - best_effort_throughput - dynamic - type: 'null' title: Tpm Limit Type temp_budget_increase: anyOf: - type: number - type: 'null' title: Temp Budget Increase temp_budget_expiry: anyOf: - type: string format: date-time - type: 'null' title: Temp Budget Expiry duration: anyOf: - type: string - type: 'null' title: Duration tags: anyOf: - items: type: string type: array - type: 'null' title: Tags metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata additionalProperties: false type: object title: KeyUpdateFields description: Allowlist of bulk-broadcastable fields for /team/key/bulk_update; `extra="forbid"` blocks RBAC/ownership/scope mutations even by team admins. BulkUpdateKeyRequestItem: properties: key: type: string title: Key budget_id: anyOf: - type: string - type: 'null' title: Budget Id max_budget: anyOf: - type: number - type: 'null' title: Max Budget team_id: anyOf: - type: string - type: 'null' title: Team Id tags: anyOf: - items: type: string type: array - type: 'null' title: Tags type: object required: - key title: BulkUpdateKeyRequestItem description: Individual key update request item KeyListResponseObject: properties: keys: items: anyOf: - type: string - $ref: '#/components/schemas/UserAPIKeyAuth' - $ref: '#/components/schemas/LiteLLM_DeletedVerificationToken' type: array title: Keys total_count: anyOf: - type: integer - type: 'null' title: Total Count current_page: anyOf: - type: integer - type: 'null' title: Current Page total_pages: anyOf: - type: integer - type: 'null' title: Total Pages type: object title: KeyListResponseObject LiteLLM_DeletedVerificationToken: properties: token: anyOf: - type: string - type: 'null' title: Token key_name: anyOf: - type: string - type: 'null' title: Key Name key_alias: anyOf: - type: string - type: 'null' title: Key Alias spend: type: number title: Spend default: 0.0 max_budget: anyOf: - type: number - type: 'null' title: Max Budget expires: anyOf: - type: string - type: string format: date-time - type: 'null' title: Expires models: items: {} type: array title: Models default: [] aliases: additionalProperties: true type: object title: Aliases default: {} config: additionalProperties: true type: object title: Config default: {} user_id: anyOf: - type: string - type: 'null' title: User Id team_id: anyOf: - type: string - type: 'null' title: Team Id agent_id: anyOf: - type: string - type: 'null' title: Agent Id project_id: anyOf: - type: string - type: 'null' title: Project Id max_parallel_requests: anyOf: - type: integer - type: 'null' title: Max Parallel Requests metadata: additionalProperties: true type: object title: Metadata default: {} tpm_limit: anyOf: - type: integer - type: 'null' title: Tpm Limit rpm_limit: anyOf: - type: integer - type: 'null' title: Rpm Limit budget_duration: anyOf: - type: string - type: 'null' title: Budget Duration budget_reset_at: anyOf: - type: string format: date-time - type: 'null' title: Budget Reset At allowed_cache_controls: anyOf: - items: {} type: array - type: 'null' title: Allowed Cache Controls default: [] allowed_routes: anyOf: - items: {} type: array - type: 'null' title: Allowed Routes default: [] key_type: anyOf: - type: string - type: 'null' title: Key Type permissions: additionalProperties: true type: object title: Permissions default: {} model_spend: additionalProperties: true type: object title: Model Spend default: {} model_max_budget: additionalProperties: true type: object title: Model Max Budget default: {} budget_fallbacks: additionalProperties: items: type: string type: array type: object title: Budget Fallbacks default: {} soft_budget_cooldown: type: boolean title: Soft Budget Cooldown default: false blocked: anyOf: - type: boolean - type: 'null' title: Blocked litellm_budget_table: anyOf: - additionalProperties: true type: object - type: 'null' title: Litellm Budget Table budget_id: anyOf: - type: string - type: 'null' title: Budget Id org_id: anyOf: - type: string - type: 'null' title: Org Id created_at: anyOf: - type: string format: date-time - type: 'null' title: Created At created_by: anyOf: - type: string - type: 'null' title: Created By updated_at: anyOf: - type: string format: date-time - type: 'null' title: Updated At updated_by: anyOf: - type: string - type: 'null' title: Updated By last_active: anyOf: - type: string format: date-time - type: 'null' title: Last Active object_permission_id: anyOf: - type: string - type: 'null' title: Object Permission Id object_permission: anyOf: - $ref: '#/components/schemas/LiteLLM_ObjectPermissionTable' - type: 'null' access_group_ids: anyOf: - items: type: string type: array - type: 'null' title: Access Group Ids rotation_count: anyOf: - type: integer - type: 'null' title: Rotation Count default: 0 auto_rotate: anyOf: - type: boolean - type: 'null' title: Auto Rotate default: false rotation_interval: anyOf: - type: string - type: 'null' title: Rotation Interval last_rotation_at: anyOf: - type: string format: date-time - type: 'null' title: Last Rotation At key_rotation_at: anyOf: - type: string format: date-time - type: 'null' title: Key Rotation At router_settings: anyOf: - additionalProperties: true type: object - type: 'null' title: Router Settings budget_limits: anyOf: - items: additionalProperties: true type: object type: array - type: 'null' title: Budget Limits id: anyOf: - type: string - type: 'null' title: Id deleted_at: anyOf: - type: string format: date-time - type: 'null' title: Deleted At deleted_by: anyOf: - type: string - type: 'null' title: Deleted By deleted_by_api_key: anyOf: - type: string - type: 'null' title: Deleted By Api Key litellm_changed_by: anyOf: - type: string - type: 'null' title: Litellm Changed By type: object title: LiteLLM_DeletedVerificationToken description: Audit record for deleted keys; mirrors the token plus deletion metadata. RegenerateKeyRequest: properties: key_alias: anyOf: - type: string - type: 'null' title: Key Alias duration: anyOf: - type: string - type: 'null' title: Duration models: anyOf: - items: {} type: array - type: 'null' title: Models default: [] spend: anyOf: - type: number - type: 'null' title: Spend max_budget: anyOf: - type: number - type: 'null' title: Max Budget user_id: anyOf: - type: string - type: 'null' title: User Id team_id: anyOf: - type: string - type: 'null' title: Team Id agent_id: anyOf: - type: string - type: 'null' title: Agent Id max_parallel_requests: anyOf: - type: integer - type: 'null' title: Max Parallel Requests metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata tpm_limit: anyOf: - type: integer - type: 'null' title: Tpm Limit rpm_limit: anyOf: - type: integer - type: 'null' title: Rpm Limit budget_duration: anyOf: - type: string - type: 'null' title: Budget Duration budget_limits: anyOf: - items: $ref: '#/components/schemas/BudgetLimitEntry' type: array - type: 'null' title: Budget Limits allowed_cache_controls: anyOf: - items: {} type: array - type: 'null' title: Allowed Cache Controls default: [] config: anyOf: - additionalProperties: true type: object - type: 'null' title: Config default: {} permissions: anyOf: - additionalProperties: true type: object - type: 'null' title: Permissions default: {} model_max_budget: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Max Budget default: {} budget_fallbacks: anyOf: - additionalProperties: items: type: string type: array type: object - type: 'null' title: Budget Fallbacks model_rpm_limit: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Rpm Limit model_tpm_limit: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Tpm Limit mcp_rpm_limit: anyOf: - additionalProperties: type: integer type: object - type: 'null' title: Mcp Rpm Limit tag_rpm_limit: anyOf: - additionalProperties: type: integer type: object - type: 'null' title: Tag Rpm Limit guardrails: anyOf: - items: type: string type: array - type: 'null' title: Guardrails policies: anyOf: - items: type: string type: array - type: 'null' title: Policies prompts: anyOf: - items: type: string type: array - type: 'null' title: Prompts blocked: anyOf: - type: boolean - type: 'null' title: Blocked aliases: anyOf: - additionalProperties: true type: object - type: 'null' title: Aliases default: {} object_permission: anyOf: - $ref: '#/components/schemas/LiteLLM_ObjectPermissionBase' - type: 'null' key: anyOf: - type: string - type: 'null' title: Key budget_id: anyOf: - type: string - type: 'null' title: Budget Id tags: anyOf: - items: type: string type: array - type: 'null' title: Tags disable_global_guardrails: anyOf: - type: boolean - type: 'null' title: Disable Global Guardrails throttle_on_budget_exceeded: anyOf: - type: boolean - type: 'null' title: Throttle On Budget Exceeded enforced_params: anyOf: - items: type: string type: array - type: 'null' title: Enforced Params allowed_routes: anyOf: - items: {} type: array - type: 'null' title: Allowed Routes default: [] allowed_passthrough_routes: anyOf: - items: {} type: array - type: 'null' title: Allowed Passthrough Routes allowed_vector_store_indexes: anyOf: - items: $ref: '#/components/schemas/AllowedVectorStoreIndexItem' type: array - type: 'null' title: Allowed Vector Store Indexes rpm_limit_type: anyOf: - type: string enum: - guaranteed_throughput - best_effort_throughput - dynamic - type: 'null' title: Rpm Limit Type tpm_limit_type: anyOf: - type: string enum: - guaranteed_throughput - best_effort_throughput - dynamic - type: 'null' title: Tpm Limit Type router_settings: anyOf: - $ref: '#/components/schemas/UpdateRouterConfig' - type: 'null' access_group_ids: anyOf: - items: type: string type: array - type: 'null' title: Access Group Ids soft_budget: anyOf: - type: number - type: 'null' title: Soft Budget send_invite_email: anyOf: - type: boolean - type: 'null' title: Send Invite Email key_type: anyOf: - $ref: '#/components/schemas/LiteLLMKeyType' - type: 'null' description: Type of key that determines default allowed routes. default: default auto_rotate: anyOf: - type: boolean - type: 'null' title: Auto Rotate description: Whether this key should be automatically rotated default: false rotation_interval: anyOf: - type: string - type: 'null' title: Rotation Interval description: How often to rotate this key (e.g., '30d', '90d'). Required if auto_rotate=True organization_id: anyOf: - type: string - type: 'null' title: Organization Id project_id: anyOf: - type: string - type: 'null' title: Project Id new_key: anyOf: - type: string - type: 'null' title: New Key new_master_key: anyOf: - type: string - type: 'null' title: New Master Key grace_period: anyOf: - type: string - type: 'null' title: Grace Period type: object title: RegenerateKeyRequest 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 UpdateKeyRequest: properties: key_alias: anyOf: - type: string - type: 'null' title: Key Alias duration: anyOf: - type: string - type: 'null' title: Duration models: anyOf: - items: {} type: array - type: 'null' title: Models default: [] spend: anyOf: - type: number - type: 'null' title: Spend max_budget: anyOf: - type: number - type: 'null' title: Max Budget user_id: anyOf: - type: string - type: 'null' title: User Id team_id: anyOf: - type: string - type: 'null' title: Team Id agent_id: anyOf: - type: string - type: 'null' title: Agent Id max_parallel_requests: anyOf: - type: integer - type: 'null' title: Max Parallel Requests metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata tpm_limit: anyOf: - type: integer - type: 'null' title: Tpm Limit rpm_limit: anyOf: - type: integer - type: 'null' title: Rpm Limit budget_duration: anyOf: - type: string - type: 'null' title: Budget Duration budget_limits: anyOf: - items: $ref: '#/components/schemas/BudgetLimitEntry' type: array - type: 'null' title: Budget Limits allowed_cache_controls: anyOf: - items: {} type: array - type: 'null' title: Allowed Cache Controls default: [] config: anyOf: - additionalProperties: true type: object - type: 'null' title: Config default: {} permissions: anyOf: - additionalProperties: true type: object - type: 'null' title: Permissions default: {} model_max_budget: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Max Budget default: {} budget_fallbacks: anyOf: - additionalProperties: items: type: string type: array type: object - type: 'null' title: Budget Fallbacks model_rpm_limit: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Rpm Limit model_tpm_limit: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Tpm Limit mcp_rpm_limit: anyOf: - additionalProperties: type: integer type: object - type: 'null' title: Mcp Rpm Limit tag_rpm_limit: anyOf: - additionalProperties: type: integer type: object - type: 'null' title: Tag Rpm Limit guardrails: anyOf: - items: type: string type: array - type: 'null' title: Guardrails policies: anyOf: - items: type: string type: array - type: 'null' title: Policies prompts: anyOf: - items: type: string type: array - type: 'null' title: Prompts blocked: anyOf: - type: boolean - type: 'null' title: Blocked aliases: anyOf: - additionalProperties: true type: object - type: 'null' title: Aliases default: {} object_permission: anyOf: - $ref: '#/components/schemas/LiteLLM_ObjectPermissionBase' - type: 'null' key: type: string title: Key budget_id: anyOf: - type: string - type: 'null' title: Budget Id tags: anyOf: - items: type: string type: array - type: 'null' title: Tags disable_global_guardrails: anyOf: - type: boolean - type: 'null' title: Disable Global Guardrails throttle_on_budget_exceeded: anyOf: - type: boolean - type: 'null' title: Throttle On Budget Exceeded enforced_params: anyOf: - items: type: string type: array - type: 'null' title: Enforced Params allowed_routes: anyOf: - items: {} type: array - type: 'null' title: Allowed Routes default: [] allowed_passthrough_routes: anyOf: - items: {} type: array - type: 'null' title: Allowed Passthrough Routes allowed_vector_store_indexes: anyOf: - items: $ref: '#/components/schemas/AllowedVectorStoreIndexItem' type: array - type: 'null' title: Allowed Vector Store Indexes rpm_limit_type: anyOf: - type: string enum: - guaranteed_throughput - best_effort_throughput - dynamic - type: 'null' title: Rpm Limit Type tpm_limit_type: anyOf: - type: string enum: - guaranteed_throughput - best_effort_throughput - dynamic - type: 'null' title: Tpm Limit Type router_settings: anyOf: - $ref: '#/components/schemas/UpdateRouterConfig' - type: 'null' access_group_ids: anyOf: - items: type: string type: array - type: 'null' title: Access Group Ids temp_budget_increase: anyOf: - type: number - type: 'null' title: Temp Budget Increase temp_budget_expiry: anyOf: - type: string format: date-time - type: 'null' title: Temp Budget Expiry auto_rotate: anyOf: - type: boolean - type: 'null' title: Auto Rotate rotation_interval: anyOf: - type: string - type: 'null' title: Rotation Interval organization_id: anyOf: - type: string - type: 'null' title: Organization Id type: object required: - key title: UpdateKeyRequest LoggingCallbackStatus: properties: callbacks: items: type: string type: array title: Callbacks status: type: string enum: - healthy - unhealthy title: Status details: anyOf: - type: string - type: 'null' title: Details type: object title: LoggingCallbackStatus LiteLLM_ObjectPermissionTable: properties: object_permission_id: type: string title: Object Permission Id mcp_servers: anyOf: - items: type: string type: array - type: 'null' title: Mcp Servers default: [] mcp_access_groups: anyOf: - items: type: string type: array - type: 'null' title: Mcp Access Groups default: [] mcp_tool_permissions: anyOf: - additionalProperties: items: type: string type: array type: object - type: 'null' title: Mcp Tool Permissions vector_stores: anyOf: - items: type: string type: array - type: 'null' title: Vector Stores default: [] agents: anyOf: - items: type: string type: array - type: 'null' title: Agents default: [] agent_access_groups: anyOf: - items: type: string type: array - type: 'null' title: Agent Access Groups default: [] models: anyOf: - items: type: string type: array - type: 'null' title: Models default: [] mcp_toolsets: anyOf: - items: type: string type: array - type: 'null' title: Mcp Toolsets blocked_tools: anyOf: - items: type: string type: array - type: 'null' title: Blocked Tools default: [] search_tools: anyOf: - items: type: string type: array - type: 'null' title: Search Tools default: [] mcp_tool_search_enabled: anyOf: - type: boolean - type: 'null' title: Mcp Tool Search Enabled type: object required: - object_permission_id title: LiteLLM_ObjectPermissionTable description: Represents a LiteLLM_ObjectPermissionTable record SuccessfulKeyUpdate: properties: key: type: string title: Key key_info: additionalProperties: true type: object title: Key Info type: object required: - key - key_info title: SuccessfulKeyUpdate description: Successfully updated key with its updated information RoutingGroup: properties: group_name: type: string title: Group Name models: items: type: string type: array title: Models routing_strategy: type: string title: Routing Strategy routing_strategy_args: anyOf: - additionalProperties: true type: object - type: 'null' title: Routing Strategy Args type: object required: - group_name - models - routing_strategy title: RoutingGroup description: A group of models that share a routing strategy. BlockKeyRequest: properties: key: type: string title: Key type: object required: - key title: BlockKeyRequest GenerateKeyResponse: properties: key_alias: anyOf: - type: string - type: 'null' title: Key Alias duration: anyOf: - type: string - type: 'null' title: Duration models: anyOf: - items: {} type: array - type: 'null' title: Models default: [] spend: anyOf: - type: number - type: 'null' title: Spend default: 0 max_budget: anyOf: - type: number - type: 'null' title: Max Budget user_id: anyOf: - type: string - type: 'null' title: User Id team_id: anyOf: - type: string - type: 'null' title: Team Id agent_id: anyOf: - type: string - type: 'null' title: Agent Id max_parallel_requests: anyOf: - type: integer - type: 'null' title: Max Parallel Requests metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata default: {} tpm_limit: anyOf: - type: integer - type: 'null' title: Tpm Limit rpm_limit: anyOf: - type: integer - type: 'null' title: Rpm Limit budget_duration: anyOf: - type: string - type: 'null' title: Budget Duration budget_limits: anyOf: - items: $ref: '#/components/schemas/BudgetLimitEntry' type: array - type: 'null' title: Budget Limits allowed_cache_controls: anyOf: - items: {} type: array - type: 'null' title: Allowed Cache Controls default: [] config: anyOf: - additionalProperties: true type: object - type: 'null' title: Config default: {} permissions: anyOf: - additionalProperties: true type: object - type: 'null' title: Permissions default: {} model_max_budget: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Max Budget default: {} budget_fallbacks: anyOf: - additionalProperties: items: type: string type: array type: object - type: 'null' title: Budget Fallbacks model_rpm_limit: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Rpm Limit model_tpm_limit: anyOf: - additionalProperties: true type: object - type: 'null' title: Model Tpm Limit mcp_rpm_limit: anyOf: - additionalProperties: type: integer type: object - type: 'null' title: Mcp Rpm Limit tag_rpm_limit: anyOf: - additionalProperties: type: integer type: object - type: 'null' title: Tag Rpm Limit guardrails: anyOf: - items: type: string type: array - type: 'null' title: Guardrails policies: anyOf: - items: type: string type: array - type: 'null' title: Policies prompts: anyOf: - items: type: string type: array - type: 'null' title: Prompts blocked: anyOf: - type: boolean - type: 'null' title: Blocked aliases: anyOf: - additionalProperties: true type: object - type: 'null' title: Aliases default: {} object_permission: anyOf: - $ref: '#/components/schemas/LiteLLM_ObjectPermissionBase' - type: 'null' key: type: string title: Key budget_id: anyOf: - type: string - type: 'null' title: Budget Id tags: anyOf: - items: type: string type: array - type: 'null' title: Tags disable_global_guardrails: anyOf: - type: boolean - type: 'null' title: Disable Global Guardrails throttle_on_budget_exceeded: anyOf: - type: boolean - type: 'null' title: Throttle On Budget Exceeded enforced_params: anyOf: - items: type: string type: array - type: 'null' title: Enforced Params allowed_routes: anyOf: - items: {} type: array - type: 'null' title: Allowed Routes default: [] allowed_passthrough_routes: anyOf: - items: {} type: array - type: 'null' title: Allowed Passthrough Routes allowed_vector_store_indexes: anyOf: - items: $ref: '#/components/schemas/AllowedVectorStoreIndexItem' type: array - type: 'null' title: Allowed Vector Store Indexes rpm_limit_type: anyOf: - type: string enum: - guaranteed_throughput - best_effort_throughput - dynamic - type: 'null' title: Rpm Limit Type tpm_limit_type: anyOf: - type: string enum: - guaranteed_throughput - best_effort_throughput - dynamic - type: 'null' title: Tpm Limit Type router_settings: anyOf: - $ref: '#/components/schemas/UpdateRouterConfig' - type: 'null' access_group_ids: anyOf: - items: type: string type: array - type: 'null' title: Access Group Ids key_name: anyOf: - type: string - type: 'null' title: Key Name key_type: anyOf: - type: string - type: 'null' title: Key Type expires: anyOf: - type: string format: date-time - type: 'null' title: Expires token_id: anyOf: - type: string - type: 'null' title: Token Id organization_id: anyOf: - type: string - type: 'null' title: Organization Id project_id: anyOf: - type: string - type: 'null' title: Project Id litellm_budget_table: anyOf: - {} - type: 'null' title: Litellm Budget Table token: anyOf: - type: string - type: 'null' title: Token created_by: anyOf: - type: string - type: 'null' title: Created By updated_by: anyOf: - type: string - type: 'null' title: Updated By created_at: anyOf: - type: string format: date-time - type: 'null' title: Created At updated_at: anyOf: - type: string format: date-time - type: 'null' title: Updated At type: object required: - key title: GenerateKeyResponse Member: properties: user_id: anyOf: - type: string - type: 'null' title: User Id description: The unique ID of the user to add. Either user_id or user_email must be provided user_email: anyOf: - type: string - type: 'null' title: User Email description: The email address of the user to add. Either user_id or user_email must be provided role: type: string enum: - admin - user title: Role description: The role of the user within the team. 'admin' users can manage team settings and members, 'user' is a regular team member type: object required: - role title: Member BulkUpdateKeyRequest: properties: keys: items: $ref: '#/components/schemas/BulkUpdateKeyRequestItem' type: array title: Keys type: object required: - keys title: BulkUpdateKeyRequest description: Request for bulk key updates HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError LiteLLM_ObjectPermissionBase: properties: mcp_servers: anyOf: - items: type: string type: array - type: 'null' title: Mcp Servers mcp_access_groups: anyOf: - items: type: string type: array - type: 'null' title: Mcp Access Groups mcp_tool_permissions: anyOf: - additionalProperties: items: type: string type: array type: object - type: 'null' title: Mcp Tool Permissions mcp_toolsets: anyOf: - items: type: string type: array - type: 'null' title: Mcp Toolsets blocked_tools: anyOf: - items: type: string type: array - type: 'null' title: Blocked Tools vector_stores: anyOf: - items: type: string type: array - type: 'null' title: Vector Stores agents: anyOf: - items: type: string type: array - type: 'null' title: Agents agent_access_groups: anyOf: - items: type: string type: array - type: 'null' title: Agent Access Groups models: anyOf: - items: type: string type: array - type: 'null' title: Models search_tools: anyOf: - items: type: string type: array - type: 'null' title: Search Tools mcp_tool_search_enabled: anyOf: - type: boolean - type: 'null' title: Mcp Tool Search Enabled type: object title: LiteLLM_ObjectPermissionBase BudgetLimitEntry: properties: budget_duration: type: string title: Budget Duration max_budget: type: number title: Max Budget reset_at: anyOf: - type: string format: date-time - type: 'null' title: Reset At type: object required: - budget_duration - max_budget title: BudgetLimitEntry description: A single budget window with its own limit and independent reset schedule. LiteLLMKeyType: type: string enum: - llm_api - management - read_only - default title: LiteLLMKeyType description: Enum for key types that determine what routes a key can access ResetSpendRequest: properties: reset_to: type: number title: Reset To type: object required: - reset_to title: ResetSpendRequest UpdateRouterConfig: properties: routing_strategy_args: anyOf: - additionalProperties: true type: object - type: 'null' title: Routing Strategy Args routing_strategy: anyOf: - type: string - type: 'null' title: Routing Strategy routing_groups: anyOf: - items: $ref: '#/components/schemas/RoutingGroup' type: array - type: 'null' title: Routing Groups retry_policy: anyOf: - $ref: '#/components/schemas/RetryPolicy' - type: 'null' model_group_retry_policy: anyOf: - additionalProperties: $ref: '#/components/schemas/RetryPolicy' type: object - type: 'null' title: Model Group Retry Policy model_group_affinity_config: anyOf: - additionalProperties: items: type: string type: array type: object - type: 'null' title: Model Group Affinity Config allowed_fails: anyOf: - type: integer - type: 'null' title: Allowed Fails cooldown_time: anyOf: - type: number - type: 'null' title: Cooldown Time num_retries: anyOf: - type: integer - type: 'null' title: Num Retries timeout: anyOf: - type: number - type: 'null' title: Timeout max_retries: anyOf: - type: integer - type: 'null' title: Max Retries retry_after: anyOf: - type: number - type: 'null' title: Retry After fallbacks: anyOf: - items: additionalProperties: true type: object type: array - type: 'null' title: Fallbacks context_window_fallbacks: anyOf: - items: additionalProperties: true type: object type: array - type: 'null' title: Context Window Fallbacks model_group_alias: anyOf: - additionalProperties: anyOf: - type: string - additionalProperties: true type: object type: object - type: 'null' title: Model Group Alias default: {} enable_tag_filtering: anyOf: - type: boolean - type: 'null' title: Enable Tag Filtering type: object title: UpdateRouterConfig description: Set of params that you can modify via `router.update_settings()`. BulkUpdateKeyResponse: properties: total_requested: type: integer title: Total Requested successful_updates: items: $ref: '#/components/schemas/SuccessfulKeyUpdate' type: array title: Successful Updates failed_updates: items: $ref: '#/components/schemas/FailedKeyUpdate' type: array title: Failed Updates type: object required: - total_requested - successful_updates - failed_updates title: BulkUpdateKeyResponse description: Response for bulk key update operations FailedKeyUpdate: properties: key: type: string title: Key key_info: anyOf: - additionalProperties: true type: object - type: 'null' title: Key Info failed_reason: type: string title: Failed Reason type: object required: - key - failed_reason title: FailedKeyUpdate description: Failed key update with reason KeyHealthResponse: properties: key: type: string enum: - healthy - unhealthy title: Key logging_callbacks: anyOf: - $ref: '#/components/schemas/LoggingCallbackStatus' - type: 'null' type: object title: KeyHealthResponse securitySchemes: APIKeyHeader: type: apiKey description: Bearer token in: header name: x-litellm-api-key