Models
Verify a provider key with the provider, then store or replace it
PUT /v1/organizations/{id}/model-credentials/{provider} · SDK putModelCredential · CLI deployments model-credential set
PUT
Requires models:write.
platformBearerheader
AuthorizationBearer <token>Platform bearer credential accepted as an opaque API key or JWT.
id*stringMatch
^[0-7][0-9A-HJKMNP-TV-Z]{25}$provider*stringModel provider whose key this is.
Value in
"openai""openrouter"x-deployments-organization*stringMatch
^[0-7][0-9A-HJKMNP-TV-Z]{25}$idempotency-key*stringLength
1 <= length <= 512application/json- body
apiKey*stringThe provider API key. It is verified with the provider, then stored encrypted.
Match
^\S{8,1024}$label?stringMatch
^\S[\s\S]*\S$|^\S$|^$Length
1 <= length <= 100ModelCredentialResponse
application/json- response
createdAt*stringMatch
^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$Format
date-timecredentialId*stringMatch
^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$keyVersion*integerRange
1 <= valuelabel?stringMatch
^\S[\s\S]*\S$|^\S$|^$Length
1 <= length <= 100lastFour*stringThe last four characters of the stored key. The key itself is never returned.
provider*stringValue in
"openai""openrouter"revokedAt?stringMatch
^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$Format
date-timerevokedBy?stringMatch
^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$setAt*stringMatch
^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$Format
date-timesetBy*stringMatch
^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$status*stringValue in
"active""revoked"updatedAt*stringMatch
^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$Format
date-timeversion*integerRange
1 <= valuecurl -X PUT "https://example.com/v1/organizations/string/model-credentials/openai" \ -H "x-deployments-organization: string" \ -H "idempotency-key: string" \ -H "Content-Type: application/json" \ -d '{ "apiKey": "string" }'{ "createdAt": "2019-08-24T14:15:22Z", "credentialId": "string", "keyVersion": 1, "label": "string", "lastFour": "string", "provider": "openai", "revokedAt": "2019-08-24T14:15:22Z", "revokedBy": "string", "setAt": "2019-08-24T14:15:22Z", "setBy": "string", "status": "active", "updatedAt": "2019-08-24T14:15:22Z", "version": 1}