Image · OpenAI

GPT Image 2 API

GPT Image 2 API 调用 OpenAI 最新图像生成,支持多语言图内文字近乎完美渲染。

运行中 · 2 endpoints · 起价 $0.060
runapi.ai
curl -X POST https://runapi.ai/api/v1/gpt_image_2/text_to_image \
  -H "Authorization: Bearer $RUNAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-image-2",
  "prompt": "生成一张贺卡,上面装饰性书法写着 '新年快乐 Happy New Year',金红色主题。"
}'
import { GptImage2Client } from "@runapi.ai/gpt-image-2";

const client = new GptImage2Client();
const result = await client.textToImage.run({
    model: "gpt-image-2",
    prompt: "生成一张贺卡,上面装饰性书法写着 '新年快乐 Happy New Year',金红色主题。",
});
<?php

require __DIR__ . "/vendor/autoload.php";

use RunApi\GptImage2\GptImage2Client;

$client = new GptImage2Client();
$result = $client->textToImage->run([
        'model' => 'gpt-image-2',
        'prompt' => '生成一张贺卡,上面装饰性书法写着 \'新年快乐 Happy New Year\',金红色主题。',
]);
require "runapi/gpt_image_2"

client = RunApi::GptImage2::Client.new
result = client.text_to_image.run(
    model: "gpt-image-2",
    prompt: "生成一张贺卡,上面装饰性书法写着 '新年快乐 Happy New Year',金红色主题。"
)
npx skills add runapi-ai/gpt-image-2 -g
# Claude Code
claude mcp add runapi -s user -- npx -y @runapi.ai/mcp

# Codex
codex plugin install runapi-mcp@agents

# Cursor / Windsurf / VS Code
npx @runapi.ai/mcp init cursor
@runapi.ai/gpt-image-2 v1
概览

GPT Image 2 是 OpenAI 最新的图像生成模型,支持近乎完美的多语言图内文字渲染,在指令遵循和细节表现上均优于前代版本。

  • 多变体覆盖不同速度/质量层级
  • Model skill 包含文档、schema 和接入说明
  • 适合面向应用的编码工作流
  • 失败的生成不计费
定价

定价

失败的生成不计费
Text to image
$0.06-$0.16 / image
Output resolution: 1k $0.06
Output resolution: 2k $0.10
Output resolution: 4k $0.16
Edit image
$0.06-$0.16 / image
Output resolution: 1k $0.06
Output resolution: 2k $0.10
Output resolution: 4k $0.16
规格

技术细节

模型 ID gpt-image-2
提供方 OpenAI
模态 image
任务类型 asynchronous
计费单位 call
API 端点 /api/v1/gpt_image_2/text_to_image
商用许可 允许商用
状态 运行中
技能

为应用开发安装 GPT Image 2 skill

把模型文档、schema、定价说明和接入步骤加载进代码工作区。

# Install the model skill for app development workflows
npx skills add runapi-ai/gpt-image-2 -g
Installs docs, schemas, pricing context, and setup notes into your developer workspace.
Or use this setup request in your coding tool:
Install the GPT Image 2 skill for this app:

1. Add runapi-ai/gpt-image-2 with the skills installer.
2. Load SKILL.md in this workspace.
3. Use its docs, schemas, pricing notes, and setup steps when adding model features.
4. Confirm the install path when done.
工作流程

四步从 model skill 到首次结果

01

选择模型

根据输出类型、质量要求和延迟目标选择模型与变体。

02

配置

设置 RunAPI key,并在代码工作区安装对应 model skill。

03

调用

按 skill 里的说明,把模型能力接入到你的应用里。

04

接收

按 task ID 轮询、在支持时使用流式,或处理 webhook 回调。

背景

GPT Image 2 API 是什么?

GPT Image 2 是 OpenAI 最新图像模型,以多语言图内文字近乎完美渲染著称。通过 RunAPI,文生图和图像编辑端点共享一把 key。

Provider
OpenAI
Modality
Image
为何选择 RunAPI

为什么用 RunAPI 调用 GPT Image 2 API

一把认证,覆盖所有提供方

一把 RunAPI key 解锁整个模型目录。无需为每家提供方单独建账户。

统一的定价与账单

USD 按次定价,按月结算。失败的生成不计费。

Schema 优先的 SDK

Typed schema 和接入说明已打包进 model skill,让实现从正确契约开始。

常见问题

常见问题

应该从哪个变体开始?

选满足质量要求的最便宜变体。多数团队从 fast 起步,生产时升级到 pro。

有免费额度吗?

新账户每个模型都有免费调用额度,之后按次计费。

支持流式吗?

模型支持流式时,RunAPI 端到端流式。

失败怎么计费?

失败的生成不计费。

输出会缓存吗?

输出按任务 ID 存储在 R2 供回取。输入不缓存。

可以商用吗?

可以——所有变体默认含商用许可,除非模型许可明确限制;有例外会在变体页面注明。

速率限制?

Key 级限流随使用层级伸缩。当前限制见定价页。

在哪里报问题?

在公共 GitHub 仓库提 issue 或邮件联系 support。

立即开始

立即体验 GPT Image 2 API。