{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/promptster-dev/json-schema/promptster-dev-compare-prompts-request-schema.json",
  "title": "ComparePromptsRequest",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/promptster-dev-openapi.yaml#/components/schemas/ComparePromptsRequest",
  "type": "object",
  "required": [
    "prompt",
    "configurations"
  ],
  "properties": {
    "prompt": {
      "type": "string",
      "minLength": 1,
      "maxLength": 50000,
      "description": "The prompt to send to all providers"
    },
    "configurations": {
      "type": "array",
      "minItems": 2,
      "maxItems": 5,
      "items": {
        "type": "object",
        "required": [
          "provider",
          "model"
        ],
        "properties": {
          "provider": {
            "$ref": "#/$defs/Provider"
          },
          "model": {
            "type": "string"
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 2,
            "default": 0.7
          }
        }
      }
    },
    "max_tokens": {
      "type": "integer",
      "minimum": 1,
      "maximum": 4096,
      "default": 2000
    },
    "system_prompt": {
      "type": "string",
      "maxLength": 50000,
      "description": "System / developer instructions applied to every configuration in the comparison."
    },
    "tools": {
      "allOf": [
        {
          "$ref": "#/$defs/Tools"
        }
      ],
      "description": "Applied to every configuration, like system_prompt."
    },
    "tool_choice": {
      "$ref": "#/$defs/ToolChoice"
    }
  },
  "$defs": {
    "Provider": {
      "type": "string",
      "enum": [
        "openai",
        "anthropic",
        "google",
        "deepseek",
        "xai",
        "groq",
        "mistral",
        "perplexity",
        "together",
        "cerebras",
        "fireworks"
      ],
      "description": "AI provider identifier"
    },
    "ToolChoice": {
      "type": "string",
      "enum": [
        "auto",
        "required",
        "none"
      ],
      "description": "Requires `tools`. `auto` lets the model decide (the provider default), `required` forces a tool call, `none` forbids one. Mapped to Anthropic `{type: auto|any|none}` and Google `functionCallingConfig.mode AUTO|ANY|NONE`. `required` is rejected by some models (Anthropic Fable 5.1 / Opus 5.5 / Sonnet 5.5, DeepSeek thinking models); that comes back as `provider_tools_unsupported`."
    },
    "ToolDefinition": {
      "type": "object",
      "required": [
        "name",
        "description",
        "parameters"
      ],
      "properties": {
        "name": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9_-]{1,64}$",
          "description": "1-64 characters of letters, digits, underscores or hyphens."
        },
        "description": {
          "type": "string",
          "maxLength": 1024
        },
        "parameters": {
          "type": "object",
          "description": "JSON Schema object describing the tool's arguments. Passed to the provider unchanged. At most 16,384 characters when serialised as JSON."
        }
      }
    },
    "Tools": {
      "type": "array",
      "minItems": 1,
      "maxItems": 32,
      "items": {
        "$ref": "#/$defs/ToolDefinition"
      },
      "description": "Single-turn tool selection. The model is asked once with these tools and the response reports which tool it chose (`tool_calls`); nothing is executed and no result is fed back. Tool names must be unique. The same flat shape is sent to every provider (OpenAI-compatible `function` envelope, Anthropic `input_schema`, Google `functionDeclarations`, Perplexity Agent API `type: function`). Tool schemas are billed as input tokens on every call."
    }
  }
}