Skip to content

Create or replace an inference option

PUT
/inferences/{id}
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.

id
required
string

The name the tenant gives the option; installs select it by this.

Media typeapplication/json

A preset entering through the door: the provider it runs on, by name, and what it asks that provider for.

object
compact_at

Compact before the next inference at this absolute prompt-token count; defaults to 100000.

integer format: int64
model
required

The provider’s model slug, such as anthropic/claude-opus-5.

string
name

A readable name such as fast; defaults to the model slug.

string | null
params

Generation defaults a session’s dial overrides field by field.

object
effort
One of:
null
max_tokens
integer | null format: int64
stop
Array<string>
temperature
number | null format: double
top_p
number | null format: double
provider
required

A provider’s name within its tenant.

string
retry
object
attempts
required

Retry.attempts: 1..=10

integer
>= 1 <= 10
backoff
required

100ms..=1m

string

The outcome is replaced or unchanged; every install that names it follows.

Media typeapplication/json

The result of writing a named resource, without returning its value.

object
outcome
required

The result of applying a resource write at the door.

string
Allowed values: created replaced unchanged
Example
{
"outcome": "created"
}

The option now exists under this tenant.

Media typeapplication/json

The result of writing a named resource, without returning its value.

object
outcome
required

The result of applying a resource write at the door.

string
Allowed values: created replaced unchanged
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.