ai
POST /v1/ai/images/credentials
Store an image-provider key for this organization.
ການພິສູດຕົວຕົນ
ສົ່ງລະຫັດ API ເປັນ bearer token. ລະຫັດຕ້ອງມີສິດ billing.manage; ລະຫັດທີ່ບໍ່ມີສິດດັ່ງກ່າວຈະຖືກປະຕິເສດດ້ວຍລະຫັດ 403, ບໍ່ແມ່ນ 404.
ບ່ອນທີ່ລະບົບຈັດການອົງກອນຂອງທ່ານໄປ
ຈຸດສິ້ນສຸດນີ້ຮັບເອົາ org_id ເປັນຊ່ອງຂໍ້ມູນໃນ JSON body.
ລະຫັດອົງກອນຂອງທ່ານແມ່ນຢູ່ໜ້າກະແຈ API ໃນແຜງຄວບຄຸມຂອງທ່ານ, ຖັດຈາກກະແຈ itself. ມັນແມ່ນລະຫັດດຽວກັນໃນທຸກໆການໂທທີ່ທ່ານເຮັດ.
ລອງໃຊ້ເບິ່ງ
ປ່ຽນແທນທຸກຢ່າງທີ່ຢູ່ໃນວົງເລັບມຸມດ້ວຍຄ່າຂອງທ່ານເອງ, ແລະ ປ່ຽນແທນຕົວແທນບ່ອນວ່າງຄີດ້ວຍຄີຈາກແຜງຄວບຄຸມຂອງທ່ານ.
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> }'ເຂົ້າສູ່ລະບົບແລ້ວບໍ? ໂຄງສົນທະນາ 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.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 u… |
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 u… |
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 br… |
last_used_at | object | ບໍ່ | — |
created_at | string | ແມ່ນແລ້ວ | — |
ຂໍ້ຜິດພາດທີ່ຈຸດເຊື່ອມຕໍ່ນີ້ສາມາດສົ່ງຄືນໄດ້
401 · 403 · 422 · 429