init: AI 文生图调用脚本与文档
- gpt-image-t2i / grok-image-t2i:OpenAI 兼容接口文生图脚本 - SKILLS.md:输出规范(统一输出到 output/,按「模型名-时间戳」命名) - 接口与参数说明文档
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
# Grok 图像生成 API 文档
|
||||
|
||||
## 调用示例
|
||||
|
||||
```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
|
||||
}'
|
||||
```
|
||||
|
||||
> 将 `<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 | 图像结果的返回方式 |
|
||||
Reference in New Issue
Block a user