{ "/fallback": { "post": { "tags": [ "Fallback Management" ], "summary": "Create Fallback", "description": "Create or update fallbacks for a specific model.\n\nThis endpoint allows you to configure fallback models separately from the general config.\nFallbacks are triggered when a model call fails after retries.\n\n**Example Request:**\n```json\n{\n \"model\": \"gpt-3.5-turbo\",\n \"fallback_models\": [\"gpt-4\", \"claude-3-haiku\"],\n \"fallback_type\": \"general\"\n}\n```\n\n**Fallback Types:**\n- `general`: Standard fallbacks for any error (default)\n- `context_window`: Fallbacks specifically for context window exceeded errors\n- `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.\n\n**Parameters:**\n- `model`: The model name to get fallbacks for\n- `fallback_type`: Type of fallback to retrieve (query parameter)\n\n**Example:**\n```\nGET /fallback/gpt-3.5-turbo?fallback_type=general\n```", "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.\n\n**Parameters:**\n- `model`: The model name to delete fallbacks for\n- `fallback_type`: Type of fallback to delete (query parameter)\n\n**Example:**\n```\nDELETE /fallback/gpt-3.5-turbo?fallback_type=general\n```", "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" } } } } } } } }