Skip to content

图像生成 API 使用指南

目前图片生成支持 gpt-image-2 一个模型。 接口遵循 OpenAI 兼容协议。

目录


快速开始

  1. 在页面中打开「图片生成」平台的界面。 alt text
  2. 若想提高专注力,可点击 「新窗口打开」 进入独立界面。 alt text
  3. 输入你的 API Key 即可开始使用。 alt text

模型一览

模型说明尺寸限制计费
gpt-image-2OpenAI 图像生成(标准画质)任意比例,长边 ≤ 3840;方形 ≤ 1024(实际会输出 ~1254×1254)按次

文生图(Generations)

端点

POST https://fast.ns.tisoz.com

请求生命周期示例

一次 4K 方图请求在网关中的完整流转:传入参数 → 转发到上游 → 上游响应

传入参数

json
{
  "n": 1,
  "size": "2880x2880",
  "model": "gpt-image-2",
  "stream": false,
  "endpoint": "generations",
  "prompt_chars": 68,
  "input_images": 0,
  "resolution_tier": "4k"
}

转发参数

json
{
  "n": 1,
  "size": "2880x2880",
  "model": "gpt-image-2",
  "prompt": "a red apple on a wooden table, studio light\n【以下是这张图的参数,2880x2880,方图】",
  "quality": "high",
  "output_format": "png"
}

上游响应

json
{
  "data": [
    {
      "size": {
        "width": 2880,
        "height": 2880
      },
      "b64_json": "<base64 13769540 chars>",
      "revised_prompt": null
    }
  ],
  "usage": {
    "input_tokens": 33,
    "total_tokens": 23615,
    "output_tokens": 23582,
    "input_tokens_details": {
      "text_tokens": 33,
      "image_tokens": 0,
      "reference_image_tokens": 0
    }
  },
  "created": 1784790840,
  "provider": "adobe wx",
  "upstream_model": "gpt-image-2",
  "resolution_tier": "4k"
}