> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bytespike.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT-Image 2 Official

> GPT-Image 2 的合规级变体 —— 面向审计与数据驻留敏感场景。

**家族：** GPT（OpenAI）
**Model ID：** `gpt-image-2-official`
**能力：** 1024² – 4096² · 写实 · prompt 遵从
**价格：** 按张计费，官方级 ([实时费率](https://bytespike.ai/pricing#image))

GPT-Image 2 Official 是 GPT-Image 2 的更高合规等级 —— 模型权重和输出与
[GPT-Image 2](/zh/api-reference/image/gpt-image-2) 相同。合规、数据驻留合同、
审计要求需要更严格等级时用这个变体。价格等级反映了该溢价。

## Request

```bash theme={null}
curl https://llm.bytespike.ai/v1/images/generations \
  -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-image-2-official",
    "prompt": "Studio shot of a teacup on a wooden table, soft natural light",
    "size": "1024x1024",
    "quality": "high"
  }'
```

### Body 参数

与 [GPT-Image 2](/zh/api-reference/image/gpt-image-2) 相同 —— `prompt`、
`size`、`n`、`quality`、`style`、`output_format`、`output_compression`。
只有 `model` 值不同。

## Response

shape 与 GPT-Image 2 相同。

```json theme={null}
{
  "created": 1715174400,
  "data": [{"url": "https://cdn.bytespike.ai/img/...", "revised_prompt": "..."}]
}
```

URL 预签名，24h 有效。

## 代码示例

<CodeGroup>
  ```bash cURL theme={null}
  curl https://llm.bytespike.ai/v1/images/generations \
    -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
    -H "content-type: application/json" \
    -d '{"model": "gpt-image-2-official", "prompt": "Studio teacup", "quality": "high"}'
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(base_url="https://llm.bytespike.ai/v1", api_key="$BYTESPIKE_API_KEY")
  resp = client.images.generate(
      model="gpt-image-2-official",
      prompt="Studio shot of a teacup on a wooden table, soft natural light",
      size="1024x1024",
      quality="high",
  )
  print(resp.data[0].url)
  ```

  ```javascript Node theme={null}
  import OpenAI from "openai"

  const client = new OpenAI({
    baseURL: "https://llm.bytespike.ai/v1",
    apiKey: process.env.BYTESPIKE_API_KEY,
  })
  const resp = await client.images.generate({
    model: "gpt-image-2-official",
    prompt: "Studio shot of a teacup on a wooden table, soft natural light",
    size: "1024x1024",
    quality: "high",
  })
  console.log(resp.data[0].url)
  ```
</CodeGroup>

## 错误

与 [GPT-Image 2](/zh/api-reference/image/gpt-image-2) 相同。注意官方等级
在高峰期对限流可能更敏感；偶尔会遇到带较长 Retry-After 的 429。

## 何时选用

* 合规 / 数据驻留合同要求更严格等级。
* 审计流程把合规等级写进了规范。
* 同样模型输出但更低成本，见 [GPT-Image 2](/zh/api-reference/image/gpt-image-2)。
* 文字渲染边界情况下，[Nano Banana 2](/zh/api-reference/image/nano-banana-v2) 也很强。

## 限制

| 限制              | 值          |
| --------------- | ---------- |
| 最大输出分辨率         | 4096×4096  |
| 单次最大张数（`n`）     | 4          |
| 支持 `quality` 修饰 | 是          |
| 同步？             | 是（典型 ≤30s） |
| 1024² high 平均延迟 | 14-22s     |
