GPT Image 2
OpenAI image
输入$5/M
输出$30/M
厂商牌价,无平台加价,按量付费。 以下为官方 list 价。登录客户可在 /console/pricing 查看含工作空间折扣的实际价格。
30 秒用上 GPT Image 2
OpenAI 兼容:换掉 base_url,SDK 不用改。POST /v1/images/generations
from openai import OpenAI
client = OpenAI(
base_url="https://synthorai.io/v1",
api_key="sk-syn-...",
)
resp = client.images.generate(
model="gpt-image-2",
prompt="a watercolor lighthouse at dawn",
size="1024x1024",
)
print(resp.data[0].b64_json[:80])import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://synthorai.io/v1",
apiKey: "sk-syn-...",
});
const resp = await client.images.generate({
model: "gpt-image-2",
prompt: "a watercolor lighthouse at dawn",
size: "1024x1024",
});
console.log(resp.data?.[0]?.b64_json?.slice(0, 80));curl https://synthorai.io/v1/images/generations \
-H "Authorization: Bearer sk-syn-..." \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "a watercolor lighthouse at dawn",
"size": "1024x1024"
}'package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/option"
)
func main() {
client := openai.NewClient(
option.WithBaseURL("https://synthorai.io/v1"),
option.WithAPIKey("sk-syn-..."),
)
resp, _ := client.Images.Generate(context.TODO(), openai.ImageGenerateParams{
Model: "gpt-image-2",
Prompt: "a watercolor lighthouse at dawn",
Size: "1024x1024",
})
fmt.Println(resp.Data[0].B64JSON[:80])
}import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.images.*;
OpenAIClient client = OpenAIOkHttpClient.builder()
.baseUrl("https://synthorai.io/v1")
.apiKey("sk-syn-...")
.build();
ImagesResponse resp = client.images().generate(
ImageGenerateParams.builder()
.model("gpt-image-2")
.prompt("a watercolor lighthouse at dawn")
.size("1024x1024")
.build());
System.out.println(resp.data().orElseThrow().get(0).b64Json().orElseThrow().substring(0, 80));关于 GPT Image 2
灵活尺寸与高保真图像输入
同时服务生成与编辑端点
新图像负载的默认推荐
gpt-image-2 是 OpenAI 最先进的图像模型,为快速、高质量的图像生成与编辑打造。
- 相比前代,它新增灵活的图像尺寸和高保真图像输入,同时服务图像生成和图像编辑两个端点,并在官方模型页上位列最高性能档。
- 它是新图像工作负载的当前默认推荐。
- Synthorai 在其 OpenAI 兼容 /v1/images/generations 路由上支持 gpt-image-2,请求与响应形态与上游完全一致。
规格与限制
| 模态 | text + image → image |
| 特性 | vision |
| 图像能力 | Flexible resolutions: edges up to 3840px in multiples of 16, ratio <=3:1, ~0.65-8.3MP total (incl. 4K 3840x2160); editing with mask inpainting; all image inputs processed at high fidelity; significantly improved text rendering (precise placement can still struggle) |
| 备注 | State-of-the-art image generation and editing tier; partial-image streaming via partial_images parameter (100 extra image tokens per partial). |
常见问题
GPT Image 2 API 可以免费试用吗?
可以。新账号可获得 10 次试用调用和最高 $1 的免费额度,无需绑卡。足够在添加付款方式之前,用真实工作负载试一试 GPT Image 2。
GPT Image 2 最擅长什么?
灵活尺寸与高保真图像输入,以及同时服务生成与编辑端点和新图像负载的默认推荐。完整能力请见 About 部分,内容取自厂商官方发布说明。
GPT Image 2 的价格是多少?
在 Synthorai 上,GPT Image 2 输入 $5/百万 token、输出 $30/百万 token,即厂商牌价,无平台加价。
如何调用 GPT Image 2 API 生成图片?
向 Synthorai 的 /v1/images/generations 发送 POST,model="gpt-image-2",即标准 OpenAI images API 形态,无需厂商 SDK。
如何开通 GPT Image 2?
把现有 OpenAI SDK 的 base_url 指向 "https://synthorai.io/v1",model 设为 "gpt-image-2" 即可。一把 API key 通用网关上的全部模型。