Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Test a provider's dynamic token auth

POST/v1/private/llm-provider-key/auth-config/testTest a provider's dynamic token auth

Runs the token fetch once, backend-side, and reports the token lifetime. The token itself is never returned. Send provider_id to test the stored config, auth_config to test submitted values, or both to resolve secret sentinels against the stored config.

Request body

application/json
objectProviderAuthCheck
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

provider_idstring · uuid

Test the stored auth config of this provider; also the sentinel-resolution target when auth_config is sent

Example request
{
  "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"
  },
  "provider_id": "00000000-0000-0000-0000-000000000000"
}

Responses

200Token fetchedapplication/json
objectResult
currentnumber · double
namestring
previousnumber · double
Example response
{
  "current": 0,
  "name": "string",
  "previous": 0
}
400Bad Request — the token fetch itself failed (unreachable URL, rejected credentials, malformed reply)application/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"
}
422Unprocessable Content — the request is invalid (neither provider_id nor auth_config, or an invalid auth_config)application/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
Documentation menu