{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aisa-one/json-schema/aisa-one-response-d5-e2470-dd28-b-chat-completion-response-schema.json",
  "title": "ResponseD5E2470Dd28B_ChatCompletionResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aisa-one-sonar-api-openapi.yml#/components/schemas/ResponseD5E2470Dd28B_ChatCompletionResponse",
  "properties": {
    "choices": {
      "items": {
        "properties": {
          "finish_reason": {
            "enum": [
              "stop",
              "length"
            ],
            "type": "string"
          },
          "index": {
            "type": "integer"
          },
          "message": {
            "properties": {
              "content": {
                "description": "The AI-generated answer, with inline citation references like [1][2].",
                "type": "string"
              },
              "role": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "citations": {
      "description": "List of source URLs referenced in the answer.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "created": {
      "description": "Unix timestamp of when the completion was created.",
      "type": "integer"
    },
    "id": {
      "description": "Unique identifier for the completion.",
      "type": "string"
    },
    "model": {
      "description": "The model used for the completion.",
      "type": "string"
    },
    "object": {
      "type": "string"
    },
    "search_results": {
      "description": "Detailed search results with titles, snippets, and URLs.",
      "items": {
        "properties": {
          "date": {
            "type": "string"
          },
          "snippet": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "usage": {
      "properties": {
        "completion_tokens": {
          "type": "integer"
        },
        "prompt_tokens": {
          "type": "integer"
        },
        "search_context_size": {
          "type": "string"
        },
        "total_tokens": {
          "type": "integer"
        }
      },
      "type": "object"
    }
  },
  "type": "object"
}