{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/teardrop-dev/json-schema/teardrop-dev-upsert-llm-config-request-schema.json",
  "title": "UpsertLlmConfigRequest",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/teardrop-dev-openapi.json#/components/schemas/UpsertLlmConfigRequest",
  "properties": {
    "provider": {
      "type": "string",
      "title": "Provider",
      "description": "LLM provider: openai, google, or openrouter; anthropic requires BYOK"
    },
    "model": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1,
      "title": "Model",
      "description": "Model identifier"
    },
    "api_key": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Api Key",
      "description": "Provider API key (BYOK). Omit to use Teardrop shared key when supported."
    },
    "api_base": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Api Base",
      "description": "Custom base URL for OpenAI-compatible endpoints (vLLM, Ollama, etc.)"
    },
    "max_tokens": {
      "type": "integer",
      "maximum": 200000.0,
      "minimum": 1.0,
      "title": "Max Tokens",
      "default": 4096
    },
    "temperature": {
      "type": "number",
      "maximum": 2.0,
      "minimum": 0.0,
      "title": "Temperature",
      "default": 0.0
    },
    "timeout_seconds": {
      "type": "integer",
      "maximum": 600.0,
      "minimum": 10.0,
      "title": "Timeout Seconds",
      "default": 120
    },
    "routing_preference": {
      "type": "string",
      "title": "Routing Preference",
      "description": "default, cost, speed, or quality",
      "default": "default"
    },
    "reasoning_effort": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Reasoning Effort",
      "description": "Org-wide reasoning effort: none, minimal, low, medium, or high. Omit to use the platform default for each model."
    },
    "model_reasoning_effort": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "title": "Model Reasoning Effort",
      "description": "Per-model reasoning effort overrides keyed 'provider:model' (e.g. {\"openrouter:~anthropic/claude-opus-latest\": \"high\"}). Takes precedence over reasoning_effort, including for smart-routed models."
    }
  },
  "type": "object",
  "required": [
    "provider",
    "model"
  ]
}