{
  "openapi": "3.1.0",
  "info": {
    "title": "Nouswise API",
    "version": "v0.1.0",
    "description": "API specification for Nouswise, providing endpoints for chat completions and responses."
  },
  "servers": [
    {
      "url": "https://api.nouswise.ai"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1/responses": {
      "post": {
        "summary": "Create a Response",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateResponseParams"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid API Key",
            "content": {
              "application/json": {}
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/v1/chat/completions": {
      "post": {
        "summary": "Create a chat completion",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionParams"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid API Key",
            "content": {
              "application/json": {}
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ChatCompletionResponse": {
        "type": "object",
        "required": [
          "id",
          "object",
          "created",
          "model",
          "choices"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the response"
          },
          "object": {
            "type": "string",
            "enum": [
              "chat.completion"
            ],
            "description": "The object type, always 'chat.completion'"
          },
          "created": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp of when the response was created"
          },
          "model": {
            "type": "string",
            "description": "The model used for generating the completion"
          },
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Choice"
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage",
            "description": "Information about token usage"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "detail"
        ],
        "properties": {
          "detail": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            },
            "description": "Detailed error information"
          }
        }
      },
      "ErrorDetail": {
        "type": "object",
        "properties": {
          "loc": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Location of the error"
          },
          "msg": {
            "type": "string",
            "description": "Error message"
          },
          "type": {
            "type": "string",
            "description": "Type of error"
          }
        }
      },
      "Response": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "example": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b"
          },
          "object": {
            "type": "string",
            "enum": [
              "response"
            ]
          },
          "created_at": {
            "type": "integer",
            "format": "int64",
            "example": 1741476542
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "completed",
              "failed",
              "cancelled"
            ],
            "example": "completed"
          },
          "error": {
            "$ref": "#/components/schemas/ErrorObject",
            "nullable": true
          },
          "incomplete_details": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          },
          "instructions": {
            "type": "string",
            "nullable": true
          },
          "max_output_tokens": {
            "type": "integer",
            "nullable": true
          },
          "model": {
            "type": "string",
            "example": "gpt-4.1-2025-04-14"
          },
          "output": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutputMessage"
            }
          },
          "parallel_tool_calls": {
            "type": "boolean"
          },
          "previous_response_id": {
            "type": "string",
            "nullable": true
          },
          "reasoning": {
            "$ref": "#/components/schemas/Reasoning"
          },
          "store": {
            "type": "boolean"
          },
          "temperature": {
            "type": "number",
            "format": "float",
            "example": 1
          },
          "text": {
            "$ref": "#/components/schemas/TextConfig"
          },
          "tool_choice": {
            "type": "string",
            "example": "auto"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolObject"
            }
          },
          "top_p": {
            "type": "number",
            "format": "float",
            "example": 1
          },
          "truncation": {
            "type": "string",
            "enum": [
              "disabled",
              "start",
              "end"
            ]
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          },
          "user": {
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "id",
          "object",
          "created_at",
          "status",
          "model",
          "output",
          "parallel_tool_calls",
          "store",
          "temperature",
          "text",
          "tool_choice",
          "tools",
          "top_p",
          "truncation",
          "usage",
          "metadata"
        ]
      },
      "OutputMessage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "message"
            ]
          },
          "id": {
            "type": "string",
            "example": "msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "completed",
              "failed"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "assistant",
              "user",
              "system"
            ]
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContentItem"
            }
          }
        },
        "required": [
          "type",
          "id",
          "status",
          "role",
          "content"
        ]
      },
      "Choice": {
        "type": "object",
        "required": [
          "index",
          "finish_reason"
        ],
        "properties": {
          "index": {
            "type": "integer",
            "description": "The choice index"
          },
          "finish_reason": {
            "type": "string",
            "enum": [
              "stop",
              "length",
              "content_filter",
              "tool_calls",
              "function_call"
            ],
            "description": "The reason why the completion finished"
          },
          "message": {
            "$ref": "#/components/schemas/MessageWithCitations",
            "description": "The message content with citations"
          },
          "refusal": {
            "type": "string",
            "nullable": true,
            "description": "Reason for refusal, if any"
          }
        }
      },
      "MessageWithCitations": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Message"
          },
          {
            "type": "object",
            "properties": {
              "citations": {
                "$ref": "#/components/schemas/Citation",
                "description": "Citations for the message"
              }
            }
          }
        ]
      },
      "Citation": {
        "type": "object",
        "required": [
          "paragraph"
        ],
        "properties": {
          "paragraph": {
            "type": "string",
            "description": "The cited paragraph"
          },
          "page_number": {
            "type": "string",
            "description": "Page number of the citation"
          }
        }
      },
      "Message": {
        "type": "object",
        "required": [
          "role"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "user",
              "assistant",
              "function",
              "developer"
            ],
            "description": "The role of the message sender"
          },
          "content": {
            "type": "string",
            "nullable": true,
            "description": "The content of the message"
          },
          "name": {
            "type": "string",
            "description": "The name of the message sender"
          },
          "function_call": {
            "$ref": "#/components/schemas/FunctionCall",
            "description": "Function call details"
          }
        }
      },
      "FunctionCall": {
        "type": "object",
        "required": [
          "name",
          "arguments"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the function to call"
          },
          "arguments": {
            "type": "string",
            "description": "JSON string of the arguments to pass to the function"
          }
        }
      },
      "Tool": {
        "type": "object",
        "required": [
          "name",
          "parameters"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the tool"
          },
          "description": {
            "type": "string",
            "description": "A description of the tool"
          },
          "parameters": {
            "type": "object",
            "description": "Parameters schema for the tool"
          }
        },
        "additionalProperties": false
      },
      "Function": {
        "type": "object",
        "required": [
          "name",
          "parameters"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the function"
          },
          "description": {
            "type": "string",
            "description": "A description of the function"
          },
          "parameters": {
            "type": "object",
            "description": "Parameters schema for the function"
          }
        },
        "additionalProperties": false
      },
      "ContentItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "output_text",
              "image",
              "audio",
              "video"
            ]
          },
          "text": {
            "type": "string"
          },
          "annotations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "type"
        ]
      },
      "Reasoning": {
        "type": "object",
        "properties": {
          "effort": {
            "type": "string",
            "nullable": true
          },
          "summary": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "TextConfig": {
        "type": "object",
        "properties": {
          "format": {
            "$ref": "#/components/schemas/TextFormat"
          }
        },
        "required": [
          "format"
        ]
      },
      "TextFormat": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "markdown",
              "html"
            ]
          }
        },
        "required": [
          "type"
        ]
      },
      "Usage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "integer"
          },
          "input_tokens_details": {
            "$ref": "#/components/schemas/TokenDetails"
          },
          "output_tokens": {
            "type": "integer"
          },
          "output_tokens_details": {
            "$ref": "#/components/schemas/TokenDetails"
          },
          "total_tokens": {
            "type": "integer"
          }
        },
        "required": [
          "input_tokens",
          "input_tokens_details",
          "output_tokens",
          "output_tokens_details",
          "total_tokens"
        ]
      },
      "TokenDetails": {
        "type": "object",
        "properties": {
          "cached_tokens": {
            "type": "integer",
            "nullable": true
          },
          "reasoning_tokens": {
            "type": "integer",
            "nullable": true
          }
        }
      },
      "ToolObject": {
        "type": "object",
        "description": "Arbitrary tool metadata; structure may vary.",
        "additionalProperties": true
      },
      "ErrorObject": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CreateResponseParams": {
        "type": "object",
        "properties": {
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "content": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "input_text"
                                      },
                                      "text": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "text"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "input_image"
                                      },
                                      "image_url": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "image_url"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "input_file"
                                      },
                                      "file_data": {
                                        "type": [
                                          "string",
                                          "null"
                                        ],
                                        "default": null
                                      },
                                      "file_url": {
                                        "type": [
                                          "string",
                                          "null"
                                        ],
                                        "format": "uri",
                                        "default": null
                                      },
                                      "filename": {
                                        "type": [
                                          "string",
                                          "null"
                                        ],
                                        "default": null
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ]
                                  }
                                ]
                              }
                            }
                          ]
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant",
                            "system",
                            "developer"
                          ]
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "message"
                          ],
                          "default": "message"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "content",
                        "role"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "user",
                            "system",
                            "developer"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "in_progress",
                            "completed",
                            "incomplete",
                            null
                          ],
                          "default": null
                        },
                        "content": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "input_text"
                                  },
                                  "text": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "text"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "input_image"
                                  },
                                  "image_url": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "image_url"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "input_file"
                                  },
                                  "file_data": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "default": null
                                  },
                                  "file_url": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "format": "uri",
                                    "default": null
                                  },
                                  "filename": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "default": null
                                  }
                                },
                                "required": [
                                  "type"
                                ]
                              }
                            ]
                          }
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "message"
                          ],
                          "default": "message"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "role",
                        "content"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "assistant"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "in_progress",
                            "completed",
                            "incomplete"
                          ]
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "message"
                          ],
                          "default": "message"
                        },
                        "content": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "output_text"
                                  },
                                  "text": {
                                    "type": "string"
                                  },
                                  "annotations": {
                                    "type": [
                                      "array",
                                      "null"
                                    ],
                                    "items": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "tool_citation"
                                            },
                                            "tool_call_id": {
                                              "type": "string"
                                            },
                                            "item_index": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "tool_call_id",
                                            "item_index"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "context_citation"
                                            },
                                            "item_index": {
                                              "type": "integer"
                                            },
                                            "content_index": {
                                              "type": "integer"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "item_index",
                                            "content_index"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "original_span": {
                                              "type": "string"
                                            },
                                            "start_span": {
                                              "type": "integer"
                                            },
                                            "end_span": {
                                              "type": "integer"
                                            },
                                            "index": {
                                              "type": "integer"
                                            },
                                            "type": {
                                              "type": "string",
                                              "const": "file_citation"
                                            },
                                            "file_id": {
                                              "type": "string"
                                            },
                                            "filename": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "start_span",
                                            "end_span",
                                            "index",
                                            "type",
                                            "file_id",
                                            "filename"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "url_citation"
                                            },
                                            "start_index": {
                                              "type": "integer"
                                            },
                                            "end_index": {
                                              "type": "integer"
                                            },
                                            "title": {
                                              "type": "string"
                                            },
                                            "url": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "title",
                                            "url"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "container_file_citation"
                                            },
                                            "container_id": {
                                              "type": "string"
                                            },
                                            "file_id": {
                                              "type": "string"
                                            },
                                            "filename": {
                                              "type": "string"
                                            },
                                            "start_index": {
                                              "type": "integer"
                                            },
                                            "end_index": {
                                              "type": "integer"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "container_id",
                                            "file_id",
                                            "filename"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "file_path"
                                            },
                                            "file_id": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "file_id"
                                          ]
                                        }
                                      ]
                                    }
                                  },
                                  "logprobs": {
                                    "type": [
                                      "array",
                                      "null"
                                    ],
                                    "items": {
                                      "type": "object",
                                      "additionalProperties": {}
                                    }
                                  }
                                },
                                "required": [
                                  "type",
                                  "text"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "refusal"
                                  },
                                  "refusal": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "refusal"
                                ]
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "role",
                        "content"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "function_call"
                        },
                        "id": {
                          "type": "string"
                        },
                        "call_id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "arguments": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "in_progress",
                            "completed",
                            "incomplete"
                          ]
                        }
                      },
                      "required": [
                        "type",
                        "call_id",
                        "name",
                        "arguments"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "call_id": {
                          "type": "string"
                        },
                        "output": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "const": "function_call_output"
                        },
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "in_progress",
                            "completed",
                            "incomplete"
                          ]
                        }
                      },
                      "required": [
                        "call_id",
                        "output",
                        "type"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "mcp_list_tools"
                        },
                        "id": {
                          "type": "string"
                        },
                        "server_label": {
                          "type": "string"
                        },
                        "tools": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "input_schema": {
                                "type": "object",
                                "additionalProperties": {}
                              },
                              "description": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "annotations": {
                                "type": "object"
                              }
                            },
                            "required": [
                              "name",
                              "input_schema"
                            ]
                          }
                        },
                        "error": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "type",
                        "id",
                        "server_label",
                        "tools"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "mcp_approval_request"
                        },
                        "id": {
                          "type": "string"
                        },
                        "server_label": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "arguments": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id",
                        "server_label",
                        "name",
                        "arguments"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "mcp_approval_response"
                        },
                        "id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "default": null
                        },
                        "approval_request_id": {
                          "type": "string"
                        },
                        "approve": {
                          "type": "boolean"
                        },
                        "reason": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "default": null
                        }
                      },
                      "required": [
                        "type",
                        "approval_request_id",
                        "approve"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "mcp_call"
                        },
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "server_label": {
                          "type": "string"
                        },
                        "arguments": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id",
                        "name",
                        "server_label",
                        "arguments"
                      ]
                    }
                  ]
                }
              }
            ]
          },
          "instructions": {
            "type": [
              "string",
              "null"
            ],
            "default": null
          },
          "max_output_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "default": null
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "propertyNames": {
              "type": "string",
              "maxLength": 64
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 512
            },
            "default": null
          },
          "model": {
            "type": "string",
            "enum": [
              "standard",
              "advanced"
            ],
            "default": "standard"
          },
          "reasoning": {
            "type": "object",
            "properties": {
              "effort": {
                "type": "string",
                "enum": [
                  "low",
                  "medium",
                  "high"
                ],
                "default": "medium"
              },
              "summary": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "auto",
                  "concise",
                  "detailed",
                  null
                ],
                "default": null
              }
            }
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 2,
            "default": 1
          },
          "text": {
            "type": "object",
            "properties": {
              "format": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "text"
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "json_object"
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "json_schema"
                      },
                      "name": {
                        "type": "string",
                        "pattern": "^[a-zA-Z0-9_-]+$",
                        "maxLength": 64
                      },
                      "description": {
                        "type": "string"
                      },
                      "schema": {
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "strict": {
                        "type": "boolean",
                        "default": false
                      }
                    },
                    "required": [
                      "type",
                      "name",
                      "schema"
                    ]
                  }
                ]
              }
            },
            "required": [
              "format"
            ]
          },
          "tool_choice": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "none",
                  "required"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "function"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "name"
                ]
              }
            ]
          },
          "tools": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "parameters": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "strict": {
                      "type": "boolean",
                      "default": false
                    },
                    "type": {
                      "type": "string",
                      "const": "function"
                    },
                    "description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "parameters",
                    "type"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "server_label": {
                      "type": "string"
                    },
                    "server_url": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "const": "mcp"
                    },
                    "allowed_tools": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "object",
                          "properties": {
                            "tool_names": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "tool_names"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null
                    },
                    "headers": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": {
                        "type": "string"
                      },
                      "default": null
                    },
                    "authorization": {
                      "type": "string"
                    },
                    "require_approval": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "always",
                            "never"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "always": {
                              "type": "object",
                              "properties": {
                                "tool_names": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "never": {
                              "type": "object",
                              "properties": {
                                "tool_names": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      ],
                      "default": "always"
                    }
                  },
                  "required": [
                    "server_label",
                    "server_url",
                    "type"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "file_search"
                    },
                    "max_num_results": {
                      "type": "number",
                      "minimum": 1,
                      "maximum": 500,
                      "default": 20
                    },
                    "vector_store_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "minItems": 1,
                      "maxItems": 1
                    }
                  },
                  "required": [
                    "type",
                    "vector_store_ids"
                  ]
                }
              ]
            }
          },
          "top_p": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 1
          }
        },
        "required": [
          "input"
        ]
      },
      "ChatCompletionParams": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "finish_reason": {
                  "type": "string",
                  "enum": [
                    "stop",
                    "length",
                    "content_filter",
                    "tool_calls",
                    "function_call"
                  ]
                },
                "index": {
                  "type": "number"
                },
                "refusal": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "message": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "system",
                        "user",
                        "assistant",
                        "function",
                        "developer"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "content": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "refusal": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tool_calls": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "function"
                            ]
                          },
                          "function": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "arguments": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name",
                              "arguments"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "function"
                        ]
                      }
                    },
                    "citations": {
                      "type": "object",
                      "properties": {
                        "paragraph": {
                          "type": "string"
                        },
                        "page_number": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "paragraph"
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ]
                }
              },
              "required": [
                "finish_reason",
                "index",
                "message"
              ]
            }
          },
          "created": {
            "type": "number"
          },
          "model": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "chat.completion"
          },
          "usage": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "completion_tokens": {
                "type": "number"
              },
              "context_tokens": {
                "type": "number"
              },
              "prompt_tokens": {
                "type": "number"
              },
              "total_tokens": {
                "type": "number"
              }
            },
            "required": [
              "completion_tokens",
              "prompt_tokens",
              "total_tokens"
            ]
          }
        },
        "required": [
          "id",
          "choices",
          "created",
          "model",
          "object"
        ]
      }
    }
  }
}