ai

POST /v1/ai/images/credentials

Store an image-provider key for this organization.

Sve ai krajnje tačke

Autentifikacija

Pošaljite API ključ kao bearer token. Ključ mora imati dozvolu billing.manage; ključ bez nje se odbija sa 403, a ne sa 404.

Gde ide ID vaše organizacije

Ova krajnja tačka prihvata org_id kao polje u JSON telu.

ID vaše organizacije nalazi se na ekranu sa API ključevima u vašoj kontrolnoj tabli, pored samog ključa. To je isti ID u svakom pozivu koji uputite.

Isprobajte

Zamenite bilo šta u uglastim zagradama sopstvenim vrednostima, a ključni placeholder sa ključem sa vaše kontrolne table.

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> }'

Prijavljeni ste? API konzola na vašoj kontrolnoj tabli automatski popunjava ID vaše stvarne organizacije i vaš sopstveni ključ, i izvršava zahtev nad API-jem uživo tako da možete videti stvarni odgovor. Otvorite ovu krajnju tačku u API konzoli

Detalji

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`.

Telo zahteva

NazivVrstaObaveznoŠta je ovo
providerAiImageProviderDaAn 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_keystringDaThe key itself. Written straight to Vault and never returned.
labelstringNe
org_idUuidNeUUIDv7 identifier — sortable by creation time (docs/02 §8).

Odgovor

NazivVrstaObaveznoŠta je ovo
idUuidDaUUIDv7 identifier — sortable by creation time (docs/02 §8).
providerAiImageProviderDaAn 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…
labelstringDa
verified_atobjectNeThe 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_atobjectNeThe 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_okobjectNe
last_check_errorstringNeThe provider's own words when the last check failed. Empty otherwise.
broken_sinceobjectNeWhen 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_atobjectNe
created_atstringDa

Greške koje ovaj krajnji tačka može da vrati

401 · 403 · 422 · 429