{
  "components": {
    "schemas": {
      "BudgetResponse": {
        "description": "Response model for budget information.",
        "properties": {
          "budget_duration_sec": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Duration Sec"
          },
          "budget_id": {
            "title": "Budget Id",
            "type": "string"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "max_budget": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Budget"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "budget_id",
          "max_budget",
          "budget_duration_sec",
          "created_at",
          "updated_at"
        ],
        "title": "BudgetResponse",
        "type": "object"
      },
      "ChatCompletionRequest": {
        "description": "OpenAI-compatible chat completion request.",
        "properties": {
          "max_completion_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Completion Tokens"
          },
          "max_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens"
          },
          "messages": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "minItems": 1,
            "title": "Messages",
            "type": "array"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "response_format": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Format"
          },
          "stream": {
            "default": false,
            "title": "Stream",
            "type": "boolean"
          },
          "stream_options": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stream Options"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "tool_choice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Choice"
          },
          "tools": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools"
          },
          "top_p": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top P"
          },
          "user": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User"
          }
        },
        "required": [
          "model",
          "messages"
        ],
        "title": "ChatCompletionRequest",
        "type": "object"
      },
      "CreateBudgetRequest": {
        "description": "Request model for creating a new budget.",
        "properties": {
          "budget_duration_sec": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Budget duration in seconds (e.g., 86400 for daily, 604800 for weekly)",
            "title": "Budget Duration Sec"
          },
          "max_budget": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum spending limit",
            "title": "Max Budget"
          }
        },
        "title": "CreateBudgetRequest",
        "type": "object"
      },
      "CreateKeyRequest": {
        "description": "Request model for creating a new API key.",
        "properties": {
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional expiration timestamp",
            "title": "Expires At"
          },
          "key_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional name for the key",
            "title": "Key Name"
          },
          "metadata": {
            "additionalProperties": true,
            "description": "Optional metadata",
            "title": "Metadata",
            "type": "object"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional user ID to associate with this key",
            "title": "User Id"
          }
        },
        "title": "CreateKeyRequest",
        "type": "object"
      },
      "CreateKeyResponse": {
        "description": "Response model for creating a new API key.",
        "properties": {
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "key_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Name"
          },
          "metadata": {
            "additionalProperties": true,
            "title": "Metadata",
            "type": "object"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          }
        },
        "required": [
          "id",
          "key",
          "key_name",
          "user_id",
          "created_at",
          "expires_at",
          "is_active",
          "metadata"
        ],
        "title": "CreateKeyResponse",
        "type": "object"
      },
      "CreateUserRequest": {
        "description": "Request model for creating a new user.",
        "properties": {
          "alias": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional admin-facing alias",
            "title": "Alias"
          },
          "blocked": {
            "default": false,
            "description": "Whether user is blocked",
            "title": "Blocked",
            "type": "boolean"
          },
          "budget_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional budget ID",
            "title": "Budget Id"
          },
          "metadata": {
            "additionalProperties": true,
            "description": "Optional metadata",
            "title": "Metadata",
            "type": "object"
          },
          "user_id": {
            "description": "Unique user identifier",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id"
        ],
        "title": "CreateUserRequest",
        "type": "object"
      },
      "EmbeddingRequest": {
        "description": "OpenAI-compatible embedding request.",
        "properties": {
          "dimensions": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions"
          },
          "encoding_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Encoding Format"
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            ],
            "description": "Input text to embed",
            "title": "Input"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "user": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User"
          }
        },
        "required": [
          "model",
          "input"
        ],
        "title": "EmbeddingRequest",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "KeyInfo": {
        "description": "Response model for key information.",
        "properties": {
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "key_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Name"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "metadata": {
            "additionalProperties": true,
            "title": "Metadata",
            "type": "object"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          }
        },
        "required": [
          "id",
          "key_name",
          "user_id",
          "created_at",
          "last_used_at",
          "expires_at",
          "is_active",
          "metadata"
        ],
        "title": "KeyInfo",
        "type": "object"
      },
      "MessagesRequest": {
        "description": "Anthropic Messages API-compatible request.",
        "properties": {
          "cache_control": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Control"
          },
          "max_tokens": {
            "title": "Max Tokens",
            "type": "integer"
          },
          "messages": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "minItems": 1,
            "title": "Messages",
            "type": "array"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "stop_sequences": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop Sequences"
          },
          "stream": {
            "default": false,
            "title": "Stream",
            "type": "boolean"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "thinking": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Thinking"
          },
          "tool_choice": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Choice"
          },
          "tools": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools"
          },
          "top_k": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top K"
          },
          "top_p": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top P"
          }
        },
        "required": [
          "model",
          "messages",
          "max_tokens"
        ],
        "title": "MessagesRequest",
        "type": "object"
      },
      "ModelListResponse": {
        "description": "OpenAI-compatible model list response.",
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ModelObject"
            },
            "title": "Data",
            "type": "array"
          },
          "object": {
            "default": "list",
            "title": "Object",
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "title": "ModelListResponse",
        "type": "object"
      },
      "ModelObject": {
        "description": "OpenAI-compatible model object.",
        "properties": {
          "created": {
            "title": "Created",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "object": {
            "default": "model",
            "title": "Object",
            "type": "string"
          },
          "owned_by": {
            "title": "Owned By",
            "type": "string"
          }
        },
        "required": [
          "id",
          "created",
          "owned_by"
        ],
        "title": "ModelObject",
        "type": "object"
      },
      "PricingResponse": {
        "description": "Response model for model pricing.",
        "properties": {
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "input_price_per_million": {
            "title": "Input Price Per Million",
            "type": "number"
          },
          "model_key": {
            "title": "Model Key",
            "type": "string"
          },
          "output_price_per_million": {
            "title": "Output Price Per Million",
            "type": "number"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "model_key",
          "input_price_per_million",
          "output_price_per_million",
          "created_at",
          "updated_at"
        ],
        "title": "PricingResponse",
        "type": "object"
      },
      "SetPricingRequest": {
        "description": "Request model for setting model pricing.",
        "properties": {
          "input_price_per_million": {
            "description": "Price per 1M input tokens",
            "minimum": 0.0,
            "title": "Input Price Per Million",
            "type": "number"
          },
          "model_key": {
            "description": "Model identifier in format 'provider:model'",
            "title": "Model Key",
            "type": "string"
          },
          "output_price_per_million": {
            "description": "Price per 1M output tokens",
            "minimum": 0.0,
            "title": "Output Price Per Million",
            "type": "number"
          }
        },
        "required": [
          "model_key",
          "input_price_per_million",
          "output_price_per_million"
        ],
        "title": "SetPricingRequest",
        "type": "object"
      },
      "UpdateBudgetRequest": {
        "description": "Request model for updating a budget.",
        "properties": {
          "budget_duration_sec": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Duration Sec"
          },
          "max_budget": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Budget"
          }
        },
        "title": "UpdateBudgetRequest",
        "type": "object"
      },
      "UpdateKeyRequest": {
        "description": "Request model for updating a key.",
        "properties": {
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "key_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Name"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          }
        },
        "title": "UpdateKeyRequest",
        "type": "object"
      },
      "UpdateUserRequest": {
        "description": "Request model for updating a user.",
        "properties": {
          "alias": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Alias"
          },
          "blocked": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked"
          },
          "budget_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Id"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          }
        },
        "title": "UpdateUserRequest",
        "type": "object"
      },
      "UsageLogResponse": {
        "description": "Response model for usage log.",
        "properties": {
          "api_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key Id"
          },
          "completion_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion Tokens"
          },
          "cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost"
          },
          "endpoint": {
            "title": "Endpoint",
            "type": "string"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "prompt_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Tokens"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "timestamp": {
            "title": "Timestamp",
            "type": "string"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          }
        },
        "required": [
          "id",
          "user_id",
          "api_key_id",
          "timestamp",
          "model",
          "provider",
          "endpoint",
          "prompt_tokens",
          "completion_tokens",
          "total_tokens",
          "cost",
          "status",
          "error_message"
        ],
        "title": "UsageLogResponse",
        "type": "object"
      },
      "UserResponse": {
        "description": "Response model for user information.",
        "properties": {
          "alias": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Alias"
          },
          "blocked": {
            "title": "Blocked",
            "type": "boolean"
          },
          "budget_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Id"
          },
          "budget_started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Started At"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "title": "Metadata",
            "type": "object"
          },
          "next_budget_reset_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Budget Reset At"
          },
          "spend": {
            "title": "Spend",
            "type": "number"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "alias",
          "spend",
          "budget_id",
          "budget_started_at",
          "next_budget_reset_at",
          "blocked",
          "created_at",
          "updated_at",
          "metadata"
        ],
        "title": "UserResponse",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      }
    }
  },
  "info": {
    "description": "A clean FastAPI gateway for any-llm with API key management",
    "title": "any-llm-gateway",
    "version": "0.0.0.dev0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/health": {
      "get": {
        "description": "General health check endpoint.\n\nReturns basic health status. For infrastructure monitoring,\nuse /health/readiness or /health/liveness instead.",
        "operationId": "health_check_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Health Check Health Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health Check",
        "tags": [
          "health"
        ]
      }
    },
    "/health/liveness": {
      "get": {
        "description": "Liveness probe endpoint.\n\nSimple check to verify the process is alive and responding.\nUsed by Kubernetes/container orchestrators for liveness probes.\n\nReturns:\n    Plain text \"I'm alive!\" message",
        "operationId": "health_liveness_health_liveness_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Health Liveness Health Liveness Get",
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health Liveness",
        "tags": [
          "health"
        ]
      }
    },
    "/health/readiness": {
      "get": {
        "description": "Readiness probe endpoint.\n\nChecks if the gateway is ready to serve requests by validating:\n- Database connectivity\n- Service availability\n\nUsed by Kubernetes/container orchestrators for readiness probes.\nReturns HTTP 503 if any dependency is unavailable.\n\nReturns:\n    dict: Status object with health details\n\nRaises:\n    HTTPException: 503 if service is not ready",
        "operationId": "health_readiness_health_readiness_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Health Readiness Health Readiness Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health Readiness",
        "tags": [
          "health"
        ]
      }
    },
    "/v1/budgets": {
      "get": {
        "description": "List all budgets with pagination.",
        "operationId": "list_budgets_v1_budgets_get",
        "parameters": [
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Skip",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/BudgetResponse"
                  },
                  "title": "Response List Budgets V1 Budgets Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Budgets",
        "tags": [
          "budgets"
        ]
      },
      "post": {
        "description": "Create a new budget.",
        "operationId": "create_budget_v1_budgets_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBudgetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Budget",
        "tags": [
          "budgets"
        ]
      }
    },
    "/v1/budgets/{budget_id}": {
      "delete": {
        "description": "Delete a budget.",
        "operationId": "delete_budget_v1_budgets__budget_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "budget_id",
            "required": true,
            "schema": {
              "title": "Budget Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Budget",
        "tags": [
          "budgets"
        ]
      },
      "get": {
        "description": "Get details of a specific budget.",
        "operationId": "get_budget_v1_budgets__budget_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "budget_id",
            "required": true,
            "schema": {
              "title": "Budget Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Budget",
        "tags": [
          "budgets"
        ]
      },
      "patch": {
        "description": "Update a budget.",
        "operationId": "update_budget_v1_budgets__budget_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "budget_id",
            "required": true,
            "schema": {
              "title": "Budget Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBudgetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Budget",
        "tags": [
          "budgets"
        ]
      }
    },
    "/v1/chat/completions": {
      "post": {
        "description": "OpenAI-compatible chat completions endpoint.\n\nSupports both streaming and non-streaming responses.\nHandles reasoning content from any-llm providers.\n\nAuthentication modes:\n- Master key + user field: Use specified user (must exist)\n- API key + user field: Use specified user (must exist)\n- API key without user field: Use virtual user created with API key",
        "operationId": "chat_completions_v1_chat_completions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Chat Completions",
        "tags": [
          "chat"
        ]
      }
    },
    "/v1/embeddings": {
      "post": {
        "description": "OpenAI-compatible embeddings endpoint.\n\nAuthentication modes:\n- Master key + user field: Use specified user (must exist)\n- API key + user field: Use specified user (must exist)\n- API key without user field: Use virtual user created with API key",
        "operationId": "create_embedding_v1_embeddings_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Embedding",
        "tags": [
          "embeddings"
        ]
      }
    },
    "/v1/keys": {
      "get": {
        "description": "List all API keys.\n\nRequires master key authentication.",
        "operationId": "list_keys_v1_keys_get",
        "parameters": [
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Skip",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/KeyInfo"
                  },
                  "title": "Response List Keys V1 Keys Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Keys",
        "tags": [
          "keys"
        ]
      },
      "post": {
        "description": "Create a new API key.\n\nRequires master key authentication.\n\nIf user_id is provided, the key will be associated with that user (creates user if it doesn't exist).\nIf user_id is not provided, a new user will be created automatically and the key will be associated with it.",
        "operationId": "create_key_v1_keys_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Key",
        "tags": [
          "keys"
        ]
      }
    },
    "/v1/keys/{key_id}": {
      "delete": {
        "description": "Delete (revoke) an API key.\n\nRequires master key authentication.",
        "operationId": "delete_key_v1_keys__key_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "title": "Key Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Key",
        "tags": [
          "keys"
        ]
      },
      "get": {
        "description": "Get details of a specific API key.\n\nRequires master key authentication.",
        "operationId": "get_key_v1_keys__key_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "title": "Key Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyInfo"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Key",
        "tags": [
          "keys"
        ]
      },
      "patch": {
        "description": "Update an API key.\n\nRequires master key authentication.",
        "operationId": "update_key_v1_keys__key_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "title": "Key Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyInfo"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Key",
        "tags": [
          "keys"
        ]
      }
    },
    "/v1/messages": {
      "post": {
        "description": "Anthropic Messages API-compatible endpoint.",
        "operationId": "create_message_v1_messages_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Message",
        "tags": [
          "messages"
        ]
      }
    },
    "/v1/models": {
      "get": {
        "description": "List all available models.\n\nReturns models derived from the model_pricing table in an\nOpenAI-compatible format.",
        "operationId": "list_models_v1_models_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelListResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Models",
        "tags": [
          "models"
        ]
      }
    },
    "/v1/models/{model_id}": {
      "get": {
        "description": "Get details for a specific model.",
        "operationId": "get_model_v1_models__model_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelObject"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Model",
        "tags": [
          "models"
        ]
      }
    },
    "/v1/pricing": {
      "get": {
        "description": "List all model pricing.",
        "operationId": "list_pricing_v1_pricing_get",
        "parameters": [
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Skip",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PricingResponse"
                  },
                  "title": "Response List Pricing V1 Pricing Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Pricing",
        "tags": [
          "pricing"
        ]
      },
      "post": {
        "description": "Set or update pricing for a model.",
        "operationId": "set_pricing_v1_pricing_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPricingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricingResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Pricing",
        "tags": [
          "pricing"
        ]
      }
    },
    "/v1/pricing/{model_key}": {
      "delete": {
        "description": "Delete pricing for a model.",
        "operationId": "delete_pricing_v1_pricing__model_key__delete",
        "parameters": [
          {
            "in": "path",
            "name": "model_key",
            "required": true,
            "schema": {
              "title": "Model Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Pricing",
        "tags": [
          "pricing"
        ]
      },
      "get": {
        "description": "Get pricing for a specific model.",
        "operationId": "get_pricing_v1_pricing__model_key__get",
        "parameters": [
          {
            "in": "path",
            "name": "model_key",
            "required": true,
            "schema": {
              "title": "Model Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricingResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Pricing",
        "tags": [
          "pricing"
        ]
      }
    },
    "/v1/users": {
      "get": {
        "description": "List all users with pagination.",
        "operationId": "list_users_v1_users_get",
        "parameters": [
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Skip",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/UserResponse"
                  },
                  "title": "Response List Users V1 Users Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Users",
        "tags": [
          "users"
        ]
      },
      "post": {
        "description": "Create a new user.",
        "operationId": "create_user_v1_users_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create User",
        "tags": [
          "users"
        ]
      }
    },
    "/v1/users/{user_id}": {
      "delete": {
        "description": "Delete a user.",
        "operationId": "delete_user_v1_users__user_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete User",
        "tags": [
          "users"
        ]
      },
      "get": {
        "description": "Get details of a specific user.",
        "operationId": "get_user_v1_users__user_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get User",
        "tags": [
          "users"
        ]
      },
      "patch": {
        "description": "Update a user.",
        "operationId": "update_user_v1_users__user_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update User",
        "tags": [
          "users"
        ]
      }
    },
    "/v1/users/{user_id}/usage": {
      "get": {
        "description": "Get usage history for a specific user.",
        "operationId": "get_user_usage_v1_users__user_id__usage_get",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Skip",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/UsageLogResponse"
                  },
                  "title": "Response Get User Usage V1 Users  User Id  Usage Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get User Usage",
        "tags": [
          "users"
        ]
      }
    }
  }
}
