{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-ai-foundry/json-schema/azure-ai-foundry-chat-completion-request-schema.json",
  "title": "ChatCompletionRequest",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/azure-ai-foundry-chat-completions-api-openapi.yml#/components/schemas/ChatCompletionRequest",
  "type": "object",
  "required": [
    "messages"
  ],
  "properties": {
    "model": {
      "type": "string",
      "description": "Deployment name (for v1 route)"
    },
    "messages": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ChatMessage"
      }
    },
    "temperature": {
      "type": "number"
    },
    "top_p": {
      "type": "number"
    },
    "n": {
      "type": "integer"
    },
    "stream": {
      "type": "boolean"
    },
    "max_tokens": {
      "type": "integer"
    },
    "max_completion_tokens": {
      "type": "integer"
    },
    "stop": {
      "type": [
        "string",
        "array"
      ]
    },
    "presence_penalty": {
      "type": "number"
    },
    "frequency_penalty": {
      "type": "number"
    },
    "user": {
      "type": "string"
    }
  },
  "$defs": {
    "ChatMessage": {
      "type": "object",
      "required": [
        "role"
      ],
      "properties": {
        "role": {
          "type": "string",
          "enum": [
            "system",
            "user",
            "assistant",
            "tool",
            "developer"
          ]
        },
        "content": {
          "type": [
            "string",
            "array",
            "null"
          ]
        },
        "name": {
          "type": "string"
        }
      }
    }
  }
}