ai

POST /v1/ai/images/library

Generate images from a prompt, with no post involved.

所有 ai 端点

身份验证

请将 API 密钥作为 bearer 令牌发送。该密钥必须具有 links.edit 权限;缺少该权限的密钥将被拒绝并返回 403 状态码,而非 404。

您的组织 ID 应填在此处

此端点接受 org_id 作为 JSON 正文中的一个字段。

您的组织ID位于控制面板的API密钥屏幕上,就在密钥本身的旁边。这是您在每次调用时使用的相同ID。

免费试用

将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。

curl -X POST https://api.zinndigital.com/v1/ai/images/library \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "prompt": <string> }'

已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点

详细信息

Draws up to four images from the customer's own prompt and keeps them in their library for 90 days. Requires `links.edit`. ⭐ This is the door that makes image generation a product rather than a post decoration. Every other image operation needs a content post to exist first; a hosting customer who wants a hero picture for their homepage, a social card or a product shot has none and never will. Billing is the **one AI meter** — BYO key first, then Zinn® credits, then whatever the plan includes; there is no separate image SKU. ⛔ A suspended account or one with no active subscription is refused before anything is drawn (§2.46), with `AI_NOT_IN_GOOD_STANDING` rather than the top-up message: that one is fixed by settling the account, and offering a credit button there sends the customer to a screen that cannot help them. The response carries `unmet` — anything the chosen provider could not honour, in words for the customer. Nothing is silently dropped.

请求正文

名称类型必填内容简介
promptstringUsed **as written**, not rewritten into a template. The only thing added is an instruction to draw no lettering, because all three providers render garbled text when asked for w…
shapestring<wide, standard, square>⛔ A word, not a pixel pair, and that is a portability property rather than a simplification: Google takes an aspect ratio and a size *bucket* and cannot be given `1536x864`; Ope…
countinteger⛔ Bounded at 4 so one press cannot spend an unbounded amount of a customer's credit. Four is already more variations than anybody picks between.
stylestringAppended to the prompt — "photographic, muted palette".
providerAiImageProvider | string<>Leave empty to let the platform choose.
modelstringA specific `model_id` to pin, or empty to follow the provider's default.
org_idUuidUUIDv7 identifier — sortable by creation time (docs/02 §8).

响应

名称类型必填内容简介
dataGeneratedImage[]
unmetstring[]What the chosen provider could not honour, in words for the customer. ⛔ Present and empty rather than absent when everything was honoured.

此端点可能返回的错误

401 · 403 · 422 · 429