GPT Image 2.6 Official
curl --request POST \
--url https://apistable.ai/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2.6-official",
"input": {
"prompt": "Studio photograph of a cobalt blue ceramic teapot, soft daylight, neutral background.",
"aspect_ratio": "1:1",
"resolution": "1K",
"version": "flare"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-image-2.6-official',
input: {
prompt: 'Studio photograph of a cobalt blue ceramic teapot, soft daylight, neutral background.',
aspect_ratio: '1:1',
resolution: '1K',
version: 'flare'
}
})
};
fetch('https://apistable.ai/api/v1/tasks/create_task', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.ai/api/v1/tasks/create_task"
payload = {
"model": "gpt-image-2.6-official",
"input": {
"prompt": "Studio photograph of a cobalt blue ceramic teapot, soft daylight, neutral background.",
"aspect_ratio": "1:1",
"resolution": "1K",
"version": "flare"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": 200,
"msg": "success",
"data": {
"task_id": "<string>"
}
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}OpenAI
GPT Image 2.6 Official
支持静态图、GIF 动图、SVG 矢量图生成及标注/蒙版编辑,按实际 Token 计费。
POST
/
api
/
v1
/
tasks
/
create_task
GPT Image 2.6 Official
curl --request POST \
--url https://apistable.ai/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2.6-official",
"input": {
"prompt": "Studio photograph of a cobalt blue ceramic teapot, soft daylight, neutral background.",
"aspect_ratio": "1:1",
"resolution": "1K",
"version": "flare"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-image-2.6-official',
input: {
prompt: 'Studio photograph of a cobalt blue ceramic teapot, soft daylight, neutral background.',
aspect_ratio: '1:1',
resolution: '1K',
version: 'flare'
}
})
};
fetch('https://apistable.ai/api/v1/tasks/create_task', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.ai/api/v1/tasks/create_task"
payload = {
"model": "gpt-image-2.6-official",
"input": {
"prompt": "Studio photograph of a cobalt blue ceramic teapot, soft daylight, neutral background.",
"aspect_ratio": "1:1",
"resolution": "1K",
"version": "flare"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": 200,
"msg": "success",
"data": {
"task_id": "<string>"
}
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}参数与输入模式
model 与 input 必填,省略可选字段时使用模型默认值;完整字段定义见下方 Body 参数列表。
| 请求场景 | input 必填字段 |
|---|---|
| 文生图 | prompt |
| 参考图编辑 | prompt、image_urls(最多 16 张) |
| 蒙版局部编辑 | prompt、image_urls、mask_url |
| 标注引导编辑 | prompt、image_urls、markup_url |
| GIF 动图 | prompt、output_format: "gif" |
| SVG 矢量图 | prompt、output_format: "svg"、svg.model |
特殊输出说明
- GIF(
output_format: "gif"):size表示单帧像素,忽略resolution,未传size时aspect_ratio只能省略或为auto。帧拼成一张网格图(规格见frame_count),按整张图计费,空白格也计入。 - SVG(
output_format: "svg"):须指定svg.model且n为1(或省略);不可与mask_url、markup_url、output_compression同用。生成最长可能耗时 22 分钟,请持续轮询原task_id。
使用场景
将以下示例提交到POST /api/v1/tasks/create_task,并将提示词与素材链接替换为你的内容。
{
"model": "gpt-image-2.6-official",
"input": {
"prompt": "Architectural photograph of a timber pavilion beside a misty pine pond at dawn.",
"version": "flare",
"aspect_ratio": "16:9",
"resolution": "2K",
"quality": "high",
"complexity": "medium"
}
}
{
"model": "gpt-image-2.6-official",
"input": {
"prompt": "Follow the arrows and notes on the annotation layer: move the brass lamp left and replace the ceramic mug with a glass carafe.",
"image_urls": [
"https://cdn.example.com/desk.png"
],
"markup_url": "https://cdn.example.com/annotation.png"
}
}
{
"model": "gpt-image-2.6-official",
"input": {
"prompt": "Replace the transparent masked background with warm limestone in soft daylight, keeping the product unchanged.",
"image_urls": [
"https://cdn.example.com/product.png"
],
"mask_url": "https://cdn.example.com/mask.png"
}
}
{
"model": "gpt-image-2.6-official",
"input": {
"prompt": "A small red fox gently wags its tail as snow falls, fixed camera, seamless loop.",
"output_format": "gif",
"size": "512x512",
"frame_count": 8,
"frame_duration_ms": 200
}
}
{
"model": "gpt-image-2.6-official",
"input": {
"prompt": "Minimalist bakery emblem featuring a stylized wheat stalk in warm ochre and charcoal, flat vector shapes.",
"output_format": "svg",
"background": "transparent",
"svg": {
"model": "gpt-5.4-mini",
"reasoning": {
"effort": "low"
}
}
}
}
通过 查询任务 或 callback_url(Webhook 安全与验签)获取结果,提交错误见 创建任务。结果链接保留 14 天;超过 24 小时未完成的任务将标记失败且不扣费。
试用与价格
单次请求最多生成n 个结果,整笔任务按实际 Token 用量结算一次,向上取整至 0.1 积分(实扣不超过提交预留,未用部分退还)。部分成功仅按实际返回的结果计费,失败不扣费。SVG 另按实时报价计入写入模型 Token(思考过程计入输出 Token)。余额查询见 查询积分余额。| Token 类型 | 积分 / 百万 Token | USD / 百万 Token |
|---|---|---|
| 文本输入 | 950.0 | $4.750 |
| 缓存文本输入 | 237.5 | $1.188 |
| 图像输入 | 1520.0 | $7.600 |
| 缓存图像输入 | 380.0 | $1.900 |
| 图像输出 | 5700.0 | $28.500 |
在线试用
设置参数并在线生成图片。
查看价格
查看 Token 费率、请求估价与预留上限。
授权
登录 APIstable 后,在 API Key 管理 创建并复制密钥。
每次调用都要在 HTTP 请求头传入:
Authorization: Bearer YOUR_API_KEY
将 YOUR_API_KEY 替换为你创建的 API Key。
请求体
application/json
回调
POST{$request.body#/callback_url}Webhook
请求体
application/json
任务成功或失败后,APIstable 向创建任务时传入的 callback_url 发送 JSON POST。验签后返回 HTTP 2xx 确认接收。
请求生成的全部结果返回在 result.urls(可能少于 n),整笔任务总费用记录在 charged_credits。任务失败时返回 status: "failed"、result: null 且不扣费。
签名和去重使用 X-APIstable-Signature、X-APIstable-Timestamp 和 X-APIstable-Event-Id。详见 Webhook 安全与验签。
Webhook 请求体示例
{ "code": 200, "msg": "success", "data": { "task_id": "c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb", "model": "gpt-image-2.6-official", "status": "succeeded", "created_at": "2026-11-23T08:30:00.000Z", "completed_at": "2026-11-23T08:30:18.000Z", "duration": 18000, "charged_credits": 2.1, "message": "", "input": "{\"prompt\":\"Studio photograph of a cobalt blue ceramic teapot, soft daylight, neutral background.\",\"resolution\":\"1K\",\"aspect_ratio\":\"1:1\"}", "result": { "urls": [ "https://cdn.example.com/generated/image.png" ], "items": [ { "id": "e7aacd19-819a-4747-bbbf-46fb6f2995a5", "status": "succeeded", "charged_credits": 2.1, "urls": [ "https://cdn.example.com/generated/image.png" ] } ] } } }
响应
2XX
已接收 Webhook。