Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Update LLM Provider's ApiKey

PATCH/v1/private/llm-provider-key/{id}Update LLM Provider's ApiKey

Update LLM Provider's ApiKey. api_key and auth_config are mutually exclusive: setting a valid auth_config on a provider that holds a static api_key clears the stored key; send auth_config as an empty object to clear the recipe and switch back to a static key

Parameters

idstring · uuidpathrequired

Request body

application/json
objectProviderApiKeyUpdate
api_keystring
auth_configobject

Dynamic token auth recipe. Send the '__SECRET__' sentinel as a credential value to keep the stored secret; send an empty object to clear the auth config.

Show child attributes
credentialsarray of object

Fields sent to the token URL. Values flagged as secret are write-only: they read back as the '__SECRET__' sentinel

maxItems 20 · minItems 0

Show child attributes

maxItems 20 · minItems 0

Show array items

Fields sent to the token URL. Values flagged as secret are write-only: they read back as the '__SECRET__' sentinel

keystringrequired

maxLength 250 · minLength 0

secretboolean

Secret values are encrypted at rest and never read back; once true it cannot be unset

valuestring

maxLength 2000 · minLength 0

expires_fieldstring

Field holding the token lifetime in seconds in the reply; dot-path for nested replies

maxLength 250 · minLength 0

fallback_ttl_secondsinteger · int64

Lifetime in seconds assumed when the reply doesn't state one, capped at one year; 0 disables caching for such replies. A reply-stated lifetime always wins

maximum 31536000 · minimum 0

send_asstring

How credentials are sent: form body (default), JSON body, or basic auth (id/secret in an HTTP Basic header, remaining fields in the form body)

one of "form", "json", "basic"

token_fieldstring

Field holding the token in the reply; dot-path for nested replies

maxLength 250 · minLength 0

token_urlstring

Auth service URL the credentials are sent to

base_urlstring
configurationobject
headersobject
namestring

maxLength 150 · minLength 0

provider_namestring

Provider name - can be set to migrate legacy custom LLM or Bedrock providers to the new multi-provider format. Once set, it cannot be changed. Should only be set for custom LLM and Bedrock providers.

maxLength 150 · minLength 0

Example request
{
  "api_key": "",
  "auth_config": {
    "credentials": [
      {
        "key": "string",
        "secret": "",
        "value": "string"
      }
    ],
    "expires_field": "expires_in",
    "fallback_ttl_seconds": 0,
    "send_as": "basic",
    "token_field": "access_token",
    "token_url": "https://developer.api.example.com/authentication/v1/token"
  },
  "base_url": "string",
  "configuration": {
    "additionalProp1": "string"
  },
  "headers": {
    "additionalProp1": "string"
  },
  "name": "string",
  "provider_name": "ollama"
}

Responses

204No Content
401Bad Requestapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
403Access forbiddenapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
404Not foundapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
Documentation menu