{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/memtro-com/json-schema/memtro-com-chat-response-schema.json",
  "title": "ChatResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/memtro-com-api-openapi.yml#/components/schemas/ChatResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "object": {
      "type": "string",
      "const": "chat.completion"
    },
    "created": {
      "type": "integer"
    },
    "model": {
      "type": "string",
      "description": "The model that answered",
      "e.g. anthropic/claude-opus-5": null
    },
    "choices": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "message": {
            "type": "object",
            "properties": {
              "role": {
                "type": "string"
              },
              "content": {
                "type": "string"
              },
              "tool_calls": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "finish_reason": {
            "type": "string"
          }
        }
      }
    },
    "usage": {
      "type": "object",
      "properties": {
        "prompt_tokens": {
          "type": "integer"
        },
        "completion_tokens": {
          "type": "integer"
        },
        "total_tokens": {
          "type": "integer"
        }
      }
    },
    "memtro": {
      "type": "object",
      "description": "Memtro metadata",
      "properties": {
        "mode": {
          "type": "string"
        },
        "engine": {
          "type": "string"
        },
        "sandbox": {
          "type": "string"
        },
        "engine_note": {
          "type": "string"
        },
        "routing": {
          "type": "object",
          "properties": {
            "requested": {
              "type": "string"
            },
            "model": {
              "type": "string"
            },
            "complexity": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5
            },
            "method": {
              "type": "string",
              "enum": [
                "heuristic",
                "classifier",
                "fallback"
              ]
            },
            "reason": {
              "type": "string"
            }
          }
        },
        "tools": {
          "type": "array",
          "description": "Every server tool call made while answering",
          "items": {
            "type": "object",
            "properties": {
              "tool": {
                "type": "string"
              },
              "input": {},
              "ok": {
                "type": "boolean"
              },
              "summary": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}