ai
POST /v1/ai/images/credentials
Store an image-provider key for this organization.
Санҷиши ҳаққоният
Kaliti API-ро ҳамчун рамзи доранда (bearer token) фиристед. Калит бояд дорои иҷозати billing.payment.manage бошад; калиди бидуни он бо хатои 403 рад карда мешавад, на 404.
Ҷое, ки рақами мушаххаси ташкилоти шумо ҷойгир аст
Ин нуқтаи поёнӣ org_id -ро ҳамчун майдон дар бадани JSON мегирад.
Rakami муайянкунандаи ташкилоти шумо дар экрани калидҳои API дар панели идоракунии шумо, дар паҳлӯи худи калид ҷойгир аст. Ин як раками муайянкунанда дар ҳар یک дархосте, ки шумо иҷро мекунед, якхела аст.
Санҷидан
Ҳар чизро дар қаavски кунҷӣ бо қиматҳои худ ва ҷойи нигоҳдорандаи калидро бо калима аз панели идоракунии худ иваз кунед.
curl -X POST https://api.zinndigital.com/v1/ai/images/credentials \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "provider": <AiImageProvider>, "api_key": <string> }'Воarid шудаед? Консоли API дар панели идоракунии шумо рақами мушаххаси ташкилоти воқеӣ ва калиди худро пур мекунад ва дархостро бар зидди API-и фаъол иҷро мекунад, то шумо посухи воқеиро бубинед. Ин нуқтаи ниҳоиро дар консоли API кушоед
Тафсилот
Puts the key in Vault and records a pointer. Any existing live key for the same provider is revoked in the same transaction. ⭐ The key is tested immediately, by generating a real image, and the result is on the response. An auth probe is green against a model id that no longer exists, so the only check worth returning is one that actually draws something. A key that does not work is still stored and still a 201 — the row records last_check_ok: false and the provider's own words in last_check_error, because "we saved it and it does not work" is the successful outcome of this request and a 4xx would leave the screen unable to say why. Requires billing.payment.manage.
Ҷисми дархост
| Ном | Намуд | Талаб карда мешавад | Ин чӣ аст |
|---|---|---|---|
provider | AiImageProvider | Бале | An image-generation provider. ⛔ Deliberately a different enum from the text provider on AiCredential: Anthropic publishes no image model and xAI publishes no text model we… |
api_key | string | Бале | The key itself. Written straight to Vault and never returned. |
label | string | Не | — |
org_id | Uuid | Не | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
Ҷавоб
| Ном | Намуд | Талаб карда мешавад | Ин чӣ аст |
|---|---|---|---|
id | Uuid | Бале | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
provider | AiImageProvider | Бале | An image-generation provider. ⛔ Deliberately a different enum from the text provider on AiCredential: Anthropic publishes no image model and xAI publishes no text model we… |
label | string | Бале | — |
verified_at | object | Не | The last time a real image generation on this key succeeded. ⛔ null means never proven, not broken. Moved only by a generation, never by a cheap auth probe: a probe proves… |
last_checked_at | object | Не | The last time any check ran, pass or fail. Separate from verified_at so "we have not looked recently" is distinguishable from "we looked and it failed". |
last_check_ok | object | Не | — |
last_check_error | string | Не | The provider's own words when the last check failed. Empty otherwise. |
broken_since | object | Не | When the key first failed after last passing, or null if it is not currently broken. ⭐ This is what makes "notify on transition to broken, never per check" possible — a key… |
last_used_at | object | Не | — |
created_at | string | Бале | — |
Хатоҳое, ки ин нуқтаи ниҳоӣ метавонад баргардонад
401 · 403 · 422 · 429