Change the default model for an existing provider key.
PATCH
/api/advisor/provider-keys/{providerId}
const url = 'https://api.tradr.cloud/api/advisor/provider-keys/claude';const options = { method: 'PATCH', headers: {'Content-Type': 'application/json'}, body: '{"defaultModel":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.tradr.cloud/api/advisor/provider-keys/claude \ --header 'Content-Type: application/json' \ --data '{ "defaultModel": "example" }'Updates ONLY the default model — the stored key material is untouched and never re-supplied, so no validation probe runs and the save rate limit does not apply. An unknown model id still fails at stream time (MODEL_NOT_LISTED), mirroring PUT.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”providerId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
defaultModel
required
string
Examplegenerated
{ "defaultModel": "example"}Responses
Section titled “Responses”The updated key (ProviderKeyListItem
Validation error.
No key configured for this provider.