wenwen
  1. 聊天对话-OpenAI格式(/responses)
wenwen
  • 聊天对话-OpenAI格式(/chat/completions)
    • 聊天
      POST
    • 流式返回
      POST
    • 结构化输出
      POST
    • 工具调用(function call)
      POST
    • 分析图片
      POST
    • 修改图片
      POST
    • 生成图片
      POST
    • 语音回复
      POST
  • 聊天对话-OpenAI格式(/responses)
    • Responses API与Chat API对比
    • 创建对话
      POST
    • 流式返回
      POST
    • 调用联网
      POST
  • 聊天对话-Anthropic格式(/messages)
    • 聊天
      POST
    • 流式返回
      POST
    • 分析图片
      POST
    • 工具使用
      POST
  • 绘图模型-OpenAI格式(/images)
    • 文生图(dall-e-3)
      POST
    • 文生图(gpt-image-1)
      POST
    • 图像编辑(dall-e-2)
      POST
    • 图像编辑(gpt-image-1)
      POST
  • 绘图模型-Midjourney(/mj)
    • 文生图(Imagine)
      POST
    • 图片融合(Blend)
      POST
    • 任务查询接口
      GET
    • 任务批量查询接口
      POST
    • 获取种子(Seed)
      GET
    • 按钮点击(Action)-选择图片
      POST
  • 向量化(/embeddings)
    • 文本向量化
  • 语音识别
    • 语音识别(whisper-1)
  1. 聊天对话-OpenAI格式(/responses)

调用联网

POST
/v1/responses
使用function call
不是所有对话模型都可使用此接口, 目前可以使用的是openai模型
模型列表请参考问问平台:https://api.wenwen-ai.com/pricing
BASE_URL: https://api.wenwen-ai.com/v1

请求参数

Header 参数

Body 参数application/json

示例
{
  "model": "gpt-4o",
  "input": [
    {
      "role": "user",
      "content": "hi"
    }
  ],
  "tools": [
    {
      "type": "web_search_preview"
    }
  ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.wenwen-ai.com/v1/responses' \
--header 'Authorization: Bearer {YOUR_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "gpt-4o",
  "input": [
    {
      "role": "user",
      "content": "hi"
    }
  ],
  "tools": [
    {
      "type": "web_search_preview"
    }
  ]
}'

返回响应

🟢200成功
application/json
Body

示例
{
  "id": "resp_68760e92a79c81a28acd1e218f1fd40d0679399e11c8f799",
  "object": "response",
  "created_at": 1752567442,
  "status": "completed",
  "background": false,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "max_tool_calls": 225,
  "model": "o3-deep-research-2025-06-26",
  "output": [
    {
      "id": "rs_68760e93029081a29c2ef2a702b428fb0679399e11c8f799",
      "type": "reasoning",
      "summary": []
    },
    {
      "id": "ws_68760ea0d27081a2871459aa9ebbed950679399e11c8f799",
      "type": "web_search_call",
      "status": "completed",
      "action": {
        "type": "search",
        "query": "Hello how to greet user in chat GPT guidelines"
      }
    },
    {
      "id": "rs_68760ea19c0481a2a1f4e2b02bfc8f030679399e11c8f799",
      "type": "reasoning",
      "summary": []
    },
    {
      "id": "msg_68760ea3cde481a29e28ac61b5a7f71b0679399e11c8f799",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "annotations": [],
          "logprobs": [],
          "text": "Hello there! 👋 How can I help you today? If there's anything you'd like to discuss or any question you have, feel free to let me know. I'm here to assist!"
        }
      ],
      "role": "assistant"
    }
  ],
  "parallel_tool_calls": true,
  "previous_response_id": null,
  "reasoning": {
    "effort": "medium",
    "summary": null
  },
  "service_tier": "default",
  "store": false,
  "temperature": 1,
  "text": {
    "format": {
      "type": "text"
    }
  },
  "tool_choice": "auto",
  "tools": [
    {
      "type": "web_search_preview",
      "search_context_size": "medium",
      "user_location": null
    }
  ],
  "top_logprobs": 0,
  "top_p": 1,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 3420,
    "input_tokens_details": {
      "cached_tokens": 2686
    },
    "output_tokens": 2219,
    "output_tokens_details": {
      "reasoning_tokens": 2176
    },
    "total_tokens": 5639
  },
  "user": null,
  "metadata": {}
}
修改于 2025-08-08 09:26:26
上一页
流式返回
下一页
聊天
Built with