{
  "openapi": "3.1.0",
  "info": {
    "title": "AI Routing Layer \u2014 API Gateway",
    "description": "Unified OpenAI-compatible API gateway for multiple LLM providers.",
    "version": "0.1.0"
  },
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Health",
        "description": "Return the health status of the gateway and its dependencies.",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Health Health Get"
                }
              }
            }
          }
        }
      }
    },
    "/auth/register/{channel}/start": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Register Start",
        "operationId": "register_start_auth_register__channel__start_post",
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Channel"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/auth/register/{channel}/verify": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Register Verify",
        "operationId": "register_verify_auth_register__channel__verify_post",
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Channel"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/auth/refresh": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Refresh",
        "operationId": "refresh_auth_refresh_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Logout",
        "operationId": "logout_auth_logout_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/auth/me": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Me",
        "operationId": "me_auth_me_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/auth/oauth/{provider}/start": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Oauth Start",
        "operationId": "oauth_start_auth_oauth__provider__start_get",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Oauth Start Auth Oauth  Provider  Start Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/auth/oauth/{provider}/callback": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Oauth Callback",
        "operationId": "oauth_callback_auth_oauth__provider__callback_get",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Oauth Callback Auth Oauth  Provider  Callback Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/overview": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "Admin Overview",
        "description": "Return a safe operational snapshot for the Admin Console.",
        "operationId": "admin_overview_v1_admin_overview_get",
        "parameters": [
          {
            "name": "X-Admin-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Admin-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Admin Overview V1 Admin Overview Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/completions": {
      "post": {
        "tags": [
          "Chat Completions"
        ],
        "summary": "Chat Completions",
        "description": "Handle chat completion requests.\n\nApplies all Phase 1 policy checks before forwarding to the Router:\n1. Rate limiting (enforced by ``enforce_budget`` dependency chain)\n2. Monthly budget cap (enforced by ``enforce_budget``)\n3. Model whitelist (enforced inline below)\n\nThen checks the gateway-level prompt cache (Phase 3 \u2014 Task 3.2)\nbefore forwarding to the Router Engine Service.",
        "operationId": "chat_completions_v1_chat_completions_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/embeddings": {
      "post": {
        "tags": [
          "Embeddings"
        ],
        "summary": "Embeddings",
        "description": "Handle embedding requests.",
        "operationId": "embeddings_v1_embeddings_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/keys": {
      "post": {
        "tags": [
          "API Keys"
        ],
        "summary": "Create Key",
        "description": "Create a new API key (admin-only endpoint).",
        "operationId": "create_key_v1_keys_post",
        "parameters": [
          {
            "name": "x-admin-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Admin-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKeyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Create Key V1 Keys Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "API Keys"
        ],
        "summary": "List Keys",
        "description": "List all API keys (admin-only endpoint).",
        "operationId": "list_keys_v1_keys_get",
        "parameters": [
          {
            "name": "x-admin-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Admin-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response List Keys V1 Keys Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/models": {
      "get": {
        "tags": [
          "Models"
        ],
        "summary": "List Models",
        "description": "Return the list of available models and their provider metadata.\n\nPhase 3 \u2014 Task 3.4: Includes data policy tags per provider.",
        "operationId": "list_models_v1_models_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response List Models V1 Models Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/generations/{generation_id}": {
      "get": {
        "tags": [
          "Generations"
        ],
        "summary": "Get Generation",
        "description": "Retrieve detailed metadata for a specific generation.\n\nUsers can only retrieve their own generations. The ``generation_id``\nis returned in the ``X-Generation-Id`` response header of every\nchat completion request.",
        "operationId": "get_generation_v1_generations__generation_id__get",
        "parameters": [
          {
            "name": "generation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Generation Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationRecord"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/privacy/preview": {
      "post": {
        "tags": [
          "Privacy"
        ],
        "summary": "Privacy Preview",
        "description": "Preview masking for an authenticated API-key principal.",
        "operationId": "privacy_preview_v1_privacy_preview_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Privacy Preview V1 Privacy Preview Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiKeyTier": {
        "type": "string",
        "enum": [
          "free",
          "pro",
          "enterprise"
        ],
        "title": "ApiKeyTier",
        "description": "User tier determines default rate limits and quota."
      },
      "ChatChoice": {
        "properties": {
          "index": {
            "type": "integer",
            "title": "Index"
          },
          "message": {
            "$ref": "#/components/schemas/ChatMessage"
          },
          "finish_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finish Reason"
          }
        },
        "type": "object",
        "required": [
          "index",
          "message"
        ],
        "title": "ChatChoice",
        "description": "A single completion choice."
      },
      "ChatCompletionRequest": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            },
            "type": "array",
            "title": "Messages"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 2.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature",
            "default": 1.0
          },
          "max_tokens": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens"
          },
          "stream": {
            "type": "boolean",
            "title": "Stream",
            "default": false
          },
          "user": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "provider": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProviderPreferences"
              },
              {
                "type": "null"
              }
            ]
          },
          "response_format": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Format"
          }
        },
        "type": "object",
        "required": [
          "model",
          "messages"
        ],
        "title": "ChatCompletionRequest",
        "description": "OpenAI-compatible chat completion request.\n\nExtended with ``provider`` preferences for intelligent routing."
      },
      "ChatCompletionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "default": "chat.completion"
          },
          "created": {
            "type": "integer",
            "title": "Created"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "choices": {
            "items": {
              "$ref": "#/components/schemas/ChatChoice"
            },
            "type": "array",
            "title": "Choices"
          },
          "usage": {
            "$ref": "#/components/schemas/UsageInfo"
          },
          "cache_hit": {
            "type": "boolean",
            "title": "Cache Hit",
            "default": false
          },
          "generation_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Generation Id"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created",
          "model",
          "provider",
          "choices",
          "usage"
        ],
        "title": "ChatCompletionResponse",
        "description": "Normalised chat completion response (OpenAI-compatible)."
      },
      "ChatMessage": {
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "user",
              "assistant",
              "tool"
            ],
            "title": "Role"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              }
            ],
            "title": "Content"
          }
        },
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "title": "ChatMessage",
        "description": "A single message in a chat conversation."
      },
      "CreateKeyRequest": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "tier": {
            "$ref": "#/components/schemas/ApiKeyTier",
            "default": "free"
          },
          "monthly_budget_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Monthly Budget Usd"
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "CreateKeyRequest"
      },
      "EmbeddingRequest": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model"
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            ],
            "title": "Input"
          },
          "user": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User"
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "EmbeddingRequest",
        "description": "OpenAI-compatible embedding request."
      },
      "EmbeddingResponse": {
        "properties": {
          "object": {
            "type": "string",
            "title": "Object",
            "default": "list"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/EmbeddingVector"
            },
            "type": "array",
            "title": "Data"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "usage": {
            "$ref": "#/components/schemas/UsageInfo"
          }
        },
        "type": "object",
        "required": [
          "data",
          "model",
          "provider",
          "usage"
        ],
        "title": "EmbeddingResponse",
        "description": "Normalised embedding response."
      },
      "EmbeddingVector": {
        "properties": {
          "object": {
            "type": "string",
            "title": "Object",
            "default": "embedding"
          },
          "index": {
            "type": "integer",
            "title": "Index"
          },
          "embedding": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Embedding"
          }
        },
        "type": "object",
        "required": [
          "index",
          "embedding"
        ],
        "title": "EmbeddingVector",
        "description": "A single embedding vector."
      },
      "GenerationCost": {
        "properties": {
          "prompt_cost_usd": {
            "type": "number",
            "title": "Prompt Cost Usd"
          },
          "completion_cost_usd": {
            "type": "number",
            "title": "Completion Cost Usd"
          },
          "cache_discount_usd": {
            "type": "number",
            "title": "Cache Discount Usd"
          },
          "total_cost_usd": {
            "type": "number",
            "title": "Total Cost Usd"
          },
          "markup_usd": {
            "type": "number",
            "title": "Markup Usd"
          },
          "billed_usd": {
            "type": "number",
            "title": "Billed Usd"
          }
        },
        "type": "object",
        "required": [
          "prompt_cost_usd",
          "completion_cost_usd",
          "cache_discount_usd",
          "total_cost_usd",
          "markup_usd",
          "billed_usd"
        ],
        "title": "GenerationCost",
        "description": "Detailed cost breakdown for a single generation."
      },
      "GenerationRecord": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "usage": {
            "$ref": "#/components/schemas/UsageInfo"
          },
          "cost": {
            "$ref": "#/components/schemas/GenerationCost"
          },
          "latency_ms": {
            "type": "number",
            "title": "Latency Ms"
          },
          "fallback_used": {
            "type": "boolean",
            "title": "Fallback Used"
          },
          "cache_hit": {
            "type": "boolean",
            "title": "Cache Hit"
          }
        },
        "type": "object",
        "required": [
          "id",
          "model",
          "provider",
          "created_at",
          "usage",
          "cost",
          "latency_ms",
          "fallback_used",
          "cache_hit"
        ],
        "title": "GenerationRecord",
        "description": "Public-facing generation detail (Phase 3 \u2014 Task 3.3: /v1/generations).\n\nReturned by ``GET /v1/generations/{generation_id}``."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ProviderPreferences": {
        "properties": {
          "sort": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "price",
                  "throughput",
                  "latency"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Sort"
          },
          "order": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Order"
          },
          "allow_fallbacks": {
            "type": "boolean",
            "title": "Allow Fallbacks",
            "default": true
          },
          "data_collection": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "allow",
                  "deny"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Collection"
          }
        },
        "type": "object",
        "title": "ProviderPreferences",
        "description": "Client-side routing controls (Phase 3 \u2014 Task 3.1).\n\nAllows clients to dictate the routing strategy on a per-request basis,\nmirroring OpenRouter's ``provider`` object.\n\nAttributes:\n    sort: Optimisation axis \u2014 ``\"price\"``, ``\"throughput\"``, or ``\"latency\"``.\n    order: Ordered list of provider slugs to try (e.g. ``[\"anthropic\", \"openai\"]``).\n    allow_fallbacks: When ``False``, the request fails if the first provider\n        is unavailable rather than falling back to the next in the chain.\n    data_collection: Set to ``\"deny\"`` to exclude providers that may train\n        on user data or do not offer Zero Data Retention (ZDR)."
      },
      "UsageInfo": {
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "title": "Prompt Tokens",
            "default": 0
          },
          "completion_tokens": {
            "type": "integer",
            "title": "Completion Tokens",
            "default": 0
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens",
            "default": 0
          },
          "estimated_cost_usd": {
            "type": "number",
            "title": "Estimated Cost Usd",
            "default": 0.0
          },
          "cached_tokens": {
            "type": "integer",
            "title": "Cached Tokens",
            "default": 0
          },
          "cache_discount_usd": {
            "type": "number",
            "title": "Cache Discount Usd",
            "default": 0.0
          },
          "cache_hit": {
            "type": "boolean",
            "title": "Cache Hit",
            "default": false
          }
        },
        "type": "object",
        "title": "UsageInfo",
        "description": "Token usage metadata attached to every completion response."
      },
      "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"
      }
    }
  }
}
