{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://wanapis.com/schemas/ChatCompletionResponse.json",
  "title": "ChatCompletionResponse",
  "description": "OpenAI-compatible chat completion response returned by WanAPIs.",
  "type": "object",
  "properties": {
    "id": { "type": "string" },
    "object": { "type": "string", "const": "chat.completion" },
    "created": { "type": "integer", "description": "Unix epoch seconds." },
    "model": { "type": "string" },
    "choices": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": { "type": "integer" },
          "message": { "$ref": "wanapis-chatmessage-schema.json" },
          "finish_reason": { "type": "string" }
        }
      }
    },
    "usage": {
      "type": "object",
      "properties": {
        "prompt_tokens": { "type": "integer" },
        "completion_tokens": { "type": "integer" },
        "total_tokens": { "type": "integer" }
      }
    }
  }
}
