{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.cheapgpu.com/specs/endpoint-v1-draft/schemas/openai-responses.schema.json",
  "$comment": "CheapGPU native Responses draft subset, not the complete OpenAI schema. Offline validation is not implementation, model identity, or billing authority.",
  "$ref": "#/$defs/request",
  "$defs": {
    "count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "schema": {
      "type": "object",
      "properties": {
        "type": {
          "oneOf": [
            {
              "enum": [
                "object",
                "array",
                "string",
                "number",
                "integer",
                "boolean",
                "null"
              ]
            },
            {
              "type": "array",
              "items": {
                "enum": [
                  "object",
                  "array",
                  "string",
                  "number",
                  "integer",
                  "boolean",
                  "null"
                ]
              },
              "minItems": 2,
              "maxItems": 2,
              "uniqueItems": true,
              "contains": {
                "const": "null"
              }
            }
          ]
        },
        "description": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/schema"
          }
        },
        "required": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "additionalProperties": {
          "type": "boolean"
        },
        "items": {
          "$ref": "#/$defs/schema"
        },
        "enum": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "if": {
          "$ref": "#/$defs/schema"
        },
        "then": {
          "$ref": "#/$defs/schema"
        },
        "else": {
          "$ref": "#/$defs/schema"
        },
        "$ref": {
          "type": "string",
          "pattern": "^#(?:/[^#]*)?$"
        },
        "$defs": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/schema"
          }
        },
        "anyOf": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/schema"
          }
        },
        "title": {
          "type": "string"
        },
        "const": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "pattern": {
          "type": "string"
        },
        "format": {
          "enum": [
            "date-time",
            "time",
            "date",
            "duration",
            "email",
            "hostname",
            "ipv4",
            "ipv6",
            "uuid"
          ]
        },
        "minimum": {
          "type": "number"
        },
        "maximum": {
          "type": "number"
        },
        "exclusiveMinimum": {
          "type": "number"
        },
        "exclusiveMaximum": {
          "type": "number"
        },
        "multipleOf": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "minItems": {
          "type": "integer",
          "minimum": 0
        },
        "maxItems": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false,
      "anyOf": [
        {
          "properties": {
            "type": {}
          },
          "required": [
            "type"
          ]
        },
        {
          "properties": {
            "$ref": {}
          },
          "required": [
            "$ref"
          ]
        },
        {
          "properties": {
            "anyOf": {}
          },
          "required": [
            "anyOf"
          ]
        }
      ]
    },
    "object_schema": {
      "allOf": [
        {
          "$ref": "#/$defs/schema"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "object"
            },
            "properties": {},
            "required": {},
            "additionalProperties": {}
          }
        }
      ]
    },
    "input_text": {
      "type": "object",
      "properties": {
        "type": {
          "const": "input_text"
        },
        "text": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "text"
      ],
      "additionalProperties": false
    },
    "input_image": {
      "type": "object",
      "properties": {
        "type": {
          "const": "input_image"
        },
        "image_url": {
          "type": "string",
          "pattern": "^data:image/(png|jpeg|webp|gif);base64,[A-Za-z0-9+/]+={0,2}$"
        },
        "detail": {
          "enum": [
            "low",
            "high",
            "original",
            "auto"
          ]
        }
      },
      "required": [
        "type",
        "image_url",
        "detail"
      ],
      "additionalProperties": false
    },
    "input_message": {
      "type": "object",
      "properties": {
        "type": {
          "const": "message"
        },
        "role": {
          "enum": [
            "system",
            "developer",
            "user",
            "assistant"
          ]
        },
        "content": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "oneOf": [
                  {
                    "$ref": "#/$defs/input_text"
                  },
                  {
                    "$ref": "#/$defs/input_image"
                  }
                ]
              },
              "minItems": 1
            }
          ]
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "required": [
        "role",
        "content"
      ],
      "additionalProperties": false
    },
    "output_text": {
      "type": "object",
      "properties": {
        "type": {
          "const": "output_text"
        },
        "text": {
          "type": "string"
        },
        "annotations": {
          "type": "array",
          "maxItems": 0
        },
        "logprobs": {
          "type": "array",
          "maxItems": 0
        }
      },
      "required": [
        "type",
        "text",
        "annotations"
      ],
      "additionalProperties": true
    },
    "refusal": {
      "type": "object",
      "properties": {
        "type": {
          "const": "refusal"
        },
        "refusal": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "refusal"
      ],
      "additionalProperties": true
    },
    "message": {
      "type": "object",
      "properties": {
        "type": {
          "const": "message"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "role": {
          "const": "assistant"
        },
        "status": {
          "enum": [
            "in_progress",
            "completed",
            "incomplete"
          ]
        },
        "content": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "$ref": "#/$defs/output_text"
              },
              {
                "$ref": "#/$defs/refusal"
              }
            ]
          },
          "minItems": 0
        },
        "phase": {
          "enum": [
            "commentary",
            "final_answer",
            null
          ]
        }
      },
      "required": [
        "type",
        "id",
        "role",
        "status",
        "content"
      ],
      "additionalProperties": false
    },
    "reasoning": {
      "type": "object",
      "properties": {
        "type": {
          "const": "reasoning"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "summary": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "const": "summary_text"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "text"
            ],
            "additionalProperties": false
          },
          "minItems": 0
        },
        "encrypted_content": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "enum": [
            "in_progress",
            "completed",
            "incomplete"
          ]
        },
        "content": {
          "type": "array",
          "maxItems": 0
        }
      },
      "required": [
        "type",
        "id",
        "summary",
        "encrypted_content"
      ],
      "additionalProperties": false
    },
    "function_call": {
      "type": "object",
      "properties": {
        "type": {
          "const": "function_call"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "call_id": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,64}$"
        },
        "arguments": {
          "type": "string"
        },
        "status": {
          "enum": [
            "in_progress",
            "completed",
            "incomplete"
          ]
        }
      },
      "required": [
        "type",
        "id",
        "call_id",
        "name",
        "arguments"
      ],
      "additionalProperties": false
    },
    "output_item": {
      "oneOf": [
        {
          "$ref": "#/$defs/message"
        },
        {
          "$ref": "#/$defs/reasoning"
        },
        {
          "$ref": "#/$defs/function_call"
        }
      ]
    },
    "function_call_output": {
      "type": "object",
      "properties": {
        "type": {
          "const": "function_call_output"
        },
        "call_id": {
          "type": "string",
          "minLength": 1
        },
        "output": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "required": [
        "type",
        "call_id",
        "output"
      ],
      "additionalProperties": false
    },
    "function": {
      "type": "object",
      "properties": {
        "type": {
          "const": "function"
        },
        "name": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,64}$"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "parameters": {
          "oneOf": [
            {
              "$ref": "#/$defs/object_schema"
            },
            {
              "type": "null"
            }
          ],
          "description": "A supplied schema constrains parameters; null supplies no parameter schema. The ordinary Responses function tool reference requires this field."
        },
        "strict": {
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "required": [
        "type",
        "name",
        "parameters"
      ],
      "additionalProperties": false
    },
    "request": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string",
          "minLength": 1
        },
        "input": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "oneOf": [
                  {
                    "$ref": "#/$defs/input_message"
                  },
                  {
                    "$ref": "#/$defs/message"
                  },
                  {
                    "$ref": "#/$defs/reasoning"
                  },
                  {
                    "$ref": "#/$defs/function_call"
                  },
                  {
                    "$ref": "#/$defs/function_call_output"
                  }
                ]
              },
              "minItems": 0
            }
          ]
        },
        "instructions": {
          "type": [
            "string",
            "null"
          ]
        },
        "store": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Defaults to true when omitted. Null is forwarded unchanged."
        },
        "background": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Run asynchronously when true. Omission defaults to false; preserve explicit null."
        },
        "stream": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "truncation": {
          "enum": [
            "auto",
            "disabled",
            null
          ]
        },
        "max_output_tokens": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 16,
          "maximum": 9007199254740991
        },
        "reasoning": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "effort": {
              "enum": [
                "none",
                "minimal",
                "low",
                "medium",
                "high",
                "xhigh",
                "max",
                null
              ]
            },
            "summary": {
              "enum": [
                "auto",
                "concise",
                "detailed",
                null
              ]
            }
          },
          "additionalProperties": false
        },
        "text": {
          "type": "object",
          "properties": {
            "format": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "text"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "json_schema"
                    },
                    "name": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,64}$"
                    },
                    "schema": {
                      "$ref": "#/$defs/object_schema"
                    },
                    "strict": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "Defaults to false. Only explicit true guarantees adherence to the supplied supported schema."
                    },
                    "description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "name",
                    "schema"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "json_object"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "verbosity": {
              "enum": [
                "low",
                "medium",
                "high",
                null
              ]
            }
          },
          "additionalProperties": false
        },
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/function"
          },
          "minItems": 0
        },
        "tool_choice": {
          "oneOf": [
            {
              "enum": [
                "auto",
                "none",
                "required"
              ]
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "const": "function"
                },
                "name": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,64}$"
                }
              },
              "required": [
                "type",
                "name"
              ],
              "additionalProperties": false
            }
          ]
        },
        "parallel_tool_calls": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "prompt_cache_options": {
          "type": "object",
          "properties": {
            "ttl": {
              "enum": [
                "30m",
                "12h"
              ]
            }
          },
          "required": [
            "ttl"
          ],
          "additionalProperties": false
        },
        "previous_response_id": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^[A-Za-z0-9_-]+$"
        }
      },
      "required": [
        "model"
      ],
      "additionalProperties": false
    },
    "usage": {
      "type": "object",
      "properties": {
        "input_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "input_tokens_details": {
          "type": "object",
          "properties": {
            "cached_tokens": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "cache_write_tokens": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "cache_write_tokens_details": {
              "type": "object",
              "properties": {
                "ttl_30m_tokens": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "ttl_12h_tokens": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "ttl_30m_tokens",
                "ttl_12h_tokens"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "cached_tokens",
            "cache_write_tokens"
          ],
          "additionalProperties": false
        },
        "output_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "output_tokens_details": {
          "type": "object",
          "properties": {
            "reasoning_tokens": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "reasoning_tokens"
          ],
          "additionalProperties": false
        },
        "total_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "input_tokens",
        "input_tokens_details",
        "output_tokens",
        "output_tokens_details",
        "total_tokens"
      ],
      "additionalProperties": false
    },
    "response_error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": true
    },
    "response": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "object": {
          "const": "response"
        },
        "created_at": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "model": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "enum": [
            "in_progress",
            "completed",
            "failed",
            "incomplete",
            "queued",
            "cancelled"
          ]
        },
        "store": {
          "type": "boolean"
        },
        "output": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/output_item"
          },
          "minItems": 0
        },
        "error": {
          "oneOf": [
            {
              "const": null
            },
            {
              "$ref": "#/$defs/response_error"
            }
          ]
        },
        "incomplete_details": {
          "oneOf": [
            {
              "const": null
            },
            {
              "type": "object",
              "properties": {
                "reason": {
                  "enum": [
                    "max_output_tokens",
                    "content_filter"
                  ]
                }
              },
              "required": [
                "reason"
              ],
              "additionalProperties": false
            }
          ]
        },
        "usage": {
          "oneOf": [
            {
              "const": null
            },
            {
              "$ref": "#/$defs/usage"
            }
          ]
        },
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/function"
          }
        },
        "previous_response_id": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 256
        },
        "background": {
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "object",
        "created_at",
        "model",
        "status",
        "store",
        "output",
        "error",
        "incomplete_details",
        "usage"
      ],
      "additionalProperties": true
    },
    "http_error": {
      "type": "object",
      "properties": {
        "error": {
          "type": "object",
          "properties": {
            "message": {
              "type": "string",
              "minLength": 1
            },
            "type": {
              "type": "string",
              "minLength": 1
            },
            "code": {
              "type": [
                "string",
                "null"
              ]
            },
            "param": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "message",
            "type"
          ],
          "additionalProperties": true
        }
      },
      "required": [
        "error"
      ],
      "additionalProperties": true
    },
    "event": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.created"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "response": {
              "$ref": "#/$defs/response"
            }
          },
          "required": [
            "type",
            "sequence_number",
            "response"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.in_progress"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "response": {
              "$ref": "#/$defs/response"
            }
          },
          "required": [
            "type",
            "sequence_number",
            "response"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.completed"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "response": {
              "$ref": "#/$defs/response"
            }
          },
          "required": [
            "type",
            "sequence_number",
            "response"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.failed"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "response": {
              "$ref": "#/$defs/response"
            }
          },
          "required": [
            "type",
            "sequence_number",
            "response"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.incomplete"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "response": {
              "$ref": "#/$defs/response"
            }
          },
          "required": [
            "type",
            "sequence_number",
            "response"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.output_item.added"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item": {
              "$ref": "#/$defs/output_item"
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "item"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.content_part.added"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "content_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item_id": {
              "type": "string",
              "minLength": 1
            },
            "part": {
              "oneOf": [
                {
                  "$ref": "#/$defs/output_text"
                },
                {
                  "$ref": "#/$defs/refusal"
                }
              ]
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "content_index",
            "item_id",
            "part"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.reasoning_summary_part.added"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "summary_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item_id": {
              "type": "string",
              "minLength": 1
            },
            "part": {
              "type": "object",
              "properties": {
                "type": {
                  "const": "summary_text"
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "text"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "summary_index",
            "item_id",
            "part"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.output_item.done"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item": {
              "$ref": "#/$defs/output_item"
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "item"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.content_part.done"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "content_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item_id": {
              "type": "string",
              "minLength": 1
            },
            "part": {
              "oneOf": [
                {
                  "$ref": "#/$defs/output_text"
                },
                {
                  "$ref": "#/$defs/refusal"
                }
              ]
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "content_index",
            "item_id",
            "part"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.reasoning_summary_part.done"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "summary_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item_id": {
              "type": "string",
              "minLength": 1
            },
            "part": {
              "type": "object",
              "properties": {
                "type": {
                  "const": "summary_text"
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "text"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "summary_index",
            "item_id",
            "part"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.output_text.delta"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item_id": {
              "type": "string",
              "minLength": 1
            },
            "delta": {
              "type": "string"
            },
            "content_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "item_id",
            "delta",
            "content_index"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.output_text.done"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item_id": {
              "type": "string",
              "minLength": 1
            },
            "text": {
              "type": "string"
            },
            "content_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "item_id",
            "text",
            "content_index"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.refusal.delta"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item_id": {
              "type": "string",
              "minLength": 1
            },
            "delta": {
              "type": "string"
            },
            "content_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "item_id",
            "delta",
            "content_index"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.refusal.done"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item_id": {
              "type": "string",
              "minLength": 1
            },
            "refusal": {
              "type": "string"
            },
            "content_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "item_id",
            "refusal",
            "content_index"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.function_call_arguments.delta"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item_id": {
              "type": "string",
              "minLength": 1
            },
            "delta": {
              "type": "string"
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "item_id",
            "delta"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.function_call_arguments.done"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item_id": {
              "type": "string",
              "minLength": 1
            },
            "arguments": {
              "type": "string"
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "item_id",
            "arguments"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.reasoning_summary_text.delta"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item_id": {
              "type": "string",
              "minLength": 1
            },
            "delta": {
              "type": "string"
            },
            "summary_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "item_id",
            "delta",
            "summary_index"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.reasoning_summary_text.done"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "output_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "item_id": {
              "type": "string",
              "minLength": 1
            },
            "text": {
              "type": "string"
            },
            "summary_index": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "type",
            "sequence_number",
            "output_index",
            "item_id",
            "text",
            "summary_index"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "error"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "code": {
              "type": [
                "string",
                "null"
              ]
            },
            "message": {
              "type": "string",
              "minLength": 1
            },
            "param": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "sequence_number",
            "message"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "response.queued"
            },
            "sequence_number": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "response": {
              "$ref": "#/$defs/response"
            }
          },
          "required": [
            "type",
            "sequence_number",
            "response"
          ],
          "additionalProperties": true
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "keepalive"
            },
            "sequence_number": {
              "$ref": "#/$defs/count"
            }
          },
          "required": [
            "type",
            "sequence_number"
          ],
          "additionalProperties": true
        }
      ]
    },
    "deleted": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "object",
        "deleted"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "object": {
          "const": "response.deleted"
        },
        "deleted": {
          "const": true
        }
      }
    },
    "input_items": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "object",
        "data",
        "first_id",
        "last_id",
        "has_more"
      ],
      "properties": {
        "object": {
          "const": "list"
        },
        "data": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "allOf": [
              {
                "oneOf": [
                  {
                    "$ref": "#/$defs/input_message"
                  },
                  {
                    "$ref": "#/$defs/message"
                  },
                  {
                    "$ref": "#/$defs/reasoning"
                  },
                  {
                    "$ref": "#/$defs/function_call"
                  },
                  {
                    "$ref": "#/$defs/function_call_output"
                  }
                ]
              },
              {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                }
              }
            ]
          }
        },
        "first_id": {
          "type": "string"
        },
        "last_id": {
          "type": "string"
        },
        "has_more": {
          "type": "boolean"
        }
      }
    }
  }
}
