apistudio
  1. chat格式
apistudio
  • 默认模块
    • 获取模型列表
      • 获取模型列表
      • Gemini 格式获取
    • OpenAI格式(Chat)
      • 创建聊天对话
    • OpenAI格式(Responses)
      • 创建响应 (OpenAI Responses API)
      • 压缩对话 (OpenAI Responses API)
    • 图片生成
      • Qwen千问
        • 生成图像(qwen-image)
        • 编辑图像(qwen-image-edit)
    • 视频生成
      • Sora兼容格式
        • 创建视频
        • 获取视频任务状态
        • 获取视频内容
      • Kling格式
        • Kling 文生视频
        • 获取 Kling 文生视频任务状态
        • Kling 图生视频
        • 获取 Kling 图生视频任务状态
      • 即梦格式
        • 即梦视频生成
      • 创建视频生成任务
      • 获取视频生成任务状态
    • Claude格式(Messages)
      • Claude 聊天
    • Gemini格式
      • Gemini 图片(Nano Banana)
      • Gemini 嵌入(Embeddings)
    • OpenAI格式(Embeddings)
      • 创建文本嵌入
    • 文本补全(Completions)
      • 创建文本补全
    • OpenAI音频(Audio)
      • 音频转录
      • 音频翻译
      • 文本转语音
    • 重排序(Rerank)
      • 文档重排序
    • Moderations
      • 内容审核
    • Realtime
      • 实时 WebSocket 连接
    • 未实现
      • Fine-tunes
        • 列出微调任务 (未实现)
        • 创建微调任务 (未实现)
        • 获取微调任务详情 (未实现)
        • 取消微调任务 (未实现)
        • 获取微调任务事件 (未实现)
      • Files
        • 列出文件 (未实现)
        • 上传文件 (未实现)
        • 获取文件信息 (未实现)
        • 删除文件 (未实现)
        • 获取文件内容 (未实现)
    • 数据模型
      • ErrorResponse
      • Usage
      • Model
      • ModelsResponse
      • GeminiModelsResponse
      • Message
      • MessageContent
      • ToolCall
      • Tool
      • ResponseFormat
      • ChatCompletionRequest
      • ChatCompletionResponse
      • ChatCompletionStreamResponse
      • CompletionRequest
      • CompletionResponse
      • ResponsesRequest
      • ResponsesResponse
      • ResponsesCompactionResponse
      • ResponsesCompactionRequest
      • ResponsesStreamResponse
      • ClaudeRequest
      • ClaudeMessage
      • ClaudeResponse
      • EmbeddingRequest
      • EmbeddingResponse
      • ImageGenerationRequest
      • ImageEditRequest
      • ImageResponse
      • AudioTranscriptionRequest
      • AudioTranslationRequest
      • AudioTranscriptionResponse
      • SpeechRequest
      • RerankRequest
      • RerankResponse
      • ModerationRequest
      • ModerationResponse
      • GeminiRequest
      • GeminiResponse
      • VideoRequest
      • VideoResponse
      • VideoTaskResponse
      • VideoTaskMetadata
      • VideoTaskError
      • OpenAIVideo
      • OpenAIVideoError
      • ApiResponse
      • PageInfo
      • User
      • Channel
      • Token
      • Redemption
      • Log
  • 视频模型
    • Veo 视频生成
      • OpenAI 视频格式(推荐使用)
        • openai 创建视频,带图片
        • openai 查询任务
        • openai 下载视频
      • 视频统一格式(待统一)
        • 创建视频
        • 创建视频,带图片
        • 查询任务
        • 创建视频(参考图)
    • Sora 视频生成
      • OpenAI官方视频格式(推荐使用)
        • sora-2/sora-2-pro
          • openai 查询任务
          • openai 下载视频
          • openai 创建视频,带图片
          • openai 创建视频(带Character)
          • openai 编辑视频
      • chat格式
        • 创建视频
          POST
        • 创建视频, 带图片
          POST
        • 连续修改生成视频
          POST
    • Kling 快手可灵
      • 文生视频
      • 图生视频
      • 查询任务(免费)
    • Wan 通义千问
      • 创建视频,带图片 Wan
      • 查询视频 Wan
    • MinMax 视频生成
      • 文生视频生成任务 MinMax
      • 图生视频任务 MinMax
      • 查询视频生成任务状态 MinMax
      • 视频下载 MinMax
    • Vidu视频生成
      • Vidu 生成视频
      • Vidu 查询
  1. chat格式

创建视频

POST
/v1/chat/completions
给定一个提示,该模型将返回一个或多个预测的完成,并且还可以返回每个位置的替代标记的概率。
为提供的提示和参数创建完成
官方文档:https://platform.openai.com/docs/api-reference/chat/create

请求参数

Header 参数

Body 参数application/json

示例
{
  "model": "sora-2",
  "max_tokens": 1000,
  "messages": [
    {
      "role": "user",
      "content": "an astronaut golden retriever named Sora levitates around an intergalactic pup-themed space station with a tiny jet back that propels him. gorgeous specular lighting and comets fly through the sky, retro-future astro-themed music plays in the background. light glimmers off the dog's eyes. the dog initially propels towards the space station with the doors opening to let him in. the shot then changes. now inside the space station, many tennis balls are flying around in zero gravity. the dog's astronaut helmet opens up so he can grab one. 35mm film, the intricate details and texturing of the dog's hair are clearly visible and the light of the comets shimmers off the fur."
    }
  ],
  "stream": true
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Authorization: Bearer  {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "sora-2",
  "max_tokens": 1000,
  "messages": [
    {
      "role": "user",
      "content": "an astronaut golden retriever named Sora levitates around an intergalactic pup-themed space station with a tiny jet back that propels him. gorgeous specular lighting and comets fly through the sky, retro-future astro-themed music plays in the background. light glimmers off the dog'\''s eyes. the dog initially propels towards the space station with the doors opening to let him in. the shot then changes. now inside the space station, many tennis balls are flying around in zero gravity. the dog'\''s astronaut helmet opens up so he can grab one. 35mm film, the intricate details and texturing of the dog'\''s hair are clearly visible and the light of the comets shimmers off the fur."
    }
  ],
  "stream": true
}'

返回响应

🟢200OK
application/json
Body

示例
{
    "id": "chatcmpl-123",
    "object": "chat.completion",
    "created": 1677652288,
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "\n\nHello there, how may I assist you today?"
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 9,
        "completion_tokens": 12,
        "total_tokens": 21
    }
}
修改于 2026-03-02 06:48:12
上一页
openai 编辑视频
下一页
创建视频, 带图片
Built with