1. Responses
梧柏API使用文档
WHBAI · OpenAI 兼容
  • WHBAI · Google Gemini 原生 (v1alpha)
  • WHBAI · Google Gemini 原生
  • WHBAI · Ideogram
  • WHBAI · Ideogram V3
  • WHBAI · Midjourney
  • WHBAI · Jimeng
  • WHBAI · Kling
  • WHBAI · Luma
  • WHBAI · Luma V1
  • WHBAI · Omni 视频
  • WHBAI · Pixverse
  • WHBAI · Runway
  • WHBAI · Sora2
  • WHBAI · 统一视频 VEO
  • WHBAI · Vidu
  • WHBAI · 豆包 Volc
  • WHBAI · Suno
  • WHBAI · Playground
  • WHBAI · 账号与令牌
  • WHBAI · 阿里 Pix
  • WHBAI · 阿里百炼
  • WHBAI · 私域人像
  • WHBAI · Fal.ai
  • WHBAI · Replicate
  • WHBAI · 腾讯云 VOD
  • WHBAI · MiniMax
  • WHBAI · 支持模型列表
  • WHBAI · Grok Imagine
  • WHBAI · Seedance 2.0
  • WHBAI · TypeSafe
  • WHBAI · OpenAI 兼容
  • Chat
    • 对话补全(OpenAI 兼容)
      POST
  • Embeddings
    • 文本嵌入(OpenAI 兼容)
      POST
  • Audio
    • 音频转文字 gpt-4o-transcribe
      POST
    • 创建语音 gpt-4o-mini-tts
      POST
    • 创建翻译(部分模型不支持)
      POST
  • 文生图接口
    • GPT Image-1
      • 创建 gpt-image-2.5
    • Grok
      • 编辑image【"grok-imagine-image-quality" | "grok-imagine-image-2.0"】
  • Models
    • 获取令牌支持模型
      GET
  • Completions
    • 创建完成
      POST
  • Responses
    • 创建函数调用
      POST
    • gpt 上下文压缩
      POST
  • Rerank
    • 重排序
      POST
  • 智能交互
    • TypeSafe
      • TypeSafe System One
  • 谷歌Gemini
    • 原生格式
      • 图片生成 gemini-nano-banana-2.1
  • 品牌平台
    • MINIMAX-V2
      • 创建视频
      • 查询单个任务
  • 数据模型
    • 对话接口 POST /v1/chat/completions
    • V1ChatCompletionsResponse
    • V1EmbeddingsRequest
    • V1EmbeddingsResponse
    • V1AudioSpeechRequest
    • PostV1ImagesGenerationsRequest
    • POST /v1/images/generations · wan2.7-image-pro 成功响应
    • POSTV1ImagesGenerations_DallE2
    • POSTV1ImagesGenerations_GptImage1
    • POSTV1ImagesGenerations_GptImage2
    • POSTV1ImagesGenerations_GptImage25
    • POSTV1ImagesGenerations_GptImage2C
    • POSTV1ImagesGenerations_QwenImageMax
    • POSTV1ImagesGenerations_ZImageTurbo
    • POSTV1ImagesGenerations_QwenImage20260303
    • POSTV1ImagesGenerations_QwenImage3
    • POSTV1ImagesGenerations_QwenImage3Pro
    • POSTV1ImagesEdits_Grok3Image
    • POSTV1ImagesEdits_GptImage1
    • POSTV1ImagesEdits_GptImage2
    • POSTV1ImagesEdits_GptImage25
    • POSTV1ImagesEdits_QwenImageEdit2509
    • POSTV1ImagesGenerations_DallE3
    • POSTV1ImagesGenerations_Grok2Image
    • POSTV1ImagesGenerations_Grok3Image
    • Message
    • ContentPart
    • Tool
    • StreamOptions
    • ResponseFormat
    • WebSearchOptions
    • wan2.7-image-pro 文生图请求
    • imageData
    • PostV1ImagesEditsResponse
    • PostV1CompletionsRequest
    • PostV1CompletionsResponse
    • PostV1ResponsesRequest
    • PostV1ResponsesResponse
    • PostV1ResponsesCompactRequest
    • PostV1RerankRequest
    • PostV1RerankResponse
    • NewApiError
  1. Responses

创建函数调用

POST
/v1/responses
https://platform.openai.com/docs/api-reference/responses/create
部分OpenAI模型仅支持Response格式,例如o3-pro,codex-mini-latest

网站中的模型与调用示例#

创建模型响应#

https://platform.openai.com/docs/api-reference/responses/create
部分OpenAI模型仅支持Response格式,例如o3-pro,codex-mini-latest

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "input": {
      "items": {
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "model": {
      "description": "要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The ID of the model to use. For more information about which models can be used with the Chat API, see the model endpoint compatibility table."
        }
      }
    }
  },
  "required": []
}

请求示例 · 创建模型响应#

{
  "include": [
    "output[*].logprobs"
  ],
  "input": [
    {
      "content": "1+1等于几?",
      "role": "user"
    }
  ],
  "max_tokens": 100,
  "model": "gpt-4o-mini",
  "text": {
    "format": {
      "type": "text"
    }
  }
}

请求示例 · 创建函数调用#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建函数调用 Copy#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建模型响应 gpt-5启用思考#

{
  "input": [
    {
      "content": [
        {
          "text": "1+2+3+4+5....9985",
          "type": "input_text"
        }
      ],
      "role": "user"
    }
  ],
  "model": "gpt-5-2025-08-07",
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  },
  "store": true,
  "stream": true,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "tools": []
}

请求示例 · 创建模型响应 (控制思考长度)#

{
  "input": [
    {
      "content": "Write a one-sentence bedtime story about a unicorn.",
      "role": "user"
    }
  ],
  "model": "gpt-5.1",
  "reasoning": {
    "effort": "high"
  }
}

请求示例 · 创建模型响应(流式返回)#

{
  "input": [
    {
      "content": "你好啊",
      "role": "user"
    }
  ],
  "model": "gpt-4.1",
  "stream": true
}

请求示例 · 创建网络搜索#

{
  "input": "what was a positive news story from today?",
  "model": "gpt-4.1-2025-04-14",
  "tools": [
    {
      "type": "web_search_preview"
    }
  ]
}

响应示例 · OK#

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "\n\nHello there, how may I assist you today?",
        "role": "assistant"
      }
    }
  ],
  "created": 1677652288,
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 12,
    "prompt_tokens": 9,
    "total_tokens": 21
  }
}

创建模型响应#

https://platform.openai.com/docs/api-reference/responses/create
部分OpenAI模型仅支持Response格式,例如o3-pro,codex-mini-latest

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "input": {
      "items": {
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "model": {
      "description": "要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The ID of the model to use. For more information about which models can be used with the Chat API, see the model endpoint compatibility table."
        }
      }
    }
  },
  "required": []
}

请求示例 · 创建模型响应#

{
  "include": [
    "output[*].logprobs"
  ],
  "input": [
    {
      "content": "1+1等于几?",
      "role": "user"
    }
  ],
  "max_tokens": 100,
  "model": "gpt-4o-mini",
  "text": {
    "format": {
      "type": "text"
    }
  }
}

请求示例 · 创建函数调用#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建函数调用 Copy#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建模型响应 gpt-5启用思考#

{
  "input": [
    {
      "content": [
        {
          "text": "1+2+3+4+5....9985",
          "type": "input_text"
        }
      ],
      "role": "user"
    }
  ],
  "model": "gpt-5-2025-08-07",
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  },
  "store": true,
  "stream": true,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "tools": []
}

请求示例 · 创建模型响应 (控制思考长度)#

{
  "input": [
    {
      "content": "Write a one-sentence bedtime story about a unicorn.",
      "role": "user"
    }
  ],
  "model": "gpt-5.1",
  "reasoning": {
    "effort": "high"
  }
}

请求示例 · 创建模型响应(流式返回)#

{
  "input": [
    {
      "content": "你好啊",
      "role": "user"
    }
  ],
  "model": "gpt-4.1",
  "stream": true
}

请求示例 · 创建网络搜索#

{
  "input": "what was a positive news story from today?",
  "model": "gpt-4.1-2025-04-14",
  "tools": [
    {
      "type": "web_search_preview"
    }
  ]
}

响应示例 · OK#

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "\n\nHello there, how may I assist you today?",
        "role": "assistant"
      }
    }
  ],
  "created": 1677652288,
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 12,
    "prompt_tokens": 9,
    "total_tokens": 21
  }
}

创建模型响应#

https://platform.openai.com/docs/api-reference/responses/create
部分OpenAI模型仅支持Response格式,例如o3-pro,codex-mini-latest

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "input": {
      "items": {
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "model": {
      "description": "要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The ID of the model to use. For more information about which models can be used with the Chat API, see the model endpoint compatibility table."
        }
      }
    }
  },
  "required": []
}

请求示例 · 创建模型响应#

{
  "include": [
    "output[*].logprobs"
  ],
  "input": [
    {
      "content": "1+1等于几?",
      "role": "user"
    }
  ],
  "max_tokens": 100,
  "model": "gpt-4o-mini",
  "text": {
    "format": {
      "type": "text"
    }
  }
}

请求示例 · 创建函数调用#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建函数调用 Copy#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建模型响应 gpt-5启用思考#

{
  "input": [
    {
      "content": [
        {
          "text": "1+2+3+4+5....9985",
          "type": "input_text"
        }
      ],
      "role": "user"
    }
  ],
  "model": "gpt-5-2025-08-07",
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  },
  "store": true,
  "stream": true,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "tools": []
}

请求示例 · 创建模型响应 (控制思考长度)#

{
  "input": [
    {
      "content": "Write a one-sentence bedtime story about a unicorn.",
      "role": "user"
    }
  ],
  "model": "gpt-5.1",
  "reasoning": {
    "effort": "high"
  }
}

请求示例 · 创建模型响应(流式返回)#

{
  "input": [
    {
      "content": "你好啊",
      "role": "user"
    }
  ],
  "model": "gpt-4.1",
  "stream": true
}

请求示例 · 创建网络搜索#

{
  "input": "what was a positive news story from today?",
  "model": "gpt-4.1-2025-04-14",
  "tools": [
    {
      "type": "web_search_preview"
    }
  ]
}

响应示例 · OK#

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "\n\nHello there, how may I assist you today?",
        "role": "assistant"
      }
    }
  ],
  "created": 1677652288,
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 12,
    "prompt_tokens": 9,
    "total_tokens": 21
  }
}

创建模型响应#

https://platform.openai.com/docs/api-reference/responses/create
部分OpenAI模型仅支持Response格式,例如o3-pro,codex-mini-latest

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "input": {
      "items": {
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "model": {
      "description": "要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The ID of the model to use. For more information about which models can be used with the Chat API, see the model endpoint compatibility table."
        }
      }
    }
  },
  "required": []
}

请求示例 · 创建模型响应#

{
  "include": [
    "output[*].logprobs"
  ],
  "input": [
    {
      "content": "1+1等于几?",
      "role": "user"
    }
  ],
  "max_tokens": 100,
  "model": "gpt-4o-mini",
  "text": {
    "format": {
      "type": "text"
    }
  }
}

请求示例 · 创建函数调用#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建函数调用 Copy#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建模型响应 gpt-5启用思考#

{
  "input": [
    {
      "content": [
        {
          "text": "1+2+3+4+5....9985",
          "type": "input_text"
        }
      ],
      "role": "user"
    }
  ],
  "model": "gpt-5-2025-08-07",
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  },
  "store": true,
  "stream": true,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "tools": []
}

请求示例 · 创建模型响应 (控制思考长度)#

{
  "input": [
    {
      "content": "Write a one-sentence bedtime story about a unicorn.",
      "role": "user"
    }
  ],
  "model": "gpt-5.1",
  "reasoning": {
    "effort": "high"
  }
}

请求示例 · 创建模型响应(流式返回)#

{
  "input": [
    {
      "content": "你好啊",
      "role": "user"
    }
  ],
  "model": "gpt-4.1",
  "stream": true
}

请求示例 · 创建网络搜索#

{
  "input": "what was a positive news story from today?",
  "model": "gpt-4.1-2025-04-14",
  "tools": [
    {
      "type": "web_search_preview"
    }
  ]
}

响应示例 · OK#

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "\n\nHello there, how may I assist you today?",
        "role": "assistant"
      }
    }
  ],
  "created": 1677652288,
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 12,
    "prompt_tokens": 9,
    "total_tokens": 21
  }
}

创建模型响应#

https://platform.openai.com/docs/api-reference/responses/create
部分OpenAI模型仅支持Response格式,例如o3-pro,codex-mini-latest

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "input": {
      "items": {
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "model": {
      "description": "要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The ID of the model to use. For more information about which models can be used with the Chat API, see the model endpoint compatibility table."
        }
      }
    }
  },
  "required": []
}

请求示例 · 创建模型响应#

{
  "include": [
    "output[*].logprobs"
  ],
  "input": [
    {
      "content": "1+1等于几?",
      "role": "user"
    }
  ],
  "max_tokens": 100,
  "model": "gpt-4o-mini",
  "text": {
    "format": {
      "type": "text"
    }
  }
}

请求示例 · 创建函数调用#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建函数调用 Copy#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建模型响应 gpt-5启用思考#

{
  "input": [
    {
      "content": [
        {
          "text": "1+2+3+4+5....9985",
          "type": "input_text"
        }
      ],
      "role": "user"
    }
  ],
  "model": "gpt-5-2025-08-07",
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  },
  "store": true,
  "stream": true,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "tools": []
}

请求示例 · 创建模型响应 (控制思考长度)#

{
  "input": [
    {
      "content": "Write a one-sentence bedtime story about a unicorn.",
      "role": "user"
    }
  ],
  "model": "gpt-5.1",
  "reasoning": {
    "effort": "high"
  }
}

请求示例 · 创建模型响应(流式返回)#

{
  "input": [
    {
      "content": "你好啊",
      "role": "user"
    }
  ],
  "model": "gpt-4.1",
  "stream": true
}

请求示例 · 创建网络搜索#

{
  "input": "what was a positive news story from today?",
  "model": "gpt-4.1-2025-04-14",
  "tools": [
    {
      "type": "web_search_preview"
    }
  ]
}

响应示例 · OK#

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "\n\nHello there, how may I assist you today?",
        "role": "assistant"
      }
    }
  ],
  "created": 1677652288,
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 12,
    "prompt_tokens": 9,
    "total_tokens": 21
  }
}

创建模型响应#

https://platform.openai.com/docs/api-reference/responses/create
部分OpenAI模型仅支持Response格式,例如o3-pro,codex-mini-latest

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "input": {
      "items": {
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "model": {
      "description": "要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The ID of the model to use. For more information about which models can be used with the Chat API, see the model endpoint compatibility table."
        }
      }
    }
  },
  "required": []
}

请求示例 · 创建模型响应#

{
  "include": [
    "output[*].logprobs"
  ],
  "input": [
    {
      "content": "1+1等于几?",
      "role": "user"
    }
  ],
  "max_tokens": 100,
  "model": "gpt-4o-mini",
  "text": {
    "format": {
      "type": "text"
    }
  }
}

请求示例 · 创建函数调用#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建函数调用 Copy#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建模型响应 gpt-5启用思考#

{
  "input": [
    {
      "content": [
        {
          "text": "1+2+3+4+5....9985",
          "type": "input_text"
        }
      ],
      "role": "user"
    }
  ],
  "model": "gpt-5-2025-08-07",
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  },
  "store": true,
  "stream": true,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "tools": []
}

请求示例 · 创建模型响应 (控制思考长度)#

{
  "input": [
    {
      "content": "Write a one-sentence bedtime story about a unicorn.",
      "role": "user"
    }
  ],
  "model": "gpt-5.1",
  "reasoning": {
    "effort": "high"
  }
}

请求示例 · 创建模型响应(流式返回)#

{
  "input": [
    {
      "content": "你好啊",
      "role": "user"
    }
  ],
  "model": "gpt-4.1",
  "stream": true
}

请求示例 · 创建网络搜索#

{
  "input": "what was a positive news story from today?",
  "model": "gpt-4.1-2025-04-14",
  "tools": [
    {
      "type": "web_search_preview"
    }
  ]
}

响应示例 · OK#

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "\n\nHello there, how may I assist you today?",
        "role": "assistant"
      }
    }
  ],
  "created": 1677652288,
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 12,
    "prompt_tokens": 9,
    "total_tokens": 21
  }
}

创建模型响应#

https://platform.openai.com/docs/api-reference/responses/create
部分OpenAI模型仅支持Response格式,例如o3-pro,codex-mini-latest

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "input": {
      "items": {
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "model": {
      "description": "要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The ID of the model to use. For more information about which models can be used with the Chat API, see the model endpoint compatibility table."
        }
      }
    }
  },
  "required": []
}

请求示例 · 创建模型响应#

{
  "include": [
    "output[*].logprobs"
  ],
  "input": [
    {
      "content": "1+1等于几?",
      "role": "user"
    }
  ],
  "max_tokens": 100,
  "model": "gpt-4o-mini",
  "text": {
    "format": {
      "type": "text"
    }
  }
}

请求示例 · 创建函数调用#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建函数调用 Copy#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建模型响应 gpt-5启用思考#

{
  "input": [
    {
      "content": [
        {
          "text": "1+2+3+4+5....9985",
          "type": "input_text"
        }
      ],
      "role": "user"
    }
  ],
  "model": "gpt-5-2025-08-07",
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  },
  "store": true,
  "stream": true,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "tools": []
}

请求示例 · 创建模型响应 (控制思考长度)#

{
  "input": [
    {
      "content": "Write a one-sentence bedtime story about a unicorn.",
      "role": "user"
    }
  ],
  "model": "gpt-5.1",
  "reasoning": {
    "effort": "high"
  }
}

请求示例 · 创建模型响应(流式返回)#

{
  "input": [
    {
      "content": "你好啊",
      "role": "user"
    }
  ],
  "model": "gpt-4.1",
  "stream": true
}

请求示例 · 创建网络搜索#

{
  "input": "what was a positive news story from today?",
  "model": "gpt-4.1-2025-04-14",
  "tools": [
    {
      "type": "web_search_preview"
    }
  ]
}

响应示例 · OK#

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "\n\nHello there, how may I assist you today?",
        "role": "assistant"
      }
    }
  ],
  "created": 1677652288,
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 12,
    "prompt_tokens": 9,
    "total_tokens": 21
  }
}

创建模型响应#

https://platform.openai.com/docs/api-reference/responses/create
部分OpenAI模型仅支持Response格式,例如o3-pro,codex-mini-latest

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "input": {
      "items": {
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "model": {
      "description": "要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The ID of the model to use. For more information about which models can be used with the Chat API, see the model endpoint compatibility table."
        }
      }
    }
  },
  "required": []
}

请求示例 · 创建模型响应#

{
  "include": [
    "output[*].logprobs"
  ],
  "input": [
    {
      "content": "1+1等于几?",
      "role": "user"
    }
  ],
  "max_tokens": 100,
  "model": "gpt-4o-mini",
  "text": {
    "format": {
      "type": "text"
    }
  }
}

请求示例 · 创建函数调用#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建函数调用 Copy#

{
  "input": [
    {
      "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。",
      "role": "user"
    }
  ],
  "metadata": {
    "model_id": "32"
  },
  "model": "gpt-4.1",
  "tool_choice": "auto",
  "tools": [
    {
      "description": "生成指定范围内的随机数,支持批量生成",
      "name": "random_generator",
      "parameters": {
        "properties": {
          "count": {
            "description": "生成数量(默认1,最大10)",
            "type": "integer"
          },
          "max": {
            "description": "最大值(默认100)",
            "type": "integer"
          },
          "min": {
            "description": "最小值(默认1)",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
      "name": "system_info",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "执行基本数学运算,支持加减乘除和幂运算",
      "name": "math_calculator",
      "parameters": {
        "properties": {
          "a": {
            "description": "第一个数字",
            "type": "number"
          },
          "b": {
            "description": "第二个数字",
            "type": "number"
          },
          "operation": {
            "description": "运算类型: add, subtract, multiply, divide, power",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "a",
          "b"
        ],
        "type": "object"
      },
      "type": "function"
    },
    {
      "description": "获取当前系统时间",
      "name": "current_time",
      "parameters": {
        "properties": {},
        "type": "object"
      },
      "type": "function"
    }
  ]
}

请求示例 · 创建模型响应 gpt-5启用思考#

{
  "input": [
    {
      "content": [
        {
          "text": "1+2+3+4+5....9985",
          "type": "input_text"
        }
      ],
      "role": "user"
    }
  ],
  "model": "gpt-5-2025-08-07",
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  },
  "store": true,
  "stream": true,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "tools": []
}

请求示例 · 创建模型响应 (控制思考长度)#

{
  "input": [
    {
      "content": "Write a one-sentence bedtime story about a unicorn.",
      "role": "user"
    }
  ],
  "model": "gpt-5.1",
  "reasoning": {
    "effort": "high"
  }
}

请求示例 · 创建模型响应(流式返回)#

{
  "input": [
    {
      "content": "你好啊",
      "role": "user"
    }
  ],
  "model": "gpt-4.1",
  "stream": true
}

请求示例 · 创建网络搜索#

{
  "input": "what was a positive news story from today?",
  "model": "gpt-4.1-2025-04-14",
  "tools": [
    {
      "type": "web_search_preview"
    }
  ]
}

响应示例 · OK#

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "\n\nHello there, how may I assist you today?",
        "role": "assistant"
      }
    }
  ],
  "created": 1677652288,
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 12,
    "prompt_tokens": 9,
    "total_tokens": 21
  }
}

请求参数

Authorization
Bearer Token
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
or
Header 参数

Body 参数application/json

示例
{
    "input": [
        {
            "role": "user",
            "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。"
        }
    ],
    "metadata": {
        "model_id": "32"
    },
    "model": "gpt-4.1",
    "tool_choice": "auto",
    "tools": [
        {
            "type": "function",
            "name": "random_generator",
            "description": "生成指定范围内的随机数,支持批量生成",
            "parameters": {
                "type": "object",
                "properties": {
                    "min": {
                        "description": "最小值(默认1)",
                        "type": "integer",
                        "x-i18n": {
                            "en-US": {
                                "description": "Minimum value (default 1)"
                            }
                        }
                    },
                    "max": {
                        "description": "最大值(默认100)",
                        "type": "integer",
                        "x-i18n": {
                            "en-US": {
                                "description": "Maximum value (default 100)"
                            }
                        }
                    },
                    "count": {
                        "description": "生成数量(默认1,最大10)",
                        "type": "integer",
                        "x-i18n": {
                            "en-US": {
                                "description": "Number of generations (default 1, maximum 10)"
                            }
                        }
                    }
                }
            },
            "x-i18n": {
                "en-US": {
                    "description": "Generate random numbers within a specified range, supporting batch generation"
                }
            }
        },
        {
            "type": "function",
            "name": "system_info",
            "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
            "parameters": {
                "type": "object",
                "properties": {}
            },
            "x-i18n": {
                "en-US": {
                    "description": "Obtain basic information about the current system, including operating system, Java version, memory usage, etc."
                }
            }
        },
        {
            "type": "function",
            "name": "math_calculator",
            "description": "执行基本数学运算,支持加减乘除和幂运算",
            "parameters": {
                "type": "object",
                "properties": {
                    "a": {
                        "description": "第一个数字",
                        "type": "number",
                        "x-i18n": {
                            "en-US": {
                                "description": "first number"
                            }
                        }
                    },
                    "b": {
                        "description": "第二个数字",
                        "type": "number",
                        "x-i18n": {
                            "en-US": {
                                "description": "second number"
                            }
                        }
                    },
                    "operation": {
                        "description": "运算类型: add, subtract, multiply, divide, power",
                        "type": "string",
                        "x-i18n": {
                            "en-US": {
                                "description": "Operation types: add, subtract, multiply, divide, power"
                            }
                        }
                    }
                },
                "required": [
                    "operation",
                    "a",
                    "b"
                ]
            },
            "x-i18n": {
                "en-US": {
                    "description": "Perform basic mathematical operations, supporting addition, subtraction, multiplication, division and exponentiation operations"
                }
            }
        },
        {
            "type": "function",
            "name": "current_time",
            "description": "获取当前系统时间",
            "parameters": {
                "type": "object",
                "properties": {}
            },
            "x-i18n": {
                "en-US": {
                    "description": "Get the current system time"
                }
            }
        }
    ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location '/v1/responses' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "input": [
        {
            "role": "user",
            "content": "请同时帮我做以下几件事:\n1. 获取当前系统时间\n2. 查看系统信息(操作系统、内存等)\n3. 帮我计算 123.5 + 456.7 的结果\n4. 生成3个1-100之间的随机数\n\n这是一个并行工具调用测试,请同时执行这些任务。"
        }
    ],
    "metadata": {
        "model_id": "32"
    },
    "model": "gpt-4.1",
    "tool_choice": "auto",
    "tools": [
        {
            "type": "function",
            "name": "random_generator",
            "description": "生成指定范围内的随机数,支持批量生成",
            "parameters": {
                "type": "object",
                "properties": {
                    "min": {
                        "description": "最小值(默认1)",
                        "type": "integer",
                        "x-i18n": {
                            "en-US": {
                                "description": "Minimum value (default 1)"
                            }
                        }
                    },
                    "max": {
                        "description": "最大值(默认100)",
                        "type": "integer",
                        "x-i18n": {
                            "en-US": {
                                "description": "Maximum value (default 100)"
                            }
                        }
                    },
                    "count": {
                        "description": "生成数量(默认1,最大10)",
                        "type": "integer",
                        "x-i18n": {
                            "en-US": {
                                "description": "Number of generations (default 1, maximum 10)"
                            }
                        }
                    }
                }
            },
            "x-i18n": {
                "en-US": {
                    "description": "Generate random numbers within a specified range, supporting batch generation"
                }
            }
        },
        {
            "type": "function",
            "name": "system_info",
            "description": "获取当前系统的基本信息,包括操作系统、Java版本、内存使用情况等",
            "parameters": {
                "type": "object",
                "properties": {}
            },
            "x-i18n": {
                "en-US": {
                    "description": "Obtain basic information about the current system, including operating system, Java version, memory usage, etc."
                }
            }
        },
        {
            "type": "function",
            "name": "math_calculator",
            "description": "执行基本数学运算,支持加减乘除和幂运算",
            "parameters": {
                "type": "object",
                "properties": {
                    "a": {
                        "description": "第一个数字",
                        "type": "number",
                        "x-i18n": {
                            "en-US": {
                                "description": "first number"
                            }
                        }
                    },
                    "b": {
                        "description": "第二个数字",
                        "type": "number",
                        "x-i18n": {
                            "en-US": {
                                "description": "second number"
                            }
                        }
                    },
                    "operation": {
                        "description": "运算类型: add, subtract, multiply, divide, power",
                        "type": "string",
                        "x-i18n": {
                            "en-US": {
                                "description": "Operation types: add, subtract, multiply, divide, power"
                            }
                        }
                    }
                },
                "required": [
                    "operation",
                    "a",
                    "b"
                ]
            },
            "x-i18n": {
                "en-US": {
                    "description": "Perform basic mathematical operations, supporting addition, subtraction, multiplication, division and exponentiation operations"
                }
            }
        },
        {
            "type": "function",
            "name": "current_time",
            "description": "获取当前系统时间",
            "parameters": {
                "type": "object",
                "properties": {}
            },
            "x-i18n": {
                "en-US": {
                    "description": "Get the current system time"
                }
            }
        }
    ]
}'

返回响应

🟢200OK
application/json
Bodyapplication/json

示例
{
    "id": "resp_68ac1558e9488190bcc2cbb94c7d7a140b8064b15a091a77",
    "object": "response",
    "created": 1756108120,
    "created_at": 1756108120,
    "status": "completed",
    "background": false,
    "model": "gpt-4.1-data",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "Function call completed"
            },
            "finish_reason": "stop"
        }
    ],
    "output": [
        {
            "id": "fc_68ac15594be88190a58217f75a6a54cc0b8064b15a091a77",
            "type": "function_call",
            "status": "completed",
            "arguments": "{\"sign\":\"Aquarius\"}",
            "call_id": "call_6kbB2GTk62PPUNdGuBJPx9KQ",
            "name": "get_horoscope"
        }
    ],
    "parallel_tool_calls": true,
    "service_tier": "default",
    "store": true,
    "temperature": 1,
    "text": {
        "format": {
            "type": "text"
        }
    },
    "tool_choice": "auto",
    "tools": [
        {
            "type": "function",
            "description": "Get today's horoscope for an astrological sign.",
            "name": "get_horoscope",
            "parameters": {
                "properties": {
                    "sign": {
                        "description": "An astrological sign like Taurus or Aquarius",
                        "type": "string"
                    }
                },
                "required": [
                    "sign"
                ],
                "type": "object"
            },
            "strict": true
        }
    ],
    "top_p": 1,
    "truncation": "disabled",
    "usage": {
        "prompt_tokens": 62,
        "completion_tokens": 18,
        "total_tokens": 80,
        "input_tokens": 62,
        "input_tokens_details": {
            "cached_tokens": 0
        },
        "output_tokens": 18,
        "output_tokens_details": {
            "reasoning_tokens": 0
        }
    },
    "metadata": {}
}
🟠400请求有误
🟠401没有权限
修改于 2026-10-24 18:33:00
上一页
创建完成
下一页
gpt 上下文压缩
Built with