{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/archestra/main/json-schema/archestra-openrouter-chat-completion-request-schema.json",
  "title": "OpenrouterChatCompletionRequest",
  "x-generated": "2026-10-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/archestra-openapi.json#/components/schemas/OpenrouterChatCompletionRequest",
  "type": "object",
  "properties": {
    "model": {
      "type": "string"
    },
    "messages": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "content": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "text"
                          ]
                        },
                        "text": {
                          "type": "string"
                        },
                        "cache_control": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "ephemeral"
                              ]
                            },
                            "ttl": {
                              "type": "string",
                              "enum": [
                                "5m",
                                "1h"
                              ]
                            }
                          },
                          "required": [
                            "type"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "type",
                        "text"
                      ],
                      "additionalProperties": false
                    }
                  }
                ]
              },
              "role": {
                "type": "string",
                "enum": [
                  "developer"
                ]
              },
              "name": {
                "type": "string"
              },
              "cache_control": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "ephemeral"
                    ]
                  },
                  "ttl": {
                    "type": "string",
                    "enum": [
                      "5m",
                      "1h"
                    ]
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "content",
              "role"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "content": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "text"
                          ]
                        },
                        "text": {
                          "type": "string"
                        },
                        "cache_control": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "ephemeral"
                              ]
                            },
                            "ttl": {
                              "type": "string",
                              "enum": [
                                "5m",
                                "1h"
                              ]
                            }
                          },
                          "required": [
                            "type"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "type",
                        "text"
                      ],
                      "additionalProperties": false
                    }
                  }
                ]
              },
              "role": {
                "type": "string",
                "enum": [
                  "system"
                ]
              },
              "name": {
                "type": "string"
              },
              "cache_control": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "ephemeral"
                    ]
                  },
                  "ttl": {
                    "type": "string",
                    "enum": [
                      "5m",
                      "1h"
                    ]
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "content",
              "role"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "content": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "text"
                              ]
                            },
                            "text": {
                              "type": "string"
                            },
                            "cache_control": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "ephemeral"
                                  ]
                                },
                                "ttl": {
                                  "type": "string",
                                  "enum": [
                                    "5m",
                                    "1h"
                                  ]
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "type",
                            "text"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "image_url"
                              ]
                            },
                            "image_url": {
                              "type": "object",
                              "properties": {
                                "url": {
                                  "type": "string"
                                },
                                "detail": {
                                  "type": "string",
                                  "enum": [
                                    "auto",
                                    "low",
                                    "high"
                                  ]
                                }
                              },
                              "required": [
                                "url"
                              ],
                              "additionalProperties": false,
                              "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L765"
                            }
                          },
                          "required": [
                            "type",
                            "image_url"
                          ],
                          "additionalProperties": false,
                          "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L755"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "input_audio"
                              ]
                            },
                            "input_audio": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "string"
                                },
                                "format": {
                                  "type": "string",
                                  "enum": [
                                    "wav",
                                    "mp3"
                                  ]
                                }
                              },
                              "required": [
                                "data",
                                "format"
                              ],
                              "additionalProperties": false,
                              "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L792"
                            }
                          },
                          "required": [
                            "type",
                            "input_audio"
                          ],
                          "additionalProperties": false,
                          "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L782"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "file"
                              ]
                            },
                            "file": {
                              "type": "object",
                              "properties": {
                                "file_data": {
                                  "type": "string"
                                },
                                "file_id": {
                                  "type": "string"
                                },
                                "filename": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false,
                              "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L732"
                            }
                          },
                          "required": [
                            "type",
                            "file"
                          ],
                          "additionalProperties": false,
                          "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L722"
                        }
                      ]
                    }
                  }
                ]
              },
              "role": {
                "type": "string",
                "enum": [
                  "user"
                ]
              },
              "name": {
                "type": "string"
              },
              "cache_control": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "ephemeral"
                    ]
                  },
                  "ttl": {
                    "type": "string",
                    "enum": [
                      "5m",
                      "1h"
                    ]
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "content",
              "role"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "role": {
                "type": "string",
                "enum": [
                  "assistant"
                ]
              },
              "audio": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              },
              "content": {
                "nullable": true,
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "text"
                          ]
                        },
                        "text": {
                          "type": "string"
                        },
                        "cache_control": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "ephemeral"
                              ]
                            },
                            "ttl": {
                              "type": "string",
                              "enum": [
                                "5m",
                                "1h"
                              ]
                            }
                          },
                          "required": [
                            "type"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "type",
                        "text"
                      ],
                      "additionalProperties": false
                    }
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "refusal"
                          ]
                        },
                        "refusal": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "refusal"
                      ],
                      "additionalProperties": false,
                      "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L805"
                    }
                  }
                ]
              },
              "function_call": {
                "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L431",
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "arguments": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "arguments",
                  "name"
                ],
                "additionalProperties": false
              },
              "name": {
                "type": "string"
              },
              "reasoning_content": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "refusal": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tool_calls": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "function"
                          ]
                        },
                        "function": {
                          "type": "object",
                          "properties": {
                            "arguments": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "arguments",
                            "name"
                          ],
                          "additionalProperties": false,
                          "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L1165"
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "function"
                      ],
                      "additionalProperties": false,
                      "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L1144"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "custom"
                          ]
                        },
                        "custom": {
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "input",
                            "name"
                          ],
                          "additionalProperties": false,
                          "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L1128"
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "custom"
                      ],
                      "additionalProperties": false,
                      "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L1107"
                    }
                  ],
                  "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L1197"
                }
              },
              "cache_control": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "ephemeral"
                    ]
                  },
                  "ttl": {
                    "type": "string",
                    "enum": [
                      "5m",
                      "1h"
                    ]
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "role"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "role": {
                "type": "string",
                "enum": [
                  "tool"
                ]
              },
              "content": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "text"
                              ]
                            },
                            "text": {
                              "type": "string"
                            },
                            "cache_control": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "ephemeral"
                                  ]
                                },
                                "ttl": {
                                  "type": "string",
                                  "enum": [
                                    "5m",
                                    "1h"
                                  ]
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "type",
                            "text"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "image_url"
                              ]
                            },
                            "image_url": {
                              "type": "object",
                              "properties": {
                                "url": {
                                  "type": "string"
                                },
                                "detail": {
                                  "type": "string",
                                  "enum": [
                                    "auto",
                                    "low",
                                    "high"
                                  ]
                                }
                              },
                              "required": [
                                "url"
                              ],
                              "additionalProperties": false,
                              "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L765"
                            }
                          },
                          "required": [
                            "type",
                            "image_url"
                          ],
                          "additionalProperties": false,
                          "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L755"
                        }
                      ]
                    }
                  }
                ]
              },
              "tool_call_id": {
                "type": "string"
              },
              "cache_control": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "ephemeral"
                    ]
                  },
                  "ttl": {
                    "type": "string",
                    "enum": [
                      "5m",
                      "1h"
                    ]
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "role",
              "content",
              "tool_call_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "role": {
                "type": "string",
                "enum": [
                  "function"
                ]
              },
              "content": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "role",
              "content",
              "name"
            ],
            "additionalProperties": false,
            "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L968"
          }
        ]
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "function"
                ]
              },
              "function": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "parameters": {
                    "description": "\n    https://github.com/openai/openai-node/blob/master/src/resources/shared.ts#L217\n\n    The parameters the functions accepts, described as a JSON Schema object. See the\n    [guide](https://platform.openai.com/docs/guides/function-calling) for examples,\n    and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for\n    documentation about the format.\n\n    Omitting parameters defines a function with an empty parameter list.\n  ",
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "strict": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false,
                "description": "https://github.com/openai/openai-node/blob/master/src/resources/shared.ts#L174"
              }
            },
            "required": [
              "type",
              "function"
            ],
            "additionalProperties": false,
            "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L988"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "custom"
                ]
              },
              "custom": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the custom tool, used to identify it in tool calls"
                  },
                  "description": {
                    "description": "Optional description of the custom tool, used to provide more context",
                    "type": "string"
                  },
                  "format": {
                    "description": "The input format for the custom tool. Default is unconstrained text.",
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "text"
                            ],
                            "description": "Unconstrained text format. Always `text`"
                          }
                        },
                        "required": [
                          "type"
                        ],
                        "additionalProperties": false,
                        "description": "Unconstrained free-form text"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "grammar"
                            ]
                          },
                          "grammar": {
                            "type": "object",
                            "properties": {
                              "definition": {
                                "type": "string",
                                "description": "The grammar definition"
                              },
                              "syntax": {
                                "type": "string",
                                "enum": [
                                  "lark",
                                  "regex"
                                ],
                                "description": "The syntax of the grammar definition"
                              }
                            },
                            "required": [
                              "definition",
                              "syntax"
                            ],
                            "additionalProperties": false,
                            "description": "Your chosen grammar"
                          }
                        },
                        "required": [
                          "type",
                          "grammar"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "custom"
            ],
            "additionalProperties": false,
            "description": "\n  Specifies a tool the model should use. Use to force the model to call a specific custom tool.\n\n  https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L1229-L1236\n  "
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "custom"
                ]
              },
              "name": {
                "type": "string",
                "description": "The name of the custom tool, used to identify it in tool calls"
              },
              "description": {
                "description": "Optional description of the custom tool, used to provide more context",
                "type": "string"
              },
              "format": {
                "description": "The input format for the custom tool. Default is unconstrained text.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "text"
                        ],
                        "description": "Unconstrained text format. Always `text`"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false,
                    "description": "Unconstrained free-form text"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "grammar"
                        ]
                      },
                      "definition": {
                        "type": "string",
                        "description": "The grammar definition"
                      },
                      "syntax": {
                        "type": "string",
                        "enum": [
                          "lark",
                          "regex"
                        ],
                        "description": "The syntax of the grammar definition"
                      }
                    },
                    "required": [
                      "type",
                      "definition",
                      "syntax"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "type",
              "name"
            ],
            "additionalProperties": false,
            "description": "\n  A custom tool in the flat Responses-API shape ('name'/'format' at the top\n  level, grammar fields inlined) rather than Chat Completions' nested 'custom'\n  wrapper. Some clients (e.g. Cursor's ApplyPatch tool) send this shape to\n  /chat/completions and OpenAI accepts it, so the proxy must too.\n\n  https://github.com/openai/openai-node/blob/v6.0.0/src/resources/responses/responses.ts (CustomTool)\n  "
          }
        ],
        "description": "\n  A function tool that can be used to generate a response.\n\n  https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L1392\n  "
      }
    },
    "tool_choice": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "none",
            "auto",
            "required"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "allowed_tools"
              ]
            },
            "allowed_tools": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "auto",
                    "required"
                  ],
                  "description": "\n    Constrains the tools available to the model to a pre-defined set.\n\n    auto allows the model to pick from among the allowed tools and generate a\n    message.\n\n    required requires the model to call one or more of the allowed tools.\n    "
                },
                "tools": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "function"
                          ]
                        },
                        "function": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "parameters": {
                              "description": "\n    https://github.com/openai/openai-node/blob/master/src/resources/shared.ts#L217\n\n    The parameters the functions accepts, described as a JSON Schema object. See the\n    [guide](https://platform.openai.com/docs/guides/function-calling) for examples,\n    and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for\n    documentation about the format.\n\n    Omitting parameters defines a function with an empty parameter list.\n  ",
                              "type": "object",
                              "additionalProperties": {}
                            },
                            "strict": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "name"
                          ],
                          "additionalProperties": false,
                          "description": "https://github.com/openai/openai-node/blob/master/src/resources/shared.ts#L174"
                        }
                      },
                      "required": [
                        "type",
                        "function"
                      ],
                      "additionalProperties": false,
                      "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L988"
                    }
                  },
                  "description": "A list of tool definitions that the model should be allowed to call"
                }
              },
              "required": [
                "mode",
                "tools"
              ],
              "additionalProperties": false,
              "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L1455"
            }
          },
          "required": [
            "type",
            "allowed_tools"
          ],
          "additionalProperties": false,
          "description": "\n  Constrains the tools available to the model to a pre-defined set.\n\n  https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L359\n  "
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "function"
              ]
            },
            "function": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "type",
            "function"
          ],
          "additionalProperties": false,
          "description": "\n  Specifies a tool the model should use. Use to force the model to call a specific function.\n\n  https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L1207-L1214\n  "
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "custom"
              ]
            },
            "custom": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The name of the custom tool, used to identify it in tool calls"
                },
                "description": {
                  "description": "Optional description of the custom tool, used to provide more context",
                  "type": "string"
                },
                "format": {
                  "description": "The input format for the custom tool. Default is unconstrained text.",
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "text"
                          ],
                          "description": "Unconstrained text format. Always `text`"
                        }
                      },
                      "required": [
                        "type"
                      ],
                      "additionalProperties": false,
                      "description": "Unconstrained free-form text"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "grammar"
                          ]
                        },
                        "grammar": {
                          "type": "object",
                          "properties": {
                            "definition": {
                              "type": "string",
                              "description": "The grammar definition"
                            },
                            "syntax": {
                              "type": "string",
                              "enum": [
                                "lark",
                                "regex"
                              ],
                              "description": "The syntax of the grammar definition"
                            }
                          },
                          "required": [
                            "definition",
                            "syntax"
                          ],
                          "additionalProperties": false,
                          "description": "Your chosen grammar"
                        }
                      },
                      "required": [
                        "type",
                        "grammar"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "type",
            "custom"
          ],
          "additionalProperties": false,
          "description": "\n  Specifies a tool the model should use. Use to force the model to call a specific custom tool.\n\n  https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L1229-L1236\n  "
        }
      ],
      "description": "https://github.com/openai/openai-node/blob/v6.0.0/src/resources/chat/completions/completions.ts#L1405"
    },
    "temperature": {
      "type": [
        "number",
        "null"
      ]
    },
    "max_tokens": {
      "type": [
        "number",
        "null"
      ]
    },
    "max_completion_tokens": {
      "type": [
        "integer",
        "null"
      ],
      "exclusiveMinimum": true,
      "maximum": 9007199254740991
    },
    "reasoning_effort": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "none",
        "minimal",
        "low",
        "medium",
        "high",
        "xhigh",
        "max"
      ]
    },
    "stream": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "stream_options": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "include_usage": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "user": {
      "type": "string"
    },
    "response_format": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "text",
            "json_object",
            "json_schema"
          ]
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": {}
    },
    "reasoning": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "effort": {
          "type": "string"
        },
        "max_tokens": {
          "type": "integer",
          "exclusiveMinimum": true,
          "maximum": 9007199254740991
        },
        "exclude": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "model",
    "messages"
  ],
  "additionalProperties": false
}