{
  "components": {
    "schemas": {
      "ClientV2ConversationEvent": {
        "anyOf": [
          {
            "additionalProperties": false,
            "properties": {
              "conversation_id": {
                "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "event_id": {
                "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "occurred_at": {
                "format": "date-time",
                "type": "string"
              },
              "payload": {
                "additionalProperties": false,
                "properties": {
                  "capabilities": {
                    "additionalItems": false,
                    "items": [
                      {
                        "const": "human_handoff_v1",
                        "type": "string"
                      }
                    ],
                    "minItems": 1,
                    "type": "array"
                  },
                  "owner_epoch": {
                    "maximum": 9007199254740991,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "state": {
                    "anyOf": [
                      {
                        "const": "bot_active",
                        "type": "string"
                      },
                      {
                        "const": "handoff_requested",
                        "type": "string"
                      },
                      {
                        "const": "queued",
                        "type": "string"
                      },
                      {
                        "const": "human_active",
                        "type": "string"
                      },
                      {
                        "const": "wrap_up",
                        "type": "string"
                      },
                      {
                        "const": "closed",
                        "type": "string"
                      }
                    ]
                  },
                  "state_version": {
                    "maximum": 9007199254740991,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "required": ["state", "state_version", "owner_epoch", "capabilities"],
                "type": "object"
              },
              "protocol_version": {
                "const": "2.0",
                "type": "string"
              },
              "sequence": {
                "maximum": 9007199254740991,
                "minimum": 1,
                "type": "integer"
              },
              "trace_id": {
                "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "type": {
                "const": "conversation.snapshot",
                "type": "string"
              }
            },
            "required": [
              "protocol_version",
              "event_id",
              "sequence",
              "conversation_id",
              "occurred_at",
              "trace_id",
              "type",
              "payload"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "conversation_id": {
                "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "event_id": {
                "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "occurred_at": {
                "format": "date-time",
                "type": "string"
              },
              "payload": {
                "anyOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "author": {
                        "const": "visitor",
                        "type": "string"
                      },
                      "message_id": {
                        "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                        "type": "string"
                      },
                      "parts": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "text": {
                              "maxLength": 8000,
                              "minLength": 1,
                              "type": "string"
                            },
                            "type": {
                              "const": "text",
                              "type": "string"
                            }
                          },
                          "required": ["type", "text"],
                          "type": "object"
                        },
                        "maxItems": 20,
                        "minItems": 1,
                        "type": "array"
                      }
                    },
                    "required": ["author", "message_id", "parts"],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "assistant_result": {
                        "anyOf": [
                          {
                            "additionalProperties": false,
                            "properties": {
                              "citations": {
                                "items": {
                                  "additionalProperties": false,
                                  "properties": {
                                    "citation_id": {
                                      "pattern": "^cit_[0-9A-HJKMNP-TV-Z]{26}$",
                                      "type": "string"
                                    },
                                    "excerpt": {
                                      "maxLength": 1024,
                                      "minLength": 1,
                                      "type": "string"
                                    },
                                    "title": {
                                      "maxLength": 256,
                                      "minLength": 1,
                                      "type": "string"
                                    },
                                    "url": {
                                      "format": "uri",
                                      "maxLength": 2048,
                                      "minLength": 9,
                                      "pattern": "^https://(?![^/?#]*@)[^\\s]+$",
                                      "type": "string"
                                    }
                                  },
                                  "required": ["citation_id", "title", "excerpt", "url"],
                                  "type": "object"
                                },
                                "maxItems": 20,
                                "minItems": 1,
                                "type": "array"
                              },
                              "outcome": {
                                "const": "answered",
                                "type": "string"
                              },
                              "reason_code": {
                                "type": "null"
                              }
                            },
                            "required": ["outcome", "reason_code", "citations"],
                            "type": "object"
                          },
                          {
                            "additionalProperties": false,
                            "properties": {
                              "citations": {
                                "items": {
                                  "additionalProperties": false,
                                  "properties": {
                                    "citation_id": {
                                      "pattern": "^cit_[0-9A-HJKMNP-TV-Z]{26}$",
                                      "type": "string"
                                    },
                                    "excerpt": {
                                      "maxLength": 1024,
                                      "minLength": 1,
                                      "type": "string"
                                    },
                                    "title": {
                                      "maxLength": 256,
                                      "minLength": 1,
                                      "type": "string"
                                    },
                                    "url": {
                                      "format": "uri",
                                      "maxLength": 2048,
                                      "minLength": 9,
                                      "pattern": "^https://(?![^/?#]*@)[^\\s]+$",
                                      "type": "string"
                                    }
                                  },
                                  "required": ["citation_id", "title", "excerpt", "url"],
                                  "type": "object"
                                },
                                "maxItems": 20,
                                "type": "array"
                              },
                              "outcome": {
                                "const": "refused",
                                "type": "string"
                              },
                              "reason_code": {
                                "anyOf": [
                                  {
                                    "const": "knowledge_insufficient",
                                    "type": "string"
                                  },
                                  {
                                    "const": "source_conflict",
                                    "type": "string"
                                  },
                                  {
                                    "const": "policy_restricted",
                                    "type": "string"
                                  },
                                  {
                                    "const": "high_risk_business",
                                    "type": "string"
                                  },
                                  {
                                    "const": "acl_denied",
                                    "type": "string"
                                  },
                                  {
                                    "const": "provider_unavailable",
                                    "type": "string"
                                  },
                                  {
                                    "const": "provider_unknown",
                                    "type": "string"
                                  },
                                  {
                                    "const": "citation_invalid",
                                    "type": "string"
                                  },
                                  {
                                    "const": "output_blocked",
                                    "type": "string"
                                  },
                                  {
                                    "const": "user_requested_human",
                                    "type": "string"
                                  },
                                  {
                                    "const": "business_rule_handoff",
                                    "type": "string"
                                  }
                                ]
                              }
                            },
                            "required": ["outcome", "reason_code", "citations"],
                            "type": "object"
                          },
                          {
                            "additionalProperties": false,
                            "properties": {
                              "citations": {
                                "items": {
                                  "additionalProperties": false,
                                  "properties": {
                                    "citation_id": {
                                      "pattern": "^cit_[0-9A-HJKMNP-TV-Z]{26}$",
                                      "type": "string"
                                    },
                                    "excerpt": {
                                      "maxLength": 1024,
                                      "minLength": 1,
                                      "type": "string"
                                    },
                                    "title": {
                                      "maxLength": 256,
                                      "minLength": 1,
                                      "type": "string"
                                    },
                                    "url": {
                                      "format": "uri",
                                      "maxLength": 2048,
                                      "minLength": 9,
                                      "pattern": "^https://(?![^/?#]*@)[^\\s]+$",
                                      "type": "string"
                                    }
                                  },
                                  "required": ["citation_id", "title", "excerpt", "url"],
                                  "type": "object"
                                },
                                "maxItems": 20,
                                "type": "array"
                              },
                              "handoff": {
                                "additionalProperties": false,
                                "properties": {
                                  "state": {
                                    "const": "handoff_requested",
                                    "type": "string"
                                  },
                                  "ticket_id": {
                                    "pattern": "^ht_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  }
                                },
                                "required": ["ticket_id", "state"],
                                "type": "object"
                              },
                              "outcome": {
                                "const": "handoff_required",
                                "type": "string"
                              },
                              "reason_code": {
                                "anyOf": [
                                  {
                                    "const": "knowledge_insufficient",
                                    "type": "string"
                                  },
                                  {
                                    "const": "source_conflict",
                                    "type": "string"
                                  },
                                  {
                                    "const": "policy_restricted",
                                    "type": "string"
                                  },
                                  {
                                    "const": "high_risk_business",
                                    "type": "string"
                                  },
                                  {
                                    "const": "acl_denied",
                                    "type": "string"
                                  },
                                  {
                                    "const": "provider_unavailable",
                                    "type": "string"
                                  },
                                  {
                                    "const": "provider_unknown",
                                    "type": "string"
                                  },
                                  {
                                    "const": "citation_invalid",
                                    "type": "string"
                                  },
                                  {
                                    "const": "output_blocked",
                                    "type": "string"
                                  },
                                  {
                                    "const": "user_requested_human",
                                    "type": "string"
                                  },
                                  {
                                    "const": "business_rule_handoff",
                                    "type": "string"
                                  }
                                ]
                              }
                            },
                            "required": ["outcome", "reason_code", "citations", "handoff"],
                            "type": "object"
                          }
                        ]
                      },
                      "author": {
                        "const": "assistant",
                        "type": "string"
                      },
                      "message_id": {
                        "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                        "type": "string"
                      },
                      "parts": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "text": {
                              "maxLength": 8000,
                              "minLength": 1,
                              "type": "string"
                            },
                            "type": {
                              "const": "text",
                              "type": "string"
                            }
                          },
                          "required": ["type", "text"],
                          "type": "object"
                        },
                        "maxItems": 20,
                        "minItems": 1,
                        "type": "array"
                      },
                      "run_id": {
                        "pattern": "^run_[0-9A-HJKMNP-TV-Z]{26}$",
                        "type": "string"
                      }
                    },
                    "required": ["author", "message_id", "run_id", "parts", "assistant_result"],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "author": {
                        "const": "human",
                        "type": "string"
                      },
                      "message_id": {
                        "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                        "type": "string"
                      },
                      "parts": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "text": {
                              "maxLength": 8000,
                              "minLength": 1,
                              "type": "string"
                            },
                            "type": {
                              "const": "text",
                              "type": "string"
                            }
                          },
                          "required": ["type", "text"],
                          "type": "object"
                        },
                        "maxItems": 20,
                        "minItems": 1,
                        "type": "array"
                      }
                    },
                    "required": ["author", "message_id", "parts"],
                    "type": "object"
                  }
                ]
              },
              "protocol_version": {
                "const": "2.0",
                "type": "string"
              },
              "sequence": {
                "maximum": 9007199254740991,
                "minimum": 1,
                "type": "integer"
              },
              "trace_id": {
                "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "type": {
                "const": "message.completed",
                "type": "string"
              }
            },
            "required": [
              "protocol_version",
              "event_id",
              "sequence",
              "conversation_id",
              "occurred_at",
              "trace_id",
              "type",
              "payload"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "conversation_id": {
                "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "event_id": {
                "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "occurred_at": {
                "format": "date-time",
                "type": "string"
              },
              "payload": {
                "anyOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "actor": {
                        "const": "visitor",
                        "type": "string"
                      },
                      "from_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      },
                      "owner_epoch": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "reason_code": {
                        "const": "user_requested_human",
                        "type": "string"
                      },
                      "state_version": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "to_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      }
                    },
                    "required": [
                      "from_state",
                      "to_state",
                      "state_version",
                      "owner_epoch",
                      "reason_code",
                      "actor"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "actor": {
                        "const": "system",
                        "type": "string"
                      },
                      "from_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      },
                      "owner_epoch": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "reason_code": {
                        "const": "business_rule_handoff",
                        "type": "string"
                      },
                      "state_version": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "to_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      }
                    },
                    "required": [
                      "from_state",
                      "to_state",
                      "state_version",
                      "owner_epoch",
                      "reason_code",
                      "actor"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "actor": {
                        "const": "assistant",
                        "type": "string"
                      },
                      "from_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      },
                      "owner_epoch": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "reason_code": {
                        "anyOf": [
                          {
                            "const": "knowledge_insufficient",
                            "type": "string"
                          },
                          {
                            "const": "source_conflict",
                            "type": "string"
                          },
                          {
                            "const": "policy_restricted",
                            "type": "string"
                          },
                          {
                            "const": "high_risk_business",
                            "type": "string"
                          },
                          {
                            "const": "acl_denied",
                            "type": "string"
                          },
                          {
                            "const": "provider_unavailable",
                            "type": "string"
                          },
                          {
                            "const": "provider_unknown",
                            "type": "string"
                          },
                          {
                            "const": "citation_invalid",
                            "type": "string"
                          },
                          {
                            "const": "output_blocked",
                            "type": "string"
                          }
                        ]
                      },
                      "state_version": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "to_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      }
                    },
                    "required": [
                      "from_state",
                      "to_state",
                      "state_version",
                      "owner_epoch",
                      "reason_code",
                      "actor"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "actor": {
                        "const": "system",
                        "type": "string"
                      },
                      "from_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      },
                      "owner_epoch": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "reason_code": {
                        "const": "queue_accepted",
                        "type": "string"
                      },
                      "state_version": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "to_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      }
                    },
                    "required": [
                      "from_state",
                      "to_state",
                      "state_version",
                      "owner_epoch",
                      "reason_code",
                      "actor"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "actor": {
                        "anyOf": [
                          {
                            "const": "human",
                            "type": "string"
                          },
                          {
                            "const": "system",
                            "type": "string"
                          }
                        ]
                      },
                      "from_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      },
                      "owner_epoch": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "reason_code": {
                        "const": "agent_claimed",
                        "type": "string"
                      },
                      "state_version": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "to_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      }
                    },
                    "required": [
                      "from_state",
                      "to_state",
                      "state_version",
                      "owner_epoch",
                      "reason_code",
                      "actor"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "actor": {
                        "anyOf": [
                          {
                            "const": "human",
                            "type": "string"
                          },
                          {
                            "const": "system",
                            "type": "string"
                          }
                        ]
                      },
                      "from_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      },
                      "owner_epoch": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "reason_code": {
                        "const": "agent_released",
                        "type": "string"
                      },
                      "state_version": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "to_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      }
                    },
                    "required": [
                      "from_state",
                      "to_state",
                      "state_version",
                      "owner_epoch",
                      "reason_code",
                      "actor"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "actor": {
                        "const": "human",
                        "type": "string"
                      },
                      "from_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      },
                      "owner_epoch": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "reason_code": {
                        "anyOf": [
                          {
                            "const": "agent_transferred",
                            "type": "string"
                          },
                          {
                            "const": "agent_action",
                            "type": "string"
                          },
                          {
                            "const": "resume_bot",
                            "type": "string"
                          },
                          {
                            "const": "close",
                            "type": "string"
                          }
                        ]
                      },
                      "state_version": {
                        "maximum": 9007199254740991,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "to_state": {
                        "anyOf": [
                          {
                            "const": "bot_active",
                            "type": "string"
                          },
                          {
                            "const": "handoff_requested",
                            "type": "string"
                          },
                          {
                            "const": "queued",
                            "type": "string"
                          },
                          {
                            "const": "human_active",
                            "type": "string"
                          },
                          {
                            "const": "wrap_up",
                            "type": "string"
                          },
                          {
                            "const": "closed",
                            "type": "string"
                          }
                        ]
                      }
                    },
                    "required": [
                      "from_state",
                      "to_state",
                      "state_version",
                      "owner_epoch",
                      "reason_code",
                      "actor"
                    ],
                    "type": "object"
                  }
                ]
              },
              "protocol_version": {
                "const": "2.0",
                "type": "string"
              },
              "sequence": {
                "maximum": 9007199254740991,
                "minimum": 1,
                "type": "integer"
              },
              "trace_id": {
                "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "type": {
                "const": "conversation.state_changed",
                "type": "string"
              }
            },
            "required": [
              "protocol_version",
              "event_id",
              "sequence",
              "conversation_id",
              "occurred_at",
              "trace_id",
              "type",
              "payload"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "conversation_id": {
                "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "event_id": {
                "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "occurred_at": {
                "format": "date-time",
                "type": "string"
              },
              "payload": {
                "additionalProperties": false,
                "properties": {
                  "owner_epoch": {
                    "maximum": 9007199254740991,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "reason_code": {
                    "anyOf": [
                      {
                        "const": "knowledge_insufficient",
                        "type": "string"
                      },
                      {
                        "const": "source_conflict",
                        "type": "string"
                      },
                      {
                        "const": "policy_restricted",
                        "type": "string"
                      },
                      {
                        "const": "high_risk_business",
                        "type": "string"
                      },
                      {
                        "const": "acl_denied",
                        "type": "string"
                      },
                      {
                        "const": "provider_unavailable",
                        "type": "string"
                      },
                      {
                        "const": "provider_unknown",
                        "type": "string"
                      },
                      {
                        "const": "citation_invalid",
                        "type": "string"
                      },
                      {
                        "const": "output_blocked",
                        "type": "string"
                      },
                      {
                        "const": "user_requested_human",
                        "type": "string"
                      },
                      {
                        "const": "business_rule_handoff",
                        "type": "string"
                      }
                    ]
                  },
                  "state_version": {
                    "maximum": 9007199254740991,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "ticket_id": {
                    "pattern": "^ht_[0-9A-HJKMNP-TV-Z]{26}$",
                    "type": "string"
                  }
                },
                "required": ["ticket_id", "reason_code", "state_version", "owner_epoch"],
                "type": "object"
              },
              "protocol_version": {
                "const": "2.0",
                "type": "string"
              },
              "sequence": {
                "maximum": 9007199254740991,
                "minimum": 1,
                "type": "integer"
              },
              "trace_id": {
                "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "type": {
                "const": "handoff.requested",
                "type": "string"
              }
            },
            "required": [
              "protocol_version",
              "event_id",
              "sequence",
              "conversation_id",
              "occurred_at",
              "trace_id",
              "type",
              "payload"
            ],
            "type": "object"
          }
        ]
      },
      "ClientV2CreateConversationResponse": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "additionalProperties": false,
            "properties": {
              "capabilities": {
                "additionalItems": false,
                "items": [
                  {
                    "const": "human_handoff_v1",
                    "type": "string"
                  }
                ],
                "minItems": 1,
                "type": "array"
              },
              "conversation_id": {
                "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              },
              "owner_epoch": {
                "const": 1,
                "type": "number"
              },
              "protocol_version": {
                "const": "2.0",
                "type": "string"
              },
              "state": {
                "const": "bot_active",
                "type": "string"
              },
              "state_version": {
                "const": 1,
                "type": "number"
              }
            },
            "required": [
              "conversation_id",
              "protocol_version",
              "capabilities",
              "state",
              "state_version",
              "owner_epoch"
            ],
            "type": "object"
          }
        },
        "required": ["data"],
        "type": "object"
      },
      "ClientV2CreateMessageAcceptedResponse": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "anyOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "accepted": {
                    "const": true,
                    "type": "boolean"
                  },
                  "delivery": {
                    "const": "assistant",
                    "type": "string"
                  },
                  "message_id": {
                    "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                    "type": "string"
                  },
                  "run_id": {
                    "pattern": "^run_[0-9A-HJKMNP-TV-Z]{26}$",
                    "type": "string"
                  }
                },
                "required": ["accepted", "delivery", "message_id", "run_id"],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "accepted": {
                    "const": true,
                    "type": "boolean"
                  },
                  "delivery": {
                    "const": "support",
                    "type": "string"
                  },
                  "event_id": {
                    "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                    "type": "string"
                  },
                  "event_sequence": {
                    "maximum": 9007199254740991,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "message_id": {
                    "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                    "type": "string"
                  },
                  "state": {
                    "anyOf": [
                      {
                        "const": "handoff_requested",
                        "type": "string"
                      },
                      {
                        "const": "queued",
                        "type": "string"
                      },
                      {
                        "const": "human_active",
                        "type": "string"
                      }
                    ]
                  }
                },
                "required": [
                  "accepted",
                  "delivery",
                  "message_id",
                  "event_id",
                  "event_sequence",
                  "state"
                ],
                "type": "object"
              }
            ]
          }
        },
        "required": ["data"],
        "type": "object"
      },
      "ClientV2ErrorEnvelope": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "additionalProperties": false,
            "properties": {
              "code": {
                "anyOf": [
                  {
                    "const": "invalid_request",
                    "type": "string"
                  },
                  {
                    "const": "invalid_token",
                    "type": "string"
                  },
                  {
                    "const": "origin_not_allowed",
                    "type": "string"
                  },
                  {
                    "const": "payload_too_large",
                    "type": "string"
                  },
                  {
                    "const": "rate_limit_exceeded",
                    "type": "string"
                  },
                  {
                    "const": "conversation_not_found",
                    "type": "string"
                  },
                  {
                    "const": "idempotency_conflict",
                    "type": "string"
                  },
                  {
                    "const": "conversation_state_conflict",
                    "type": "string"
                  },
                  {
                    "const": "validation_error",
                    "type": "string"
                  },
                  {
                    "const": "temporarily_unavailable",
                    "type": "string"
                  }
                ]
              },
              "message": {
                "maxLength": 512,
                "minLength": 1,
                "type": "string"
              },
              "trace_id": {
                "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              }
            },
            "required": ["code", "message", "trace_id"],
            "type": "object"
          }
        },
        "required": ["error"],
        "type": "object"
      },
      "ClientV2EventsResponse": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "additionalProperties": false,
            "properties": {
              "events": {
                "items": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "properties": {
                        "conversation_id": {
                          "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "event_id": {
                          "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "occurred_at": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "payload": {
                          "additionalProperties": false,
                          "properties": {
                            "capabilities": {
                              "additionalItems": false,
                              "items": [
                                {
                                  "const": "human_handoff_v1",
                                  "type": "string"
                                }
                              ],
                              "minItems": 1,
                              "type": "array"
                            },
                            "owner_epoch": {
                              "maximum": 9007199254740991,
                              "minimum": 1,
                              "type": "integer"
                            },
                            "state": {
                              "anyOf": [
                                {
                                  "const": "bot_active",
                                  "type": "string"
                                },
                                {
                                  "const": "handoff_requested",
                                  "type": "string"
                                },
                                {
                                  "const": "queued",
                                  "type": "string"
                                },
                                {
                                  "const": "human_active",
                                  "type": "string"
                                },
                                {
                                  "const": "wrap_up",
                                  "type": "string"
                                },
                                {
                                  "const": "closed",
                                  "type": "string"
                                }
                              ]
                            },
                            "state_version": {
                              "maximum": 9007199254740991,
                              "minimum": 1,
                              "type": "integer"
                            }
                          },
                          "required": ["state", "state_version", "owner_epoch", "capabilities"],
                          "type": "object"
                        },
                        "protocol_version": {
                          "const": "2.0",
                          "type": "string"
                        },
                        "sequence": {
                          "maximum": 9007199254740991,
                          "minimum": 1,
                          "type": "integer"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "type": {
                          "const": "conversation.snapshot",
                          "type": "string"
                        }
                      },
                      "required": [
                        "protocol_version",
                        "event_id",
                        "sequence",
                        "conversation_id",
                        "occurred_at",
                        "trace_id",
                        "type",
                        "payload"
                      ],
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "properties": {
                        "conversation_id": {
                          "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "event_id": {
                          "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "occurred_at": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "payload": {
                          "anyOf": [
                            {
                              "additionalProperties": false,
                              "properties": {
                                "author": {
                                  "const": "visitor",
                                  "type": "string"
                                },
                                "message_id": {
                                  "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                                  "type": "string"
                                },
                                "parts": {
                                  "items": {
                                    "additionalProperties": false,
                                    "properties": {
                                      "text": {
                                        "maxLength": 8000,
                                        "minLength": 1,
                                        "type": "string"
                                      },
                                      "type": {
                                        "const": "text",
                                        "type": "string"
                                      }
                                    },
                                    "required": ["type", "text"],
                                    "type": "object"
                                  },
                                  "maxItems": 20,
                                  "minItems": 1,
                                  "type": "array"
                                }
                              },
                              "required": ["author", "message_id", "parts"],
                              "type": "object"
                            },
                            {
                              "additionalProperties": false,
                              "properties": {
                                "assistant_result": {
                                  "anyOf": [
                                    {
                                      "additionalProperties": false,
                                      "properties": {
                                        "citations": {
                                          "items": {
                                            "additionalProperties": false,
                                            "properties": {
                                              "citation_id": {
                                                "pattern": "^cit_[0-9A-HJKMNP-TV-Z]{26}$",
                                                "type": "string"
                                              },
                                              "excerpt": {
                                                "maxLength": 1024,
                                                "minLength": 1,
                                                "type": "string"
                                              },
                                              "title": {
                                                "maxLength": 256,
                                                "minLength": 1,
                                                "type": "string"
                                              },
                                              "url": {
                                                "format": "uri",
                                                "maxLength": 2048,
                                                "minLength": 9,
                                                "pattern": "^https://(?![^/?#]*@)[^\\s]+$",
                                                "type": "string"
                                              }
                                            },
                                            "required": ["citation_id", "title", "excerpt", "url"],
                                            "type": "object"
                                          },
                                          "maxItems": 20,
                                          "minItems": 1,
                                          "type": "array"
                                        },
                                        "outcome": {
                                          "const": "answered",
                                          "type": "string"
                                        },
                                        "reason_code": {
                                          "type": "null"
                                        }
                                      },
                                      "required": ["outcome", "reason_code", "citations"],
                                      "type": "object"
                                    },
                                    {
                                      "additionalProperties": false,
                                      "properties": {
                                        "citations": {
                                          "items": {
                                            "additionalProperties": false,
                                            "properties": {
                                              "citation_id": {
                                                "pattern": "^cit_[0-9A-HJKMNP-TV-Z]{26}$",
                                                "type": "string"
                                              },
                                              "excerpt": {
                                                "maxLength": 1024,
                                                "minLength": 1,
                                                "type": "string"
                                              },
                                              "title": {
                                                "maxLength": 256,
                                                "minLength": 1,
                                                "type": "string"
                                              },
                                              "url": {
                                                "format": "uri",
                                                "maxLength": 2048,
                                                "minLength": 9,
                                                "pattern": "^https://(?![^/?#]*@)[^\\s]+$",
                                                "type": "string"
                                              }
                                            },
                                            "required": ["citation_id", "title", "excerpt", "url"],
                                            "type": "object"
                                          },
                                          "maxItems": 20,
                                          "type": "array"
                                        },
                                        "outcome": {
                                          "const": "refused",
                                          "type": "string"
                                        },
                                        "reason_code": {
                                          "anyOf": [
                                            {
                                              "const": "knowledge_insufficient",
                                              "type": "string"
                                            },
                                            {
                                              "const": "source_conflict",
                                              "type": "string"
                                            },
                                            {
                                              "const": "policy_restricted",
                                              "type": "string"
                                            },
                                            {
                                              "const": "high_risk_business",
                                              "type": "string"
                                            },
                                            {
                                              "const": "acl_denied",
                                              "type": "string"
                                            },
                                            {
                                              "const": "provider_unavailable",
                                              "type": "string"
                                            },
                                            {
                                              "const": "provider_unknown",
                                              "type": "string"
                                            },
                                            {
                                              "const": "citation_invalid",
                                              "type": "string"
                                            },
                                            {
                                              "const": "output_blocked",
                                              "type": "string"
                                            },
                                            {
                                              "const": "user_requested_human",
                                              "type": "string"
                                            },
                                            {
                                              "const": "business_rule_handoff",
                                              "type": "string"
                                            }
                                          ]
                                        }
                                      },
                                      "required": ["outcome", "reason_code", "citations"],
                                      "type": "object"
                                    },
                                    {
                                      "additionalProperties": false,
                                      "properties": {
                                        "citations": {
                                          "items": {
                                            "additionalProperties": false,
                                            "properties": {
                                              "citation_id": {
                                                "pattern": "^cit_[0-9A-HJKMNP-TV-Z]{26}$",
                                                "type": "string"
                                              },
                                              "excerpt": {
                                                "maxLength": 1024,
                                                "minLength": 1,
                                                "type": "string"
                                              },
                                              "title": {
                                                "maxLength": 256,
                                                "minLength": 1,
                                                "type": "string"
                                              },
                                              "url": {
                                                "format": "uri",
                                                "maxLength": 2048,
                                                "minLength": 9,
                                                "pattern": "^https://(?![^/?#]*@)[^\\s]+$",
                                                "type": "string"
                                              }
                                            },
                                            "required": ["citation_id", "title", "excerpt", "url"],
                                            "type": "object"
                                          },
                                          "maxItems": 20,
                                          "type": "array"
                                        },
                                        "handoff": {
                                          "additionalProperties": false,
                                          "properties": {
                                            "state": {
                                              "const": "handoff_requested",
                                              "type": "string"
                                            },
                                            "ticket_id": {
                                              "pattern": "^ht_[0-9A-HJKMNP-TV-Z]{26}$",
                                              "type": "string"
                                            }
                                          },
                                          "required": ["ticket_id", "state"],
                                          "type": "object"
                                        },
                                        "outcome": {
                                          "const": "handoff_required",
                                          "type": "string"
                                        },
                                        "reason_code": {
                                          "anyOf": [
                                            {
                                              "const": "knowledge_insufficient",
                                              "type": "string"
                                            },
                                            {
                                              "const": "source_conflict",
                                              "type": "string"
                                            },
                                            {
                                              "const": "policy_restricted",
                                              "type": "string"
                                            },
                                            {
                                              "const": "high_risk_business",
                                              "type": "string"
                                            },
                                            {
                                              "const": "acl_denied",
                                              "type": "string"
                                            },
                                            {
                                              "const": "provider_unavailable",
                                              "type": "string"
                                            },
                                            {
                                              "const": "provider_unknown",
                                              "type": "string"
                                            },
                                            {
                                              "const": "citation_invalid",
                                              "type": "string"
                                            },
                                            {
                                              "const": "output_blocked",
                                              "type": "string"
                                            },
                                            {
                                              "const": "user_requested_human",
                                              "type": "string"
                                            },
                                            {
                                              "const": "business_rule_handoff",
                                              "type": "string"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "outcome",
                                        "reason_code",
                                        "citations",
                                        "handoff"
                                      ],
                                      "type": "object"
                                    }
                                  ]
                                },
                                "author": {
                                  "const": "assistant",
                                  "type": "string"
                                },
                                "message_id": {
                                  "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                                  "type": "string"
                                },
                                "parts": {
                                  "items": {
                                    "additionalProperties": false,
                                    "properties": {
                                      "text": {
                                        "maxLength": 8000,
                                        "minLength": 1,
                                        "type": "string"
                                      },
                                      "type": {
                                        "const": "text",
                                        "type": "string"
                                      }
                                    },
                                    "required": ["type", "text"],
                                    "type": "object"
                                  },
                                  "maxItems": 20,
                                  "minItems": 1,
                                  "type": "array"
                                },
                                "run_id": {
                                  "pattern": "^run_[0-9A-HJKMNP-TV-Z]{26}$",
                                  "type": "string"
                                }
                              },
                              "required": [
                                "author",
                                "message_id",
                                "run_id",
                                "parts",
                                "assistant_result"
                              ],
                              "type": "object"
                            },
                            {
                              "additionalProperties": false,
                              "properties": {
                                "author": {
                                  "const": "human",
                                  "type": "string"
                                },
                                "message_id": {
                                  "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                                  "type": "string"
                                },
                                "parts": {
                                  "items": {
                                    "additionalProperties": false,
                                    "properties": {
                                      "text": {
                                        "maxLength": 8000,
                                        "minLength": 1,
                                        "type": "string"
                                      },
                                      "type": {
                                        "const": "text",
                                        "type": "string"
                                      }
                                    },
                                    "required": ["type", "text"],
                                    "type": "object"
                                  },
                                  "maxItems": 20,
                                  "minItems": 1,
                                  "type": "array"
                                }
                              },
                              "required": ["author", "message_id", "parts"],
                              "type": "object"
                            }
                          ]
                        },
                        "protocol_version": {
                          "const": "2.0",
                          "type": "string"
                        },
                        "sequence": {
                          "maximum": 9007199254740991,
                          "minimum": 1,
                          "type": "integer"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "type": {
                          "const": "message.completed",
                          "type": "string"
                        }
                      },
                      "required": [
                        "protocol_version",
                        "event_id",
                        "sequence",
                        "conversation_id",
                        "occurred_at",
                        "trace_id",
                        "type",
                        "payload"
                      ],
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "properties": {
                        "conversation_id": {
                          "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "event_id": {
                          "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "occurred_at": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "payload": {
                          "anyOf": [
                            {
                              "additionalProperties": false,
                              "properties": {
                                "actor": {
                                  "const": "visitor",
                                  "type": "string"
                                },
                                "from_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "owner_epoch": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "reason_code": {
                                  "const": "user_requested_human",
                                  "type": "string"
                                },
                                "state_version": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "to_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "from_state",
                                "to_state",
                                "state_version",
                                "owner_epoch",
                                "reason_code",
                                "actor"
                              ],
                              "type": "object"
                            },
                            {
                              "additionalProperties": false,
                              "properties": {
                                "actor": {
                                  "const": "system",
                                  "type": "string"
                                },
                                "from_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "owner_epoch": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "reason_code": {
                                  "const": "business_rule_handoff",
                                  "type": "string"
                                },
                                "state_version": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "to_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "from_state",
                                "to_state",
                                "state_version",
                                "owner_epoch",
                                "reason_code",
                                "actor"
                              ],
                              "type": "object"
                            },
                            {
                              "additionalProperties": false,
                              "properties": {
                                "actor": {
                                  "const": "assistant",
                                  "type": "string"
                                },
                                "from_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "owner_epoch": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "reason_code": {
                                  "anyOf": [
                                    {
                                      "const": "knowledge_insufficient",
                                      "type": "string"
                                    },
                                    {
                                      "const": "source_conflict",
                                      "type": "string"
                                    },
                                    {
                                      "const": "policy_restricted",
                                      "type": "string"
                                    },
                                    {
                                      "const": "high_risk_business",
                                      "type": "string"
                                    },
                                    {
                                      "const": "acl_denied",
                                      "type": "string"
                                    },
                                    {
                                      "const": "provider_unavailable",
                                      "type": "string"
                                    },
                                    {
                                      "const": "provider_unknown",
                                      "type": "string"
                                    },
                                    {
                                      "const": "citation_invalid",
                                      "type": "string"
                                    },
                                    {
                                      "const": "output_blocked",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "state_version": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "to_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "from_state",
                                "to_state",
                                "state_version",
                                "owner_epoch",
                                "reason_code",
                                "actor"
                              ],
                              "type": "object"
                            },
                            {
                              "additionalProperties": false,
                              "properties": {
                                "actor": {
                                  "const": "system",
                                  "type": "string"
                                },
                                "from_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "owner_epoch": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "reason_code": {
                                  "const": "queue_accepted",
                                  "type": "string"
                                },
                                "state_version": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "to_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "from_state",
                                "to_state",
                                "state_version",
                                "owner_epoch",
                                "reason_code",
                                "actor"
                              ],
                              "type": "object"
                            },
                            {
                              "additionalProperties": false,
                              "properties": {
                                "actor": {
                                  "anyOf": [
                                    {
                                      "const": "human",
                                      "type": "string"
                                    },
                                    {
                                      "const": "system",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "from_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "owner_epoch": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "reason_code": {
                                  "const": "agent_claimed",
                                  "type": "string"
                                },
                                "state_version": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "to_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "from_state",
                                "to_state",
                                "state_version",
                                "owner_epoch",
                                "reason_code",
                                "actor"
                              ],
                              "type": "object"
                            },
                            {
                              "additionalProperties": false,
                              "properties": {
                                "actor": {
                                  "anyOf": [
                                    {
                                      "const": "human",
                                      "type": "string"
                                    },
                                    {
                                      "const": "system",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "from_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "owner_epoch": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "reason_code": {
                                  "const": "agent_released",
                                  "type": "string"
                                },
                                "state_version": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "to_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "from_state",
                                "to_state",
                                "state_version",
                                "owner_epoch",
                                "reason_code",
                                "actor"
                              ],
                              "type": "object"
                            },
                            {
                              "additionalProperties": false,
                              "properties": {
                                "actor": {
                                  "const": "human",
                                  "type": "string"
                                },
                                "from_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "owner_epoch": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "reason_code": {
                                  "anyOf": [
                                    {
                                      "const": "agent_transferred",
                                      "type": "string"
                                    },
                                    {
                                      "const": "agent_action",
                                      "type": "string"
                                    },
                                    {
                                      "const": "resume_bot",
                                      "type": "string"
                                    },
                                    {
                                      "const": "close",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "state_version": {
                                  "maximum": 9007199254740991,
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "to_state": {
                                  "anyOf": [
                                    {
                                      "const": "bot_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "handoff_requested",
                                      "type": "string"
                                    },
                                    {
                                      "const": "queued",
                                      "type": "string"
                                    },
                                    {
                                      "const": "human_active",
                                      "type": "string"
                                    },
                                    {
                                      "const": "wrap_up",
                                      "type": "string"
                                    },
                                    {
                                      "const": "closed",
                                      "type": "string"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "from_state",
                                "to_state",
                                "state_version",
                                "owner_epoch",
                                "reason_code",
                                "actor"
                              ],
                              "type": "object"
                            }
                          ]
                        },
                        "protocol_version": {
                          "const": "2.0",
                          "type": "string"
                        },
                        "sequence": {
                          "maximum": 9007199254740991,
                          "minimum": 1,
                          "type": "integer"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "type": {
                          "const": "conversation.state_changed",
                          "type": "string"
                        }
                      },
                      "required": [
                        "protocol_version",
                        "event_id",
                        "sequence",
                        "conversation_id",
                        "occurred_at",
                        "trace_id",
                        "type",
                        "payload"
                      ],
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "properties": {
                        "conversation_id": {
                          "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "event_id": {
                          "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "occurred_at": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "payload": {
                          "additionalProperties": false,
                          "properties": {
                            "owner_epoch": {
                              "maximum": 9007199254740991,
                              "minimum": 1,
                              "type": "integer"
                            },
                            "reason_code": {
                              "anyOf": [
                                {
                                  "const": "knowledge_insufficient",
                                  "type": "string"
                                },
                                {
                                  "const": "source_conflict",
                                  "type": "string"
                                },
                                {
                                  "const": "policy_restricted",
                                  "type": "string"
                                },
                                {
                                  "const": "high_risk_business",
                                  "type": "string"
                                },
                                {
                                  "const": "acl_denied",
                                  "type": "string"
                                },
                                {
                                  "const": "provider_unavailable",
                                  "type": "string"
                                },
                                {
                                  "const": "provider_unknown",
                                  "type": "string"
                                },
                                {
                                  "const": "citation_invalid",
                                  "type": "string"
                                },
                                {
                                  "const": "output_blocked",
                                  "type": "string"
                                },
                                {
                                  "const": "user_requested_human",
                                  "type": "string"
                                },
                                {
                                  "const": "business_rule_handoff",
                                  "type": "string"
                                }
                              ]
                            },
                            "state_version": {
                              "maximum": 9007199254740991,
                              "minimum": 1,
                              "type": "integer"
                            },
                            "ticket_id": {
                              "pattern": "^ht_[0-9A-HJKMNP-TV-Z]{26}$",
                              "type": "string"
                            }
                          },
                          "required": ["ticket_id", "reason_code", "state_version", "owner_epoch"],
                          "type": "object"
                        },
                        "protocol_version": {
                          "const": "2.0",
                          "type": "string"
                        },
                        "sequence": {
                          "maximum": 9007199254740991,
                          "minimum": 1,
                          "type": "integer"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "type": {
                          "const": "handoff.requested",
                          "type": "string"
                        }
                      },
                      "required": [
                        "protocol_version",
                        "event_id",
                        "sequence",
                        "conversation_id",
                        "occurred_at",
                        "trace_id",
                        "type",
                        "payload"
                      ],
                      "type": "object"
                    }
                  ]
                },
                "maxItems": 100,
                "type": "array"
              },
              "next_sequence": {
                "maximum": 9007199254740991,
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": ["events", "next_sequence"],
            "type": "object"
          }
        },
        "required": ["data"],
        "type": "object"
      },
      "ClientV2HandoffResponse": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "additionalProperties": false,
            "properties": {
              "protocol_version": {
                "const": "2.0",
                "type": "string"
              },
              "state": {
                "const": "queued",
                "type": "string"
              },
              "ticket_id": {
                "pattern": "^ht_[0-9A-HJKMNP-TV-Z]{26}$",
                "type": "string"
              }
            },
            "required": ["ticket_id", "state", "protocol_version"],
            "type": "object"
          }
        },
        "required": ["data"],
        "type": "object"
      }
    },
    "securitySchemes": {
      "clientBearer": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "AI 客服 Client API",
    "version": "2.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/client/v2/conversations": {
      "post": {
        "operationId": "createConversationV2",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "required": true,
            "schema": {
              "maxLength": 2048,
              "minLength": 9,
              "pattern": "^https://(?![^/?#]*@)[A-Za-z0-9.-]+(?::[0-9]{1,5})?$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "capabilities": {
                    "additionalItems": false,
                    "items": [
                      {
                        "const": "human_handoff_v1",
                        "type": "string"
                      }
                    ],
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": ["capabilities"],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "capabilities": {
                          "additionalItems": false,
                          "items": [
                            {
                              "const": "human_handoff_v1",
                              "type": "string"
                            }
                          ],
                          "minItems": 1,
                          "type": "array"
                        },
                        "conversation_id": {
                          "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        },
                        "owner_epoch": {
                          "const": 1,
                          "type": "number"
                        },
                        "protocol_version": {
                          "const": "2.0",
                          "type": "string"
                        },
                        "state": {
                          "const": "bot_active",
                          "type": "string"
                        },
                        "state_version": {
                          "const": 1,
                          "type": "number"
                        }
                      },
                      "required": [
                        "conversation_id",
                        "protocol_version",
                        "capabilities",
                        "state",
                        "state_version",
                        "owner_epoch"
                      ],
                      "type": "object"
                    }
                  },
                  "required": ["data"],
                  "type": "object"
                }
              }
            },
            "description": "成功",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求无效",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Retry-After": {
                "required": true,
                "schema": {
                  "pattern": "^[0-9]+$",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBearer": []
          }
        ]
      }
    },
    "/client/v2/conversations/{conversation_id}/events": {
      "get": {
        "operationId": "listConversationEventsV2",
        "parameters": [
          {
            "in": "path",
            "name": "conversation_id",
            "required": true,
            "schema": {
              "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "after_sequence",
            "required": false,
            "schema": {
              "maximum": 9007199254740991,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "required": true,
            "schema": {
              "maxLength": 2048,
              "minLength": 9,
              "pattern": "^https://(?![^/?#]*@)[A-Za-z0-9.-]+(?::[0-9]{1,5})?$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "events": {
                          "items": {
                            "anyOf": [
                              {
                                "additionalProperties": false,
                                "properties": {
                                  "conversation_id": {
                                    "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  },
                                  "event_id": {
                                    "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  },
                                  "occurred_at": {
                                    "format": "date-time",
                                    "type": "string"
                                  },
                                  "payload": {
                                    "additionalProperties": false,
                                    "properties": {
                                      "capabilities": {
                                        "additionalItems": false,
                                        "items": [
                                          {
                                            "const": "human_handoff_v1",
                                            "type": "string"
                                          }
                                        ],
                                        "minItems": 1,
                                        "type": "array"
                                      },
                                      "owner_epoch": {
                                        "maximum": 9007199254740991,
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "state": {
                                        "anyOf": [
                                          {
                                            "const": "bot_active",
                                            "type": "string"
                                          },
                                          {
                                            "const": "handoff_requested",
                                            "type": "string"
                                          },
                                          {
                                            "const": "queued",
                                            "type": "string"
                                          },
                                          {
                                            "const": "human_active",
                                            "type": "string"
                                          },
                                          {
                                            "const": "wrap_up",
                                            "type": "string"
                                          },
                                          {
                                            "const": "closed",
                                            "type": "string"
                                          }
                                        ]
                                      },
                                      "state_version": {
                                        "maximum": 9007199254740991,
                                        "minimum": 1,
                                        "type": "integer"
                                      }
                                    },
                                    "required": [
                                      "state",
                                      "state_version",
                                      "owner_epoch",
                                      "capabilities"
                                    ],
                                    "type": "object"
                                  },
                                  "protocol_version": {
                                    "const": "2.0",
                                    "type": "string"
                                  },
                                  "sequence": {
                                    "maximum": 9007199254740991,
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "trace_id": {
                                    "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  },
                                  "type": {
                                    "const": "conversation.snapshot",
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "protocol_version",
                                  "event_id",
                                  "sequence",
                                  "conversation_id",
                                  "occurred_at",
                                  "trace_id",
                                  "type",
                                  "payload"
                                ],
                                "type": "object"
                              },
                              {
                                "additionalProperties": false,
                                "properties": {
                                  "conversation_id": {
                                    "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  },
                                  "event_id": {
                                    "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  },
                                  "occurred_at": {
                                    "format": "date-time",
                                    "type": "string"
                                  },
                                  "payload": {
                                    "anyOf": [
                                      {
                                        "additionalProperties": false,
                                        "properties": {
                                          "author": {
                                            "const": "visitor",
                                            "type": "string"
                                          },
                                          "message_id": {
                                            "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                                            "type": "string"
                                          },
                                          "parts": {
                                            "items": {
                                              "additionalProperties": false,
                                              "properties": {
                                                "text": {
                                                  "maxLength": 8000,
                                                  "minLength": 1,
                                                  "type": "string"
                                                },
                                                "type": {
                                                  "const": "text",
                                                  "type": "string"
                                                }
                                              },
                                              "required": ["type", "text"],
                                              "type": "object"
                                            },
                                            "maxItems": 20,
                                            "minItems": 1,
                                            "type": "array"
                                          }
                                        },
                                        "required": ["author", "message_id", "parts"],
                                        "type": "object"
                                      },
                                      {
                                        "additionalProperties": false,
                                        "properties": {
                                          "assistant_result": {
                                            "anyOf": [
                                              {
                                                "additionalProperties": false,
                                                "properties": {
                                                  "citations": {
                                                    "items": {
                                                      "additionalProperties": false,
                                                      "properties": {
                                                        "citation_id": {
                                                          "pattern": "^cit_[0-9A-HJKMNP-TV-Z]{26}$",
                                                          "type": "string"
                                                        },
                                                        "excerpt": {
                                                          "maxLength": 1024,
                                                          "minLength": 1,
                                                          "type": "string"
                                                        },
                                                        "title": {
                                                          "maxLength": 256,
                                                          "minLength": 1,
                                                          "type": "string"
                                                        },
                                                        "url": {
                                                          "format": "uri",
                                                          "maxLength": 2048,
                                                          "minLength": 9,
                                                          "pattern": "^https://(?![^/?#]*@)[^\\s]+$",
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "citation_id",
                                                        "title",
                                                        "excerpt",
                                                        "url"
                                                      ],
                                                      "type": "object"
                                                    },
                                                    "maxItems": 20,
                                                    "minItems": 1,
                                                    "type": "array"
                                                  },
                                                  "outcome": {
                                                    "const": "answered",
                                                    "type": "string"
                                                  },
                                                  "reason_code": {
                                                    "type": "null"
                                                  }
                                                },
                                                "required": ["outcome", "reason_code", "citations"],
                                                "type": "object"
                                              },
                                              {
                                                "additionalProperties": false,
                                                "properties": {
                                                  "citations": {
                                                    "items": {
                                                      "additionalProperties": false,
                                                      "properties": {
                                                        "citation_id": {
                                                          "pattern": "^cit_[0-9A-HJKMNP-TV-Z]{26}$",
                                                          "type": "string"
                                                        },
                                                        "excerpt": {
                                                          "maxLength": 1024,
                                                          "minLength": 1,
                                                          "type": "string"
                                                        },
                                                        "title": {
                                                          "maxLength": 256,
                                                          "minLength": 1,
                                                          "type": "string"
                                                        },
                                                        "url": {
                                                          "format": "uri",
                                                          "maxLength": 2048,
                                                          "minLength": 9,
                                                          "pattern": "^https://(?![^/?#]*@)[^\\s]+$",
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "citation_id",
                                                        "title",
                                                        "excerpt",
                                                        "url"
                                                      ],
                                                      "type": "object"
                                                    },
                                                    "maxItems": 20,
                                                    "type": "array"
                                                  },
                                                  "outcome": {
                                                    "const": "refused",
                                                    "type": "string"
                                                  },
                                                  "reason_code": {
                                                    "anyOf": [
                                                      {
                                                        "const": "knowledge_insufficient",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "source_conflict",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "policy_restricted",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "high_risk_business",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "acl_denied",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "provider_unavailable",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "provider_unknown",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "citation_invalid",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "output_blocked",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "user_requested_human",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "business_rule_handoff",
                                                        "type": "string"
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": ["outcome", "reason_code", "citations"],
                                                "type": "object"
                                              },
                                              {
                                                "additionalProperties": false,
                                                "properties": {
                                                  "citations": {
                                                    "items": {
                                                      "additionalProperties": false,
                                                      "properties": {
                                                        "citation_id": {
                                                          "pattern": "^cit_[0-9A-HJKMNP-TV-Z]{26}$",
                                                          "type": "string"
                                                        },
                                                        "excerpt": {
                                                          "maxLength": 1024,
                                                          "minLength": 1,
                                                          "type": "string"
                                                        },
                                                        "title": {
                                                          "maxLength": 256,
                                                          "minLength": 1,
                                                          "type": "string"
                                                        },
                                                        "url": {
                                                          "format": "uri",
                                                          "maxLength": 2048,
                                                          "minLength": 9,
                                                          "pattern": "^https://(?![^/?#]*@)[^\\s]+$",
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "citation_id",
                                                        "title",
                                                        "excerpt",
                                                        "url"
                                                      ],
                                                      "type": "object"
                                                    },
                                                    "maxItems": 20,
                                                    "type": "array"
                                                  },
                                                  "handoff": {
                                                    "additionalProperties": false,
                                                    "properties": {
                                                      "state": {
                                                        "const": "handoff_requested",
                                                        "type": "string"
                                                      },
                                                      "ticket_id": {
                                                        "pattern": "^ht_[0-9A-HJKMNP-TV-Z]{26}$",
                                                        "type": "string"
                                                      }
                                                    },
                                                    "required": ["ticket_id", "state"],
                                                    "type": "object"
                                                  },
                                                  "outcome": {
                                                    "const": "handoff_required",
                                                    "type": "string"
                                                  },
                                                  "reason_code": {
                                                    "anyOf": [
                                                      {
                                                        "const": "knowledge_insufficient",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "source_conflict",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "policy_restricted",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "high_risk_business",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "acl_denied",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "provider_unavailable",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "provider_unknown",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "citation_invalid",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "output_blocked",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "user_requested_human",
                                                        "type": "string"
                                                      },
                                                      {
                                                        "const": "business_rule_handoff",
                                                        "type": "string"
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "outcome",
                                                  "reason_code",
                                                  "citations",
                                                  "handoff"
                                                ],
                                                "type": "object"
                                              }
                                            ]
                                          },
                                          "author": {
                                            "const": "assistant",
                                            "type": "string"
                                          },
                                          "message_id": {
                                            "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                                            "type": "string"
                                          },
                                          "parts": {
                                            "items": {
                                              "additionalProperties": false,
                                              "properties": {
                                                "text": {
                                                  "maxLength": 8000,
                                                  "minLength": 1,
                                                  "type": "string"
                                                },
                                                "type": {
                                                  "const": "text",
                                                  "type": "string"
                                                }
                                              },
                                              "required": ["type", "text"],
                                              "type": "object"
                                            },
                                            "maxItems": 20,
                                            "minItems": 1,
                                            "type": "array"
                                          },
                                          "run_id": {
                                            "pattern": "^run_[0-9A-HJKMNP-TV-Z]{26}$",
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "author",
                                          "message_id",
                                          "run_id",
                                          "parts",
                                          "assistant_result"
                                        ],
                                        "type": "object"
                                      },
                                      {
                                        "additionalProperties": false,
                                        "properties": {
                                          "author": {
                                            "const": "human",
                                            "type": "string"
                                          },
                                          "message_id": {
                                            "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                                            "type": "string"
                                          },
                                          "parts": {
                                            "items": {
                                              "additionalProperties": false,
                                              "properties": {
                                                "text": {
                                                  "maxLength": 8000,
                                                  "minLength": 1,
                                                  "type": "string"
                                                },
                                                "type": {
                                                  "const": "text",
                                                  "type": "string"
                                                }
                                              },
                                              "required": ["type", "text"],
                                              "type": "object"
                                            },
                                            "maxItems": 20,
                                            "minItems": 1,
                                            "type": "array"
                                          }
                                        },
                                        "required": ["author", "message_id", "parts"],
                                        "type": "object"
                                      }
                                    ]
                                  },
                                  "protocol_version": {
                                    "const": "2.0",
                                    "type": "string"
                                  },
                                  "sequence": {
                                    "maximum": 9007199254740991,
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "trace_id": {
                                    "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  },
                                  "type": {
                                    "const": "message.completed",
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "protocol_version",
                                  "event_id",
                                  "sequence",
                                  "conversation_id",
                                  "occurred_at",
                                  "trace_id",
                                  "type",
                                  "payload"
                                ],
                                "type": "object"
                              },
                              {
                                "additionalProperties": false,
                                "properties": {
                                  "conversation_id": {
                                    "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  },
                                  "event_id": {
                                    "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  },
                                  "occurred_at": {
                                    "format": "date-time",
                                    "type": "string"
                                  },
                                  "payload": {
                                    "anyOf": [
                                      {
                                        "additionalProperties": false,
                                        "properties": {
                                          "actor": {
                                            "const": "visitor",
                                            "type": "string"
                                          },
                                          "from_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          "owner_epoch": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "reason_code": {
                                            "const": "user_requested_human",
                                            "type": "string"
                                          },
                                          "state_version": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "to_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "from_state",
                                          "to_state",
                                          "state_version",
                                          "owner_epoch",
                                          "reason_code",
                                          "actor"
                                        ],
                                        "type": "object"
                                      },
                                      {
                                        "additionalProperties": false,
                                        "properties": {
                                          "actor": {
                                            "const": "system",
                                            "type": "string"
                                          },
                                          "from_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          "owner_epoch": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "reason_code": {
                                            "const": "business_rule_handoff",
                                            "type": "string"
                                          },
                                          "state_version": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "to_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "from_state",
                                          "to_state",
                                          "state_version",
                                          "owner_epoch",
                                          "reason_code",
                                          "actor"
                                        ],
                                        "type": "object"
                                      },
                                      {
                                        "additionalProperties": false,
                                        "properties": {
                                          "actor": {
                                            "const": "assistant",
                                            "type": "string"
                                          },
                                          "from_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          "owner_epoch": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "reason_code": {
                                            "anyOf": [
                                              {
                                                "const": "knowledge_insufficient",
                                                "type": "string"
                                              },
                                              {
                                                "const": "source_conflict",
                                                "type": "string"
                                              },
                                              {
                                                "const": "policy_restricted",
                                                "type": "string"
                                              },
                                              {
                                                "const": "high_risk_business",
                                                "type": "string"
                                              },
                                              {
                                                "const": "acl_denied",
                                                "type": "string"
                                              },
                                              {
                                                "const": "provider_unavailable",
                                                "type": "string"
                                              },
                                              {
                                                "const": "provider_unknown",
                                                "type": "string"
                                              },
                                              {
                                                "const": "citation_invalid",
                                                "type": "string"
                                              },
                                              {
                                                "const": "output_blocked",
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          "state_version": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "to_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "from_state",
                                          "to_state",
                                          "state_version",
                                          "owner_epoch",
                                          "reason_code",
                                          "actor"
                                        ],
                                        "type": "object"
                                      },
                                      {
                                        "additionalProperties": false,
                                        "properties": {
                                          "actor": {
                                            "const": "system",
                                            "type": "string"
                                          },
                                          "from_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          "owner_epoch": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "reason_code": {
                                            "const": "queue_accepted",
                                            "type": "string"
                                          },
                                          "state_version": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "to_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "from_state",
                                          "to_state",
                                          "state_version",
                                          "owner_epoch",
                                          "reason_code",
                                          "actor"
                                        ],
                                        "type": "object"
                                      },
                                      {
                                        "additionalProperties": false,
                                        "properties": {
                                          "actor": {
                                            "anyOf": [
                                              {
                                                "const": "human",
                                                "type": "string"
                                              },
                                              {
                                                "const": "system",
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          "from_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          "owner_epoch": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "reason_code": {
                                            "const": "agent_claimed",
                                            "type": "string"
                                          },
                                          "state_version": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "to_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "from_state",
                                          "to_state",
                                          "state_version",
                                          "owner_epoch",
                                          "reason_code",
                                          "actor"
                                        ],
                                        "type": "object"
                                      },
                                      {
                                        "additionalProperties": false,
                                        "properties": {
                                          "actor": {
                                            "anyOf": [
                                              {
                                                "const": "human",
                                                "type": "string"
                                              },
                                              {
                                                "const": "system",
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          "from_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          "owner_epoch": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "reason_code": {
                                            "const": "agent_released",
                                            "type": "string"
                                          },
                                          "state_version": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "to_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "from_state",
                                          "to_state",
                                          "state_version",
                                          "owner_epoch",
                                          "reason_code",
                                          "actor"
                                        ],
                                        "type": "object"
                                      },
                                      {
                                        "additionalProperties": false,
                                        "properties": {
                                          "actor": {
                                            "const": "human",
                                            "type": "string"
                                          },
                                          "from_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          "owner_epoch": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "reason_code": {
                                            "anyOf": [
                                              {
                                                "const": "agent_transferred",
                                                "type": "string"
                                              },
                                              {
                                                "const": "agent_action",
                                                "type": "string"
                                              },
                                              {
                                                "const": "resume_bot",
                                                "type": "string"
                                              },
                                              {
                                                "const": "close",
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          "state_version": {
                                            "maximum": 9007199254740991,
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "to_state": {
                                            "anyOf": [
                                              {
                                                "const": "bot_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "handoff_requested",
                                                "type": "string"
                                              },
                                              {
                                                "const": "queued",
                                                "type": "string"
                                              },
                                              {
                                                "const": "human_active",
                                                "type": "string"
                                              },
                                              {
                                                "const": "wrap_up",
                                                "type": "string"
                                              },
                                              {
                                                "const": "closed",
                                                "type": "string"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "from_state",
                                          "to_state",
                                          "state_version",
                                          "owner_epoch",
                                          "reason_code",
                                          "actor"
                                        ],
                                        "type": "object"
                                      }
                                    ]
                                  },
                                  "protocol_version": {
                                    "const": "2.0",
                                    "type": "string"
                                  },
                                  "sequence": {
                                    "maximum": 9007199254740991,
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "trace_id": {
                                    "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  },
                                  "type": {
                                    "const": "conversation.state_changed",
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "protocol_version",
                                  "event_id",
                                  "sequence",
                                  "conversation_id",
                                  "occurred_at",
                                  "trace_id",
                                  "type",
                                  "payload"
                                ],
                                "type": "object"
                              },
                              {
                                "additionalProperties": false,
                                "properties": {
                                  "conversation_id": {
                                    "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  },
                                  "event_id": {
                                    "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  },
                                  "occurred_at": {
                                    "format": "date-time",
                                    "type": "string"
                                  },
                                  "payload": {
                                    "additionalProperties": false,
                                    "properties": {
                                      "owner_epoch": {
                                        "maximum": 9007199254740991,
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "reason_code": {
                                        "anyOf": [
                                          {
                                            "const": "knowledge_insufficient",
                                            "type": "string"
                                          },
                                          {
                                            "const": "source_conflict",
                                            "type": "string"
                                          },
                                          {
                                            "const": "policy_restricted",
                                            "type": "string"
                                          },
                                          {
                                            "const": "high_risk_business",
                                            "type": "string"
                                          },
                                          {
                                            "const": "acl_denied",
                                            "type": "string"
                                          },
                                          {
                                            "const": "provider_unavailable",
                                            "type": "string"
                                          },
                                          {
                                            "const": "provider_unknown",
                                            "type": "string"
                                          },
                                          {
                                            "const": "citation_invalid",
                                            "type": "string"
                                          },
                                          {
                                            "const": "output_blocked",
                                            "type": "string"
                                          },
                                          {
                                            "const": "user_requested_human",
                                            "type": "string"
                                          },
                                          {
                                            "const": "business_rule_handoff",
                                            "type": "string"
                                          }
                                        ]
                                      },
                                      "state_version": {
                                        "maximum": 9007199254740991,
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "ticket_id": {
                                        "pattern": "^ht_[0-9A-HJKMNP-TV-Z]{26}$",
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "ticket_id",
                                      "reason_code",
                                      "state_version",
                                      "owner_epoch"
                                    ],
                                    "type": "object"
                                  },
                                  "protocol_version": {
                                    "const": "2.0",
                                    "type": "string"
                                  },
                                  "sequence": {
                                    "maximum": 9007199254740991,
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "trace_id": {
                                    "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                                    "type": "string"
                                  },
                                  "type": {
                                    "const": "handoff.requested",
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "protocol_version",
                                  "event_id",
                                  "sequence",
                                  "conversation_id",
                                  "occurred_at",
                                  "trace_id",
                                  "type",
                                  "payload"
                                ],
                                "type": "object"
                              }
                            ]
                          },
                          "maxItems": 100,
                          "type": "array"
                        },
                        "next_sequence": {
                          "maximum": 9007199254740991,
                          "minimum": 0,
                          "type": "integer"
                        }
                      },
                      "required": ["events", "next_sequence"],
                      "type": "object"
                    }
                  },
                  "required": ["data"],
                  "type": "object"
                }
              }
            },
            "description": "成功",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求无效",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Retry-After": {
                "required": true,
                "schema": {
                  "pattern": "^[0-9]+$",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBearer": []
          }
        ]
      }
    },
    "/client/v2/conversations/{conversation_id}/handoff-requests": {
      "post": {
        "operationId": "createHandoffRequestV2",
        "parameters": [
          {
            "in": "path",
            "name": "conversation_id",
            "required": true,
            "schema": {
              "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "required": true,
            "schema": {
              "maxLength": 2048,
              "minLength": 9,
              "pattern": "^https://(?![^/?#]*@)[A-Za-z0-9.-]+(?::[0-9]{1,5})?$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "queue_key": {
                    "pattern": "^[a-z][a-z0-9-]{0,62}$",
                    "type": "string"
                  },
                  "reason_code": {
                    "const": "user_requested_human",
                    "type": "string"
                  }
                },
                "required": ["reason_code"],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "protocol_version": {
                          "const": "2.0",
                          "type": "string"
                        },
                        "state": {
                          "const": "queued",
                          "type": "string"
                        },
                        "ticket_id": {
                          "pattern": "^ht_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["ticket_id", "state", "protocol_version"],
                      "type": "object"
                    }
                  },
                  "required": ["data"],
                  "type": "object"
                }
              }
            },
            "description": "成功",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求无效",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Retry-After": {
                "required": true,
                "schema": {
                  "pattern": "^[0-9]+$",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBearer": []
          }
        ]
      }
    },
    "/client/v2/conversations/{conversation_id}/messages": {
      "post": {
        "operationId": "createMessageV2",
        "parameters": [
          {
            "in": "path",
            "name": "conversation_id",
            "required": true,
            "schema": {
              "pattern": "^conv_[0-9A-HJKMNP-TV-Z]{26}$",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Origin",
            "required": true,
            "schema": {
              "maxLength": 2048,
              "minLength": 9,
              "pattern": "^https://(?![^/?#]*@)[A-Za-z0-9.-]+(?::[0-9]{1,5})?$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "parts": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "text": {
                          "maxLength": 8000,
                          "minLength": 1,
                          "type": "string"
                        },
                        "type": {
                          "const": "text",
                          "type": "string"
                        }
                      },
                      "required": ["type", "text"],
                      "type": "object"
                    },
                    "maxItems": 20,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": ["parts"],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "properties": {
                            "accepted": {
                              "const": true,
                              "type": "boolean"
                            },
                            "delivery": {
                              "const": "assistant",
                              "type": "string"
                            },
                            "message_id": {
                              "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                              "type": "string"
                            },
                            "run_id": {
                              "pattern": "^run_[0-9A-HJKMNP-TV-Z]{26}$",
                              "type": "string"
                            }
                          },
                          "required": ["accepted", "delivery", "message_id", "run_id"],
                          "type": "object"
                        },
                        {
                          "additionalProperties": false,
                          "properties": {
                            "accepted": {
                              "const": true,
                              "type": "boolean"
                            },
                            "delivery": {
                              "const": "support",
                              "type": "string"
                            },
                            "event_id": {
                              "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$",
                              "type": "string"
                            },
                            "event_sequence": {
                              "maximum": 9007199254740991,
                              "minimum": 1,
                              "type": "integer"
                            },
                            "message_id": {
                              "pattern": "^msg_[0-9A-HJKMNP-TV-Z]{26}$",
                              "type": "string"
                            },
                            "state": {
                              "anyOf": [
                                {
                                  "const": "handoff_requested",
                                  "type": "string"
                                },
                                {
                                  "const": "queued",
                                  "type": "string"
                                },
                                {
                                  "const": "human_active",
                                  "type": "string"
                                }
                              ]
                            }
                          },
                          "required": [
                            "accepted",
                            "delivery",
                            "message_id",
                            "event_id",
                            "event_sequence",
                            "state"
                          ],
                          "type": "object"
                        }
                      ]
                    }
                  },
                  "required": ["data"],
                  "type": "object"
                }
              }
            },
            "description": "成功",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求无效",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Retry-After": {
                "required": true,
                "schema": {
                  "pattern": "^[0-9]+$",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "anyOf": [
                            {
                              "const": "invalid_request",
                              "type": "string"
                            },
                            {
                              "const": "invalid_token",
                              "type": "string"
                            },
                            {
                              "const": "origin_not_allowed",
                              "type": "string"
                            },
                            {
                              "const": "payload_too_large",
                              "type": "string"
                            },
                            {
                              "const": "rate_limit_exceeded",
                              "type": "string"
                            },
                            {
                              "const": "conversation_not_found",
                              "type": "string"
                            },
                            {
                              "const": "idempotency_conflict",
                              "type": "string"
                            },
                            {
                              "const": "conversation_state_conflict",
                              "type": "string"
                            },
                            {
                              "const": "validation_error",
                              "type": "string"
                            },
                            {
                              "const": "temporarily_unavailable",
                              "type": "string"
                            }
                          ]
                        },
                        "message": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "trace_id": {
                          "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                          "type": "string"
                        }
                      },
                      "required": ["code", "message", "trace_id"],
                      "type": "object"
                    }
                  },
                  "required": ["error"],
                  "type": "object"
                }
              }
            },
            "description": "请求失败",
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "仅当请求 Origin 命中精确白名单时返回。",
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              },
              "Access-Control-Expose-Headers": {
                "required": true,
                "schema": {
                  "const": "X-Trace-Id, Retry-After",
                  "type": "string"
                }
              },
              "Cache-Control": {
                "required": true,
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Referrer-Policy": {
                "required": true,
                "schema": {
                  "const": "no-referrer",
                  "type": "string"
                }
              },
              "Vary": {
                "required": true,
                "schema": {
                  "const": "Origin",
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "required": true,
                "schema": {
                  "const": "nosniff",
                  "type": "string"
                }
              },
              "X-Trace-Id": {
                "required": true,
                "schema": {
                  "pattern": "^tr_[0-9A-HJKMNP-TV-Z]{26}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBearer": []
          }
        ]
      }
    }
  }
}
