Files
ai-image/gpt-image-t2i/docs.md
T
toor 3b2fdc4402 init: AI 文生图调用脚本与文档
- gpt-image-t2i / grok-image-t2i:OpenAI 兼容接口文生图脚本
- SKILLS.md:输出规范(统一输出到 output/,按「模型名-时间戳」命名)
- 接口与参数说明文档
2026-08-18 17:08:14 +08:00

77 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# GPT 图像生成 API 文档
## 调用示例
### gpt-image-2-1K
```bash
curl https://api.slomerex.xyz/v1/chat/completions \
-H "Authorization: Bearer $NEW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-1K",
"messages": [
{
"role": "user",
"content": "Explain quantum entanglement in one paragraph."
}
],
"temperature": 0.7
}'
```
### gpt-image-2-2K
```bash
curl https://api.slomerex.xyz/v1/chat/completions \
-H "Authorization: Bearer $NEW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-2K",
"messages": [
{
"role": "user",
"content": "Explain quantum entanglement in one paragraph."
}
],
"temperature": 0.7
}'
```
### gpt-image-2-4K
```bash
curl https://api.slomerex.xyz/v1/chat/completions \
-H "Authorization: Bearer $NEW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-4K",
"messages": [
{
"role": "user",
"content": "Explain quantum entanglement in one paragraph."
}
],
"temperature": 0.7
}'
```
> 将 `<YOUR_API_KEY>` 替换为令牌设置中的 API Key。
## 身份验证
所有请求必须携带 `Authorization: Bearer <TOKEN>` 请求头。Anthropic 格式的端点也接受 `x-api-key` 请求头。
在「令牌」页面生成 API Key,可以按模型、分组、IP、速率等维度精细化授权。
## 支持的参数
| 参数 | 类型 | 默认值 / 范围 | 说明信息 |
|------|------|--------------|----------|
| prompt | string(必填) | — | 想要生成图像的文字描述 |
| size | enum | 1024x1024 | 输出图像尺寸 |
| quality | enum | standard | 生成质量预设 |
| style | enum | vivid | 画风 |
| n | integer | 1(范围 1 ~ 10) | 生成的图像数量 |
| response_format | enum | url | 图像结果的返回方式 |