提示:配置完成后,在应用或客户端模型选择中填入 gpt-5.2-codex 即可无缝调用。
🚀 直接调用示例(HTTP 请求方式)#
Request#
📝 请求参数#
| 参数名 | 类型 | 是否必填 | 说明 |
|---|
model | string | 是 | 固定值:gpt-5.2-codex |
messages | array | 是 | 对话消息列表,包含 role 与 content |
temperature | number | 否 | 采样温度(建议设置较低,如 0.2 以保证代码确定性) |
max_tokens | integer | 否 | 单次调用的最大生成 token 数 |
stream | boolean | 否 | 是否开启流式传输(打字机模式) |
📤 示例响应#
{
"id": "chatcmpl-codex52-111203i",
"object": "chat.completion",
"created": 1784534400,
"model": "gpt-5.2-codex",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "```go\npackage main\n\nimport (\n\t\"context\"\n\t\"time\"\n)\n...\n```"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 120,
"total_tokens": 144
}
}
Modified at 2026-07-21 12:29:15