curl --request POST \
--url https://aireiter.com/api/openapi/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt_image_1_5",
"params": {
"prompt": "一张复古旅行海报,大标题写着 \"VISIT KYOTO\",寺庙与樱花",
"aspect_ratio": "2:3",
"quality": "high"
},
"out_task_id": "my_task_123456"
}'
curl --request POST \
--url https://aireiter.com/api/openapi/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt_image_1_5",
"params": {
"prompt": "把背景换成阳光海滩,人物保持不变",
"image_url": ["https://example.com/person.jpg"],
"aspect_ratio": "3:2",
"quality": "medium"
},
"out_task_id": "my_task_edit_001"
}'
import requests
url = "https://aireiter.com/api/openapi/submit"
payload = {
"model": "gpt_image_1_5",
"params": {
"prompt": "把背景换成阳光海滩,人物保持不变",
"image_url": ["https://example.com/person.jpg"],
"aspect_ratio": "3:2",
"quality": "medium"
},
"out_task_id": "my_task_123456"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://aireiter.com/api/openapi/submit";
const payload = {
model: "gpt_image_1_5",
params: {
prompt: "把背景换成阳光海滩,人物保持不变",
image_url: ["https://example.com/person.jpg"],
aspect_ratio: "3:2",
quality: "medium"
},
out_task_id: "my_task_123456"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://aireiter.com/api/openapi/submit"
payload := map[string]interface{}{
"model": "gpt_image_1_5",
"params": map[string]interface{}{
"prompt": "把背景换成阳光海滩,人物保持不变",
"image_url": []string{"https://example.com/person.jpg"},
"aspect_ratio": "3:2",
"quality": "medium",
},
"out_task_id": "my_task_123456",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://aireiter.com/api/openapi/submit";
String payload = """
{
"model": "gpt_image_1_5",
"params": {
"prompt": "把背景换成阳光海滩,人物保持不变",
"image_url": ["https://example.com/person.jpg"],
"aspect_ratio": "3:2",
"quality": "medium"
},
"out_task_id": "my_task_123456"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://aireiter.com/api/openapi/submit";
$payload = [
"model" => "gpt_image_1_5",
"params" => [
"prompt" => "把背景换成阳光海滩,人物保持不变",
"image_url" => ["https://example.com/person.jpg"],
"aspect_ratio" => "3:2",
"quality" => "medium"
],
"out_task_id" => "my_task_123456"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"statusCode": 200,
"message": "",
"data": {
"out_task_id": "my_task_123456",
"status": "pending",
"created_at": "2026-09-24T06:33:30.012Z"
}
}
{
"statusCode": 400,
"message": "请求参数无效",
"ok": false
}
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥"
}
}
{
"error": {
"code": 433,
"message": "账户余额不足,请充值后再试"
}
}
{
"error": {
"code": 500,
"message": "服务器内部错误,请稍后重试"
}
}
GPT-Image-1.5
GPT-Image-1.5 图片生成
- 异步处理模式,返回任务ID用于后续查询
- OpenAI GPT Image 1.5,支持文生图 / 图生图(参考图编辑、多图合成)
- 传入 image_url 时自动走图生图,不传则为文生图
- 支持 3 种图片比例:1:1 / 3:2 / 2:3,通过 aspect_ratio 字段传入
- 支持 quality 质量档位:medium(默认,更快)/ high(更慢,细节更丰富)
- 参考图最多 16 张,支持 URL 与 base64 混填
- 每次请求返回 1 张图;不支持 resolution / size / 透明背景
- 提交的 prompt 会经过平台敏感词 / 安全审核,违规内容会被直接拒绝
POST
/
api
/
openapi
/
submit
curl --request POST \
--url https://aireiter.com/api/openapi/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt_image_1_5",
"params": {
"prompt": "一张复古旅行海报,大标题写着 \"VISIT KYOTO\",寺庙与樱花",
"aspect_ratio": "2:3",
"quality": "high"
},
"out_task_id": "my_task_123456"
}'
curl --request POST \
--url https://aireiter.com/api/openapi/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt_image_1_5",
"params": {
"prompt": "把背景换成阳光海滩,人物保持不变",
"image_url": ["https://example.com/person.jpg"],
"aspect_ratio": "3:2",
"quality": "medium"
},
"out_task_id": "my_task_edit_001"
}'
import requests
url = "https://aireiter.com/api/openapi/submit"
payload = {
"model": "gpt_image_1_5",
"params": {
"prompt": "把背景换成阳光海滩,人物保持不变",
"image_url": ["https://example.com/person.jpg"],
"aspect_ratio": "3:2",
"quality": "medium"
},
"out_task_id": "my_task_123456"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://aireiter.com/api/openapi/submit";
const payload = {
model: "gpt_image_1_5",
params: {
prompt: "把背景换成阳光海滩,人物保持不变",
image_url: ["https://example.com/person.jpg"],
aspect_ratio: "3:2",
quality: "medium"
},
out_task_id: "my_task_123456"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://aireiter.com/api/openapi/submit"
payload := map[string]interface{}{
"model": "gpt_image_1_5",
"params": map[string]interface{}{
"prompt": "把背景换成阳光海滩,人物保持不变",
"image_url": []string{"https://example.com/person.jpg"},
"aspect_ratio": "3:2",
"quality": "medium",
},
"out_task_id": "my_task_123456",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://aireiter.com/api/openapi/submit";
String payload = """
{
"model": "gpt_image_1_5",
"params": {
"prompt": "把背景换成阳光海滩,人物保持不变",
"image_url": ["https://example.com/person.jpg"],
"aspect_ratio": "3:2",
"quality": "medium"
},
"out_task_id": "my_task_123456"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://aireiter.com/api/openapi/submit";
$payload = [
"model" => "gpt_image_1_5",
"params" => [
"prompt" => "把背景换成阳光海滩,人物保持不变",
"image_url" => ["https://example.com/person.jpg"],
"aspect_ratio" => "3:2",
"quality" => "medium"
],
"out_task_id" => "my_task_123456"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"statusCode": 200,
"message": "",
"data": {
"out_task_id": "my_task_123456",
"status": "pending",
"created_at": "2026-09-24T06:33:30.012Z"
}
}
{
"statusCode": 400,
"message": "请求参数无效",
"ok": false
}
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥"
}
}
{
"error": {
"code": 433,
"message": "账户余额不足,请充值后再试"
}
}
{
"error": {
"code": 500,
"message": "服务器内部错误,请稍后重试"
}
}
Authorizations
string
必填
所有接口均需要使用Bearer Token进行认证获取 API Key:访问 API Key 管理页面 获取您的 API Key使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY
Body
string
必填
模型名称固定值:
"gpt_image_1_5"object
必填
模型参数对象
显示 params 对象属性
显示 params 对象属性
string
必填
图像生成的文本描述
- 支持中英文,建议详细描述
- 图生图时写清楚「要改什么」和「哪些保持不变」(如人物面部、姿势、背景)
- 需要在图中出现的文字请用引号括起来
- 提交前会经过平台敏感词 / 安全审核,命中违规内容会直接返回错误
string[]
参考图数组,传入后走图生图模式;不传则为文生图
- 最多 16 张参考图
- 单张不超过 10MB,支持 jpeg、png、webp
- 支持以下两种格式:
- 公开可访问的 URL
- Base64 编码格式
- 必须使用完整的 Data URI 格式:
data:image/{格式};base64,{base64数据} - 示例:
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABg... - ⚠️ 注意:必须包含
data:image/jpeg;base64,前缀部分
- 必须使用完整的 Data URI 格式:
string
默认值:"1:1"
图像生成的比例支持以下取值:
1:1- 正方形(默认)3:2- 横版2:3- 竖版
仅支持以上 3 个取值;传入其他比例(如
16:9、auto)或像素尺寸(如 1024x1024)会直接报错string
默认值:"medium"
图片质量档位
medium- 均衡,出图更快(默认)high- 更慢,细节更丰富,适合定稿
medium 调试 prompt 和构图,确定后再用 high 出最终图。不同档位的计费不同,以提交响应中的 estimated_credits 为准。string
必填
发起方任务ID用户自定义的任务标识,必填
使用说明
- 文生图 / 图生图自动切换:不传
image_url为文生图;传入 1~16 张参考图即为图生图,可用于局部修改、换装、换背景、风格转换和多图合成。 - 两种模式参数一致:文生图与图生图使用同一组参数,按
quality档位计费。 - 输出尺寸:由
aspect_ratio与quality共同决定,实际像素以返回图片为准;如需 1K / 2K / 4K 或更多比例,请使用 GPT-Image-2。 - 失败不扣费:任务失败时不会扣除积分。
Response
string
发起方任务ID,可用于查询结果
string
初始状态,固定为
"pending"number
预估消耗积分,随
quality 档位变化string
创建时间(ISO 格式)
curl --request POST \
--url https://aireiter.com/api/openapi/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt_image_1_5",
"params": {
"prompt": "一张复古旅行海报,大标题写着 \"VISIT KYOTO\",寺庙与樱花",
"aspect_ratio": "2:3",
"quality": "high"
},
"out_task_id": "my_task_123456"
}'
curl --request POST \
--url https://aireiter.com/api/openapi/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt_image_1_5",
"params": {
"prompt": "把背景换成阳光海滩,人物保持不变",
"image_url": ["https://example.com/person.jpg"],
"aspect_ratio": "3:2",
"quality": "medium"
},
"out_task_id": "my_task_edit_001"
}'
import requests
url = "https://aireiter.com/api/openapi/submit"
payload = {
"model": "gpt_image_1_5",
"params": {
"prompt": "把背景换成阳光海滩,人物保持不变",
"image_url": ["https://example.com/person.jpg"],
"aspect_ratio": "3:2",
"quality": "medium"
},
"out_task_id": "my_task_123456"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://aireiter.com/api/openapi/submit";
const payload = {
model: "gpt_image_1_5",
params: {
prompt: "把背景换成阳光海滩,人物保持不变",
image_url: ["https://example.com/person.jpg"],
aspect_ratio: "3:2",
quality: "medium"
},
out_task_id: "my_task_123456"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://aireiter.com/api/openapi/submit"
payload := map[string]interface{}{
"model": "gpt_image_1_5",
"params": map[string]interface{}{
"prompt": "把背景换成阳光海滩,人物保持不变",
"image_url": []string{"https://example.com/person.jpg"},
"aspect_ratio": "3:2",
"quality": "medium",
},
"out_task_id": "my_task_123456",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://aireiter.com/api/openapi/submit";
String payload = """
{
"model": "gpt_image_1_5",
"params": {
"prompt": "把背景换成阳光海滩,人物保持不变",
"image_url": ["https://example.com/person.jpg"],
"aspect_ratio": "3:2",
"quality": "medium"
},
"out_task_id": "my_task_123456"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://aireiter.com/api/openapi/submit";
$payload = [
"model" => "gpt_image_1_5",
"params" => [
"prompt" => "把背景换成阳光海滩,人物保持不变",
"image_url" => ["https://example.com/person.jpg"],
"aspect_ratio" => "3:2",
"quality" => "medium"
],
"out_task_id" => "my_task_123456"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"statusCode": 200,
"message": "",
"data": {
"out_task_id": "my_task_123456",
"status": "pending",
"created_at": "2026-09-24T06:33:30.012Z"
}
}
{
"statusCode": 400,
"message": "请求参数无效",
"ok": false
}
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥"
}
}
{
"error": {
"code": 433,
"message": "账户余额不足,请充值后再试"
}
}
{
"error": {
"code": 500,
"message": "服务器内部错误,请稍后重试"
}
}