1. Gemini官方格式
星光API
  • 所有对话模型均兼容 OpenAI 格式
  • 聊天对话
    • ChatGPT(Chat)
      • 创建聊天函数调用
      • 创建视频, 带图片
      • 连续修改生成视频
      • 创建结构化输出
      • 控制推理模型努力程度
    • ChatGPT(Responses)
      • 创建模型响应
      • 创建函数调用
      • 创建模型响应(流式返回)
      • 创建模型响应 (控制思考长度)
      • 创建网络搜索
      • 创建模型响应 gpt-5启用思考
    • Gemini官方格式
      • 创建视频
        POST
      • GemIni原生接口格式
        POST
      • 图片生成
        POST
      • 文档理解
        POST
      • 视频理解
        POST
      • 音频理解
        POST
      • TTS 文本转语音
        POST
    • Claude官方格式
      • Chat兼容格式
      • 联网搜索
      • 创建格式化输出
      • 创建函数调用 (流式)
      • 创建思考聊天
      • PDF支持
      • PDF支持 base64格式
      • 创建聊天补全 (流式)
  • 绘画模型
    • 通用生图(推荐)
      • Generations通用文生图
      • Edits通用图像编辑&图生图
    • Gemini绘图
      • Generations
      • Gemini原生格式
      • 文生图text-to-image
      • 图生图image-to-image
    • 即梦绘画
      • 通用聊天格式
      • Gemini格式
    • GPT-Image
      • gpt-image-2 创建图像
      • gpt-image-2 图像编辑
    • Midjourney
      • 上传图片
      • 提交Imagine任务
      • 根据任务ID 查询任务状态
      • 根据ID列表查询任务
      • 获取任务图片的seed
      • 执行Action动作
      • 提交Blend任务
      • 提交Describe任务
      • 提交Modal
    • Flux绘图
      • 文生图
      • 图生图
  • 视频模型
    • 统一接口
      • 创建视频
      • 查询结果
    • Grok视频
      • 创建视频任务
      • 查询任务状态
    • 即梦Seedance2.0
      • 标准接口
        • 文生视频
        • 单图生视频
        • 首尾帧生视频
        • 多图参考模式
        • 全能参考模式
        • 视频编辑
        • 视频延长
        • 查询结果
        • 创建虚拟资源库
        • 查询素材结果
      • SD2特价
        • 创建视频任务
        • 查询结果
    • Veo视频
      • 计费说明
      • 使用说明和示例
      • 状态码说明和注意事项
      • 文生视频
      • 图生视频
      • 查询任务状态
      • 查询任务状态和结果地址
      • 下载视频
    • RunWay视频
      • [推荐]统一任务格式
        • 文生视频
        • 图生视频
        • 视频生视频
        • 查询任务结果
      • 官方格式
        • 图生视频
        • 视频生视频
        • 查询任务结果
    • 快手可灵
      • 使用说明,必看!!
      • 文生视频
      • 单图生视频
      • 多图生视频
      • 首尾帧
      • 动作控制(Kling-2.6 专用)
      • 数字人
      • 对口型
      • 参考视频高级透传(file_infos)
      • 动作控制 + file_infos
      • ExtInfo 多镜头(Kling-3.0 高级)
      • 查询结果
  • 音频模型
    • Suno音乐
      • 生成音乐
      • 生成歌词
      • 查询单个任务[歌曲]
      • 查询单个任务[歌词]
      • 批量查询任务
    • MiniMax音频
      • 音乐生成
        • 音乐生成
        • 歌词生成
      • 语音合成
        • 语音接口说明
        • 音频复刻注意事项
        • 同步语音合成
        • 上传复刻音频
        • 音色快速复刻
        • 查询可用音色
    • 谷歌Lyria3
      • Google原生格式
  • 热门应用对接
    • Claude Code 安装使用教程
    • CodeX安装配置教程(Linux)
  • 平台API
    • 文件上传
  1. Gemini官方格式

创建视频

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

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
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 'https://api.xgapi.top/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
  "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
Bodyapplication/json

示例
{
    "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-02-25 07:31:23
上一页
创建模型响应 gpt-5启用思考
下一页
GemIni原生接口格式
Built with