{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/anthropic/main/json-schema/anthropic-improve-prompt-response-schema.json",
  "title": "ImprovePromptResponse",
  "x-generated": "2026-09-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/anthropic-prompt-improvement-api-openapi.yml#/components/schemas/ImprovePromptResponse",
  "type": "object",
  "required": [
    "messages",
    "system",
    "usage"
  ],
  "properties": {
    "messages": {
      "type": "array",
      "description": "The improved prompt, incorporating the provided feedback\nand prompt engineering best practices.\n",
      "items": {
        "$ref": "#/$defs/PromptMessage"
      }
    },
    "system": {
      "type": "string",
      "description": "Currently, the system field is always returned as an empty\nstring (\"\"). In future iterations, this field may contain\ngenerated system prompts.\n"
    },
    "usage": {
      "$ref": "#/$defs/UsageInfo"
    }
  },
  "$defs": {
    "PromptMessage": {
      "type": "object",
      "required": [
        "role",
        "content"
      ],
      "properties": {
        "role": {
          "type": "string",
          "enum": [
            "user",
            "assistant"
          ],
          "description": "The role of the message sender"
        },
        "content": {
          "type": "array",
          "description": "The content of the message",
          "items": {
            "$ref": "#/$defs/TextContentBlock"
          }
        }
      }
    },
    "TextContentBlock": {
      "type": "object",
      "required": [
        "type",
        "text"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "text"
          ],
          "description": "The type of content block"
        },
        "text": {
          "type": "string",
          "description": "The text content"
        }
      }
    },
    "UsageInfo": {
      "type": "object",
      "description": "Usage information",
      "required": [
        "input_tokens",
        "output_tokens"
      ],
      "properties": {
        "input_tokens": {
          "type": "integer",
          "description": "Number of input tokens used",
          "minimum": 0
        },
        "output_tokens": {
          "type": "integer",
          "description": "Number of output tokens generated",
          "minimum": 0
        }
      }
    }
  }
}