- 序言
- OpenAI接口
- Suno音乐接口
- 绘画接口
- 视频接口
- 文本生成(通用)
- 可灵AI
任务提交
POST
https://api.openai-hub.com/pika/pro/generate
文本生成接口
请求参数
Header 参数
Authorization
string
必需
示例
Authorization: Bearer 2f68dbbf-519d-4f01-9636-e2421b68f379
默认值:
Bearer {{YOUR_API_KEY}}
Content-Type
string
可选
默认值:
application/json
Body 参数application/json
callback_url
string
回调地址
示例值:
http://baidu.com
prompt
string
描述词
示例值:
一只小猫
style
enum<string>
风格
枚举值:
InflateMeltExplodeSquishCrushCake-ifyTa-daDeflateCrumbleDissolveLevitateDecapitateEye-pop
示例值:
Inflate
ratio
string
画面尺寸
示例值:
16:9
sfx
boolean
开启音 效
示例值:
true
model
number
模型版本
示例值:
1.5
image
string
参考图片
video
string
参考视频
options
object
必需
frameRate
integer
帧
示例值:
20
camera
object
可选
parameters
object
可选
示例
{
"prompt": "鲸鱼喷水",
"style": "Inflate",
"ratio": "16:9",
"sfx": true,
"model": 1.5,
"options": {
"frameRate": 20,
"camera": {
"pan": "right",
"tilt": "up",
"rotate": "cw",
"zoom": "in"
},
"parameters": {
"guidanceScale": 16,
"motion": 2,
"negativePrompt": "ugly",
"seed": 144124
}
}
}
示例代码
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.openai-hub.com/pika/pro/generate' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "鲸鱼喷水",
"style": "Inflate",
"ratio": "16:9",
"sfx": true,
"model": 1.5,
"options": {
"frameRate": 20,
"camera": {
"pan": "right",
"tilt": "up",
"rotate": "cw",
"zoom": "in"
},
"parameters": {
"guidanceScale": 16,
"motion": 2,
"negativePrompt": "ugly",
"seed": 144124
}
}
}'
返回响应
🟢200成功示例
application/json
Body
code
integer
响应代码
示例值:
0
msg
string
响应消息
示例值:
操作成功
data
object
必需
task_id
string
任务ID
示例值:
123456
state
string
必需
status
string
必需
prompt
string
必需
prompt_en
null
必需
video_url
null
必需
poster
null
必需
last_frame
null
必需
msg
null
必需
point
string
必需
refund
string
必需
create_time
string
必需
update_time
string
必需
exec_time
number
必需
示例
{
"code": 200,
"msg": "成功",
"data": {
"task_id": "ee8a6500-b378-7daa-b501-53d674844bc1",
"state": "",
"status": "",
"prompt": "",
"prompt_en": null,
"video_url": null,
"poster": null,
"last_frame": null,
"msg": null,
"point": "",
"refund": "",
"create_time": "",
"update_time": ""
},
"exec_time": 0.610219
}
🟠404成功示例