OneProvider

图像生成

用兼容 OpenAI 的 Images API 生成和编辑图片:从目录中选择模型,发送一次请求,读取结果并核对确切价格。

所有可用图片模型共用一套流程:选择模型、发送请求、读取响应,并了解价格。

全部模型、功能与价格 面向 AI 智能体的文档索引: https://oneprovider.dev/docs/llms.txt 从共享目录中选择模型 本指南不会固定推荐某个模型。可用的图片模型及其当前价格始终在共享模型表 中。

可用的图片模型

gemini-3.1-flash-image Runnable
0.5K
US$0.045 / 张
1K
US$0.067 / 张
2K
US$0.101 / 张
4K
US$0.151 / 张
gpt-image-2 Runnable
image input
US$8.00 / 1M token
cached image input
US$2.00 / 1M token
generated image output
US$30.00 / 1M token
1024x1024 · 1024x1536 · 1536x1024 · low · medium · high · auto gpt-image-2.5 Runnable
image input
US$8.00 / 1M token
cached image input
US$2.00 / 1M token
generated image output
US$30.00 / 1M token
low · medium · high · xhigh · max · auto gpt-image-2.5-flare Runnable
image input
US$8.00 / 1M token
cached image input
US$2.00 / 1M token
generated image output
US$30.00 / 1M token
low · medium · high · xhigh · max · auto gpt-image-2.5-sunburst Runnable
image input
US$8.00 / 1M token
cached image input
US$2.00 / 1M token
generated image output
US$30.00 / 1M token
low · medium · high · xhigh · max · auto gpt-image-2.6-flare Runnable
image input
US$8.00 / 1M token
cached image input
US$2.00 / 1M token
generated image output
US$30.00 / 1M token
low · medium · high · xhigh · max · auto gpt-image-2.6-sunburst Runnable
image input
US$8.00 / 1M token
cached image input
US$2.00 / 1M token
generated image output
US$30.00 / 1M token
low · medium · high · xhigh · max · auto grok-imagine 目录
per generation request
US$0.02 / 张
grok-imagine-image Runnable
per generated image
US$0.02 / 张
grok-imagine-image-2.0 Runnable
1K
US$0.06 / 张
2K
US$0.08 / 张
1K · 2K · low · medium grok-imagine-image-lite Runnable
per generated image
US$0.025 / 张
gemini-3-pro-image 目录
image input
US$2.00 / 1M token
generated image output
US$120.00 / 1M token
gemini-3-pro-image-preview 目录
image input
US$2.00 / 1M token
generated image output
US$120.00 / 1M token
gemini-3.1-flash-image-preview 目录
image input
US$0.50 / 1M token
generated image output
US$60.00 / 1M token

请求

POST /v1/images/generations。路径和可选参数来自所选模型经过验证的接口规范。

bash
curl -sS https://api.oneprovider.dev/v1/images/generations \
-H "Authorization: Bearer $ONEPROVIDER_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A quiet observatory above the clouds",
"size": "1024x1024",
"quality": "low"
}'

不同模型的能力各不相同

尺寸、质量等级、透明度、编辑和响应格式都因模型而异。未确认是否支持之前,请不要把一个模型的可选参数照搬到另一个模型上。

响应

同步方式会立即返回图片数据或 URL。异步方式会返回任务 id;请轮询它的状态路径,再从它的内容路径下载。

价格

共享模型表把每种 token 费率分列显示,按张计费或其他媒体计费则显示在“媒体”列。打开价格页 。

快速解答

该使用哪个 base URL?

Claude Code 和 Anthropic SDK 使用 https://api.oneprovider.dev。OpenAI SDK 和兼容 OpenAI 的客户端使用 https://api.oneprovider.dev/v1。同一个密钥可用于这两个地址;模型列表见模型页面 ,费率见价格页面 。

如何进行身份验证?

将完整的 sk-… 密钥放在 x-api-key 或 Authorization: Bearer 中,二选一,不要同时使用。请把密钥存放在环境变量中,不要写进会被提交的文件。了解更多身份验证说明 。

在哪里获取密钥?

在 Telegram 机器人 @oneprovider_robot 或 app.oneprovider.dev 打开您的个人中心,为余额充值,然后点击“签发密钥”。每个密钥都可以设置各自的消费限额。个人中心与 API 密钥 。

401、404 和 429 是什么意思?

401:密钥缺失、拼写有误或放错了请求头;请粘贴完整的密钥,不要带引号或空格。404:通常是 base URL 不对,例如缺少或重复了 /v1。429 且提示“Insufficient balance”:个人中心余额或密钥的消费限额已用完,请充值,不要反复重试;其他 429 属于速率限制,请等待 Retry-After 指定的时间。详情见:错误码 和故障排查 。

流式输出为什么会中断或被重置?

VPN 和 VLESS 代理常常会缓冲 SSE,或破坏 HTTP/2 协商。OneProvider 没有地区限制,也不会缓冲流式输出,请关闭代理后重试。

以上都没解决,该去哪里咨询?

请在 Telegram 联系 @Oneproviderhelpbot ,或在网页个人中心打开“客服”,并附上 HTTP 状态码和完整的错误信息。客服如何运作 。

最后更新: 2026-11-08 发现问题? @Oneproviderhelpbot