Create or replace an inference option
const url = 'https://api.canopyhq.dev/inferences/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"compact_at":1,"model":"example","name":"example","params":{"effort":"low","max_tokens":1,"stop":["example"],"temperature":1,"top_p":1},"provider":"example","retry":{"attempts":1,"backoff":"example"}}'};
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/inferences/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "compact_at": 1, "model": "example", "name": "example", "params": { "effort": "low", "max_tokens": 1, "stop": [ "example" ], "temperature": 1, "top_p": 1 }, "provider": "example", "retry": { "attempts": 1, "backoff": "example" } }'A preset on a provider the tenant keeps. A put under an existing name replaces the preset, and every install that consents to it follows.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The name the tenant gives the option; installs select it by this.
Request Bodyrequired
Section titled “Request Bodyrequired”A preset entering through the door: the provider it runs on, by name, and what it asks that provider for.
object
Compact before the next inference at this absolute prompt-token count; defaults to 100000.
The provider’s model slug, such as anthropic/claude-opus-5.
A readable name such as fast; defaults to the model slug.
Generation defaults a session’s dial overrides field by field.
A provider’s name within its tenant.
object
Retry.attempts: 1..=10
100ms..=1m
Responses
Section titled “Responses”The outcome is replaced or unchanged; every install that names it follows.
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 option 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; the preset may also name a provider the tenant does not keep.
No console token, or one that did not verify.
Only an owner of the tenant may configure it.