Pixel API
使用指南钱包与商城福利与邀请API 参考帮助支持
图像(Images)

生成图像

根据提示词生成图片,仅 OpenAI 平台分组支持。

POST/v1/images/generations
AuthorizationBearerAuth
BearerAuth

使用 Bearer Token 认证。

Authorization: Bearer sk-xxxxxx

使用 Bearer Token 认证,格式:Authorization: Bearer sk-xxxxxx。

Bodyapplication/json
参数会同步到右侧示例代码。
modelrequired
string

图片模型名。

promptrequired
string

图片生成提示词。

size
string

图片尺寸,例如 1024x1024。

n
integer

生成图片数量。

response_format
string

返回 URL 或 b64_json,取决于上游支持。

Authorization

BearerAuth

请求头使用 Authorization,值为 Bearer <token>。 Token 来自控制台“API 密钥”,不是登录态,也不是管理员密钥。

In: header

Request Body

application/json
modelrequired

图片模型名。

promptrequired

图片生成提示词。

size

图片尺寸,例如 1024x1024。

n

生成图片数量。

response_format

返回 URL 或 b64_json,取决于上游支持。

Response Body

application/json
created

创建时间戳。

data

图片结果。常见字段为 url 或 b64_json。

说明

如果 API Key 绑定的不是 OpenAI 平台分组,接口会返回 not_found_error。