跳到正文

正在自动登录…

← 返回项目列表

fujc683/gpt-image-2-6-api-gateway

模型接口转发模型切换

提供统一的OpenAI兼容API网关,通过一个密钥访问GPT Image 2.6等多个图像生成模型,支持模型切换、统一重试和计费。适用于需要集成多种图像模型、简化API管理的开发者。

AI 中文解读 · 根据仓库描述与 README 生成 · 2026/11/6 14:17:07 · 查看原文

未标注语言应用与服务
累计 Stars
64
当前热度
1 天内 · 小火
仓库创建时间
打开 GitHub ↗项目网站 ↗

选用指南

AI 根据 README 整理 · 2026/11/6 14:17:07

使用方式

通过OpenAI兼容的API端点使用,需修改base_url和model参数。

查看 README 依据
## OpenAI-compatible endpoint ```python from openai import OpenAI client = OpenAI(base_url="https://api.apimart.ai/v1", api_key="YOUR_KEY") img = client.images.generate( model="gpt-image-2.6-flare", prompt="editorial studio portrait, hard key light, grey backdrop", n=1, ) print(img.data[0].url) ``` The request shape is identical to OpenAI's `images.generate`, so existing code keeps working — only `base_url` and `model` change. ## Multi-model routing ```python MODELS = { "default": "gpt-image-2.6-flare", "quality": "gpt-image-2.6-sunburst",
部署要求

需要获取API密钥,并配置base_url为https://api.apimart.ai/v1。

查看 README 依据
## OpenAI-compatible endpoint ```python from openai import OpenAI client = OpenAI(base_url="https://api.apimart.ai/v1", api_key="YOUR_KEY") img = client.images.generate( model="gpt-image-2.6-flare", prompt="editorial studio portrait, hard key light, grey backdrop", n=1, ) print(img.data[0].url) ``` The request shape is identical to OpenAI's `images.generate`, so existing code keeps working — only `base_url` and `model` change. ## Multi-model routing ```python MODELS = { "default": "gpt-image-2.6-flare", "quality": "gpt-image-2.6-sunburst",
已知限制

异步处理,需轮询task_id;最终费用以data.cost为准。

查看 README 依据
"cheap": "z-image-turbo", "fallback": "seedream-5-0-flash", } def generate(prompt, tier="default"): try: return call(MODELS[tier], prompt) except RateLimited: return call(MODELS["fallback"], prompt) ``` ## What to watch - **Async by default** — poll `task_id`, do not block on the HTTP call - **Final cost is in `data.cost`**, not the estimate shown at submit time - **Same key across models** — no need to rotate when switching vendors --- ## Related - Prompt library: [gpt-image-2-6-prompts](https://github.com/fujc683/awesome-gpt-image-2-6-prompts)

README

正在加载 README…

收录信息

仓库创建时间
2026/11/5 17:09:44
首次达标收录
2026/11/6 14:12:14
统计更新时间
2026/11/6 14:46:10

按创建时长与累计 Stars 判断等级。首次达标收录后,即使未达当前门槛仍保留;累计 Stars 和仓库状态会定期更新。确认只有 README 及辅助文件的仓库会停止公开。

仓库信息

最近推送
2026/11/5 17:09:50
许可证标识
NOASSERTION
Fork 数
0
当前状态
未归档

收录记录

按创建时长与累计 Stars 首次收录:小火
首次发现项目