官方文档 OpenAI Chat
$UIUIAPI_API_KEY 是您的 API 密钥。您可以在 OpenAI 平台的 API 密钥页面中找到或生成 API 密钥。messagesmodelstorereasoning_effortmetadatamodalitiespredictionaudiotemperaturetop_p,但不要同时更改。top_ptemperature,但不要同时更改。nn 为 1 可最大限度地降低成本。stopmax_tokensmax_completion_tokens,并且与 o1 系列模型不兼容。presence_penaltyfrequency_penaltylogit_biasuserservice_tierstream_optionsstream: true 时使用。response_format{ "type": "json_schema", "json_schema": {...} } 启用结构化输出,确保模型将匹配您提供的 JSON schema。{ "type": "json_object" } 启用 JSON 模式,确保模型生成的消息是有效的 JSON。seedtoolstool_choicenone:模型不会调用任何工具,而是生成消息 - auto:模型可以在生成消息或调用一个或多个工具之间选择 - required:模型必须调用一个或多个工具 - {"type": "function", "function": {"name": "my_function"}}:强制模型调用特定工具none,有工具时默认为 auto。parallel_tool_callsidobjectcreatedmodelsystem_fingerprintchoicesindex: 选项索引message: 包含角色和内容的消息对象logprobs: 日志概 率信息finish_reason: 完成原因usageprompt_tokens: 提示使用的 token 数completion_tokens: 补全使用的 token 数total_tokens: 总 token 数completion_tokens_details: token 详细信息