1. chatgpt对话
慧言API
  • chatgpt对话
    • gpt-6.1
      POST
    • gpt-6-astra
      POST
    • deepseek-v4.1-flash
      POST
    • response格式-原生联网
      POST
    • 格式化返回
      POST
    • embedding
      POST
    • gpt-4o-mini
      POST
    • gpt-4o
      POST
    • o1-mini
      POST
    • o3
      POST
    • deepseek-r1
      POST
  • 绘图识图
    • gpt-image-2.5-sunburst(图生图)
      POST
    • gpt-image-2.5-sunburst(文生图)
      POST
    • gpt-image-2.6-sunburst(文生图)
      POST
    • gpt-image-2.5(图生图-本地文件)
      POST
    • gpt-image-2(对话格式)
      POST
    • gemini香蕉-官方模式
      POST
    • gpt-4o识图
      POST
    • 绘图dalle3
      POST
  • claude-gemini-grok
    • claude-opus-4-1-20250805
      POST
    • claude-sonnet-4-20250514
      POST
    • claude-sonnet-4-6
      POST
    • claude-3-5-sonnet-20241022
      POST
    • claude-3-opus-20240229
      POST
    • claude-sonnet-4-20250514-thinking
      POST
    • gemini-2.5-pro
      POST
  • 逆向模型
    • 识图gpt-4-all
    • 绘图gpt-4-all
    • 逆向流式o1-mini-all
  • 绘图midjourney-proxy-plus
    • 任务提交
      • 文生图
      • 提交Describe任务
      • 提交Modal
      • 执行动作
      • 上传文件到discord
      • 提交Shorten任务
      • 提交Blend任务
    • 任务查询
      • 根据ID列表查询任务
      • 分页查询任务
      • 取消任务
      • 指定ID获取任务
      • 查询任务队列
      • 根据ID列表查询任务-字段displays
      • 获取任务图片的seed(需设置mj或niji的私信ID)
      • 查询所有任务
    • InsightFace任务提交
      • 提交swap_face任务
  • 音乐&视频
    • suno音乐
    • 查询音乐
    • grok-imagine-video
    • 视频查询
  1. chatgpt对话

response格式-原生联网

POST
https://api.huiyan-ai.cn/v1/responses

请求参数

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

Body 参数application/json必填

示例
{
  "model": "gpt-4o",
  "input": "今天北京天气怎样",
  "stream": true,
  "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 'https://api.huiyan-ai.cn/v1/responses' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
  "model": "gpt-4o",
  "input": "今天北京天气怎样",
  "stream": true,
  "tools": [
    {
      "type": "web_search_preview"
    }
  ]
}'

返回响应

🟢200成功
application/json
Bodyapplication/json

示例
{
  "id": "resp_0d4eea4d749c75d4006ad5e65c8c3c8193a41cad53cc93927b",
  "object": "response",
  "created_at": 1792403036,
  "status": "completed",
  "background": false,
  "completed_at": 1792403041,
  "content_filters": null,
  "error": null,
  "frequency_penalty": 0.0,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "max_tool_calls": null,
  "model": "gpt-4o",
  "moderation": null,
  "output": [
    {
      "id": "ws_0d4eea4d749c75d4006ad5e65e0c0481938cd1c81cadd50f9b",
      "type": "web_search_call",
      "status": "completed",
      "action": {
        "type": "search",
        "queries": [
          "北京天气 2026年10月19日"
        ],
        "query": "北京天气 2026年10月19日"
      }
    },
    {
      "id": "msg_0d4eea4d749c75d4006ad5e66066ac8193b68ee97c04231412",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "annotations": [
            {
              "type": "url_citation",
              "end_index": 172,
              "start_index": 113,
              "title": "北京2026年10月19日天气及温度,生活指数,空气PM2.5质量情况",
              "url": "https://www.5670.cn/tianqi/lishitianqi/32_745853.html"
            }
          ],
          "logprobs": [],
          "text": "今天,北京以 **晴天** 为主。白天最高气温为 **19℃**,夜间最低气温为 **5℃**,风速较小,预计有东风4-5级。空气质量优良,PM2.5浓度为 **10**,适宜户外活动,但昼夜温差较大,建议穿保暖衣物以防感冒。[来源](https://www.5670.cn/tianqi/lishitianqi/32_745853.html)"
        }
      ],
      "role": "assistant"
    }
  ],
  "parallel_tool_calls": true,
  "presence_penalty": 0.0,
  "previous_response_id": null,
  "prompt_cache_key": null,
  "prompt_cache_retention": "in_memory",
  "reasoning": {
    "context": null,
    "effort": null,
    "summary": null
  },
  "safety_identifier": null,
  "service_tier": "default",
  "store": true,
  "temperature": 1.0,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  },
  "tool_choice": "auto",
  "tool_usage": {
    "image_gen": {
      "input_tokens": 0,
      "input_tokens_details": {
        "image_tokens": 0,
        "text_tokens": 0
      },
      "output_tokens": 0,
      "output_tokens_details": {
        "image_tokens": 0,
        "text_tokens": 0
      },
      "total_tokens": 0
    },
    "web_search": {
      "num_requests": 1
    }
  },
  "tools": [
    {
      "type": "web_search_preview",
      "search_content_types": [
        "text"
      ],
      "search_context_size": "medium",
      "user_location": {
        "type": "approximate",
        "city": null,
        "country": "US",
        "region": null,
        "timezone": null
      }
    }
  ],
  "top_logprobs": 0,
  "top_p": 1.0,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 6157,
    "input_tokens_details": {
      "cache_write_tokens": 0,
      "cached_tokens": 0
    },
    "output_tokens": 136,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 6293
  },
  "user": null,
  "metadata": {}
}
修改于 2026-10-19 09:35:41
上一页
deepseek-v4.1-flash
下一页
格式化返回
Built with