Skip to main content
POST
Generation submission placeholder / 生成提交预览
当前为 API 预览。生成接口尚未接入供应商,成功认证后仍可能返回 503;不会创建任务或扣积分。

先了解当前预览

APIstable 分两步建设:先完成网站、账户与执行架构,再接入真实模型供应商。当前模型目录与价格用于展示接口约定,不代表付费推理已经可用。 本页示例说明 API 预览契约。渠道未启用时,应返回供应商尚未配置的错误。复制代码不会执行请求或扣积分。 查看模型目录

当前版本的实际行为

OpenAPI JSON LLM 可读文档

1. 创建 API 密钥

登录后进入控制台 → API Keys。创建时立即保存完整密钥,它只显示一次。建议每个应用或环境使用独立密钥。
将示例域名替换为实际部署地址。密钥只放在服务端环境变量中,不能写入浏览器代码、URL 或公开仓库。
管理 API 密钥

2. 估价并提交

选择精确 Model ID 并校验输入。报价展示合格的低价/官方渠道、每个结果的价格与整次最高冻结积分。API 客户端可以不单独请求报价,但服务端仍会计算并校验价格。 图片和视频使用 output_count 创建 1–4 个结果项。fallback 默认关闭;开启后,每项在明确可回退失败时可独立尝试官方渠道。 创建任务 了解积分

3. 保存任务 ID

媒体请求受理后返回 HTTP 202 和稳定的 task_id。保存 ID 并查询原任务,不要再次盲目提交。网络超时不能证明供应商未受理。
  • 合理间隔轮询并遵守 Retry-After。queued、running、falling_back、reconciliation_required 均不是终态。
  • 逐项读取结果;即使其他项尚未结束,也可获取已成功项。在 expires_at 前下载文件。
  • 通知失败不改变已完成生成,也不能导致再次扣费。
查询任务

授权

Authorization
string
header
必填

API key beginning as_. Keep on the server. Scope permissions are checked separately.

请求头

Idempotency-Key
string

Reserved for live acceptance. No task is currently created or deduplicated by this header.

请求体

application/json
model
string
必填
Minimum string length: 1
示例:

"prism-image-2"

input
object
必填

Current preview input. Supported fields vary by modality and exact catalog model. No live provider mapping is implied.

output_count
integer
默认值:1

Target result count. Images/videos accept 1–4; music and LLM must remain 1. Not a concurrency guarantee. / 目标结果数,非同时并发保证。

必填范围: 1 <= x <= 4
fallback
boolean
默认值:false

Authorizes a higher-priced compatible official fallback after an eligible confirmed failure. Live execution is disabled in this build.

max_credits
integer

Whole-request reservation cap. Reject the entire request when max_reserved_credits exceeds it.

必填范围: x >= 0

响应

Invalid or unsupported input

error
object
必填