wenwen
  1. chat
wenwen
  • (必读)使用说明
  • Base URL地址
  • 列出模型
    • Models(列出模型)
      GET
  • OpenAI 接口格式
    • chat
      • 聊天
        POST
      • 流式返回
        POST
      • 结构化输出
        POST
      • 工具调用(function call)
        POST
      • MCP调用(stdio)
        POST
      • 分析图片
        POST
      • 修改图片
        POST
      • 生成图片
        POST
      • 语音回复
        POST
      • 生成视频
        POST
    • responses
      • Responses API与Chat API对比
      • 创建对话
      • 流式返回
    • images
      • 生成图片
      • 编辑图片
    • 向量处理
      • 文本向量化
    • 语音识别
      • 语音识别
  • Anthropic 接口格式
    • messages
      • 聊天
      • 流式返回
      • 聊天(prompt cache)
      • 聊天(深度思考)
      • 工具调用(function call)
      • 工具调用(MCP)-待支持
      • 分析图片
  • Gemini 接口格式
    • generateContent
      • 聊天
      • 生成图片
      • 编辑图片
  • Midjourney 接口格式
    • 文生图(Imagine)
      POST
    • 图片融合(Blend)
      POST
    • 任务查询接口
      GET
    • 任务批量查询接口
      POST
    • 获取种子(Seed)
      GET
    • 按钮点击(Action)-选择图片
      POST
  1. chat

生成视频

POST
/v1/chat/completions
根据提示词生成视频。
需要模型支持生成视频能力,比如:sora_video2

请求参数

Header 参数

Body 参数application/json

示例
{
   "model": "sora_video2",
   "stream": false,
   "messages": [
      {
         "role": "user",
         "content": "画只猫在草地上跳舞"
      }
   ]
}

请求示例代码

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/chat/completions' \
--header 'Authorization: Bearer {YOUR_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
   "model": "sora_video2",
   "stream": false,
   "messages": [
      {
         "role": "user",
         "content": "画只猫在草地上跳舞"
      }
   ]
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "id": "foaicmpl-d5777ca7-a290-449d-8339-70ad67225a83",
    "choices": [
        {
            "finish_reason": "stop",
            "index": 0,
            "logprobs": null,
            "message": {
                "content": "[下载视频](https://midjourney-plus.oss-us-west-1.aliyuncs.com/sora/b0537767-1c19-4496-9271-36f48ca013e8.mp4)\n\n",
                "refusal": null,
                "role": "assistant",
                "annotations": null,
                "audio": null,
                "function_call": null,
                "tool_calls": null
            }
        }
    ],
    "created": 1759315549,
    "model": "sora_video2",
    "object": "chat.completion",
    "service_tier": null,
    "system_fingerprint": null,
    "usage": {
        "completion_tokens": 48,
        "prompt_tokens": 13,
        "total_tokens": 61,
        "completion_tokens_details": {
            "accepted_prediction_tokens": null,
            "audio_tokens": 0,
            "reasoning_tokens": 0,
            "rejected_prediction_tokens": null,
            "text_tokens": 0
        },
        "prompt_tokens_details": {
            "audio_tokens": 0,
            "cached_tokens": 0,
            "text_tokens": 0,
            "image_tokens": 0
        },
        "input_tokens": 0,
        "output_tokens": 0,
        "input_tokens_details": null,
        "output_tokens_details": null
    }
}
修改于 2025-10-01 11:06:31
上一页
语音回复
下一页
Responses API与Chat API对比
Built with