ai
POST /v1/ai/images/credentials
Store an image-provider key for this organization.
પ્રમાણીકરણ
એપીઆઈ કી (API key) ને બેરર ટોકન તરીકે મોકલો. કી પાસે billing.manage પરવાનગી હોવી આવશ્યક છે; તેના વગરની કીને 404 ને બદલે 403 સાથે અસ્વીકાર કરવામાં આવશે.
જ્યાં તમારી સંસ્થા આઈડી જાય છે
આ એન્ડપૉઇન્ટ JSON બોડીમાં એક ફીલ્ડ તરીકે org_id લે છે.
તમારી સંસ્થાની આઈડી તમારા ડેશબોર્ડ પર API કી સ્ક્રીન પર, કી ની બાજુમાં જ છે. તે તમે કરો છો તે દરેક કૉલમાં સમાન આઈડી છે.
આયમાવો
કોઈપણ કૌંસમાં રહેલી બાબતને તમારા પોતાના મૂલ્યોથી બદલો અને કી પ્લેસહોલ્ડરને તમારા ડેશબોર્ડની કીથી બદલો.
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