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 通用閘道上的所有模型。