openapi: 3.2.0 info: title: LiteLLM Fallback Management API description: 'Proxy Server to call 100+ LLMs in the OpenAI format. **Customize Swagger Docs** 👉 ```LiteLLM Admin Panel on /ui```. Create, Edit Keys with SSO. Having issues? Try ```Fallback Login``` 💸 ```LiteLLM Model Cost Map```. 🔎 ```LiteLLM Model Hub```. See available models on the proxy. **Docs**' version: 1.102.1 tags: - name: Fallback Management paths: /fallback: post: tags: - Fallback Management summary: Create Fallback description: 'Create or update fallbacks for a specific model. This endpoint allows you to configure fallback models separately from the general config. Fallbacks are triggered when a model call fails after retries. **Example Request:** ```json { "model": "gpt-3.5-turbo", "fallback_models": ["gpt-4", "claude-3-haiku"], "fallback_type": "general" } ``` **Fallback Types:** - `general`: Standard fallbacks for any error (default) - `context_window`: Fallbacks specifically for context window exceeded errors - `content_policy`: Fallbacks specifically for content policy violations' operationId: create_fallback_fallback_post requestBody: content: application/json: schema: $ref: '#/components/schemas/FallbackCreateRequest' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/FallbackResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] /fallback/{model}: get: tags: - Fallback Management summary: Get Fallback description: 'Get fallback configuration for a specific model. **Parameters:** - `model`: The model name to get fallbacks for - `fallback_type`: Type of fallback to retrieve (query parameter) **Example:** ``` GET /fallback/gpt-3.5-turbo?fallback_type=general ```' operationId: get_fallback_fallback__model__get security: - APIKeyHeader: [] parameters: - name: model in: path required: true schema: type: string title: Model - name: fallback_type in: query required: false schema: enum: - general - context_window - content_policy type: string default: general title: Fallback Type responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/FallbackGetResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - Fallback Management summary: Delete Fallback description: 'Delete fallback configuration for a specific model. **Parameters:** - `model`: The model name to delete fallbacks for - `fallback_type`: Type of fallback to delete (query parameter) **Example:** ``` DELETE /fallback/gpt-3.5-turbo?fallback_type=general ```' operationId: delete_fallback_fallback__model__delete security: - APIKeyHeader: [] parameters: - name: model in: path required: true schema: type: string title: Model - name: fallback_type in: query required: false schema: enum: - general - context_window - content_policy type: string default: general title: Fallback Type responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/FallbackDeleteResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: FallbackDeleteResponse: properties: model: type: string title: Model description: The model name fallback_type: type: string title: Fallback Type description: Type of fallback message: type: string title: Message description: Success message type: object required: - model - fallback_type - message title: FallbackDeleteResponse description: Response model for deleting fallbacks FallbackGetResponse: properties: model: type: string title: Model description: The model name fallback_models: items: type: string type: array title: Fallback Models description: List of fallback model names fallback_type: type: string title: Fallback Type description: Type of fallback type: object required: - model - fallback_models - fallback_type title: FallbackGetResponse description: Response model for getting fallbacks FallbackResponse: properties: model: type: string title: Model description: The model name fallback_models: items: type: string type: array title: Fallback Models description: List of fallback model names fallback_type: type: string title: Fallback Type description: Type of fallback message: type: string title: Message description: Success message type: object required: - model - fallback_models - fallback_type - message title: FallbackResponse description: Response model for fallback operations 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 FallbackCreateRequest: properties: model: type: string title: Model description: The model name to configure fallbacks for (e.g., 'gpt-3.5-turbo') fallback_models: items: type: string type: array minItems: 1 title: Fallback Models description: List of fallback model names in order of priority fallback_type: type: string enum: - general - context_window - content_policy title: Fallback Type description: 'Type of fallback: ''general'' (default), ''context_window'', or ''content_policy''' default: general type: object required: - model - fallback_models title: FallbackCreateRequest description: Request model for creating/updating fallbacks HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError securitySchemes: APIKeyHeader: type: apiKey description: Bearer token in: header name: x-litellm-api-key