Create or replace a provider
const url = 'https://api.canopyhq.dev/providers/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"kind":"simulated"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.canopyhq.dev/providers/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "kind": "simulated" }'The secret is sealed at this door under a name canopy mints for the provider and is never returned. A replacement without a secret keeps the one the provider holds; every preset on the provider follows the change.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A provider’s name within its tenant.
The name the tenant gives the provider; presets name it by this.
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”The provider was replaced or is unchanged.
The result of writing a named resource, without returning its value.
object
The result of applying a resource write at the door.
Example
{ "outcome": "created"}The provider now exists under this tenant.
The result of writing a named resource, without returning its value.
object
The result of applying a resource write at the door.
Example
{ "outcome": "created"}An invalid body returns an error naming the field and reason, as does a base URL that is not http or https or a new OpenRouter provider without a secret.
No console token, or one that did not verify.
Only an owner of the tenant may configure it.
Another writer changed the provider first; nothing was written.