- 发出请求
- 模型接口
- 完成对象
- 聊天接口(Chat)
- Suno-API
- 自动补全接口(Completions)
- 图像接口(Images)
- 向量生成接口(Embeddings)
- 音频接口(Audio)
- OpenAI接口(Chat)
- Anthropic Claude
- Midjourney
- GPTs 相关
- 文生音乐
- 文生视频
- 文生图接口
- 审查(Moderations)
- OpenAI
- xAI
- Anthropic
- Google
- Realtime (实时语音、对话)
- Rerank API
- 帮助中心
- Python配置方式
stable-diffusion(OpenAI图像格式)
POST
/chat/completions
batch_size Required range: 1 < x < 4
num_inference_steps Required range: 1 < x < 100
guidance_scale Required range: 0 < x < 100
seed Required range: 0 < x < 9999999999
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Header 参数
Authorization
string
可选
示例值:
Bearer {{YOUR_API_KEY}}
Body 参数application/json
prompt
string
必需
n
integer
可选
size
string
可选
示例
{
"model": "stable-diffusion-api",
"messages": [
{
"role": "user",
"content": "striking poses, stunning backdrop of rocky coastline and golden hour lighting, fashion-forward wardrobe, eye-catching accessories, warm and inviting color palette, sharp and detailed digital rendering, stunning high definition finish, on eye level, scenic, masterpiece"
}
]
}
示例代码
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://smallaapi.1273656643.workers.dev/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "stable-diffusion-api",
"messages": [
{
"role": "user",
"content": "striking poses, stunning backdrop of rocky coastline and golden hour lighting, fashion-forward wardrobe, eye-catching accessories, warm and inviting color palette, sharp and detailed digital rendering, stunning high definition finish, on eye level, scenic, masterpiece"
}
]
}'
返回响应
🟢200Create image
application/json
Body
created
integer
必需
data
array [object {1}]
必需
url
string
必需
示例
{
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}
修改于 2025-06-09 18:15:13