OpenRouter · Schema

ChatMessage

Artificial IntelligenceGatewayLarge Language ModelsRouter

Properties

Name Type Description
role string
content object
name string
tool_call_id string
View JSON Schema on GitHub

JSON Schema

openrouter-chatmessage-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/ChatMessage",
  "title": "ChatMessage",
  "type": "object",
  "required": [
    "role"
  ],
  "properties": {
    "role": {
      "type": "string",
      "enum": [
        "system",
        "user",
        "assistant",
        "tool"
      ]
    },
    "content": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "tool_call_id": {
      "type": "string"
    }
  }
}