Skip to content

Change a backend. Leave the secret out to keep the stored one.

PUT
/admin/backends/{backendId}
curl --request PUT \
--url https://example.com/api/v1/admin/backends/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Content-Type: application/json' \
--data '{ "kind": "openai", "name": "example", "secret": "example", "base_url": "example", "preset": "example", "command": [ "example" ], "prompt_via": "stdin" }'
backendId
required
string format: uuid
Media typeapplication/json
object
kind
required
string
Allowed values: openai anthropic openrouter deepseek agent_cli
name
required
string
secret

The API key. Write-only.

string
base_url

Overrides the provider’s API address.

string
preset

For agent_cli: claude, cursor-agent, opencode, pi, or custom.

string
command

For a custom agent CLI. {model}, {schema}, and {prompt_file} are replaced.

Array<string>
prompt_via
string
Allowed values: stdin file

The backend.

Media typeapplication/json
object
id
required
string format: uuid
kind
required
string
Allowed values: openai anthropic openrouter deepseek agent_cli
name
required
string
has_secret
required
boolean
secret_last4
required
string
base_url
string
preset
string
command
Array<string>
prompt_via
string
roles
required

The roles that use this backend.

Array<string>
Example
{
"kind": "openai"
}

An error.

Media typeapplication/problem+json

RFC 9457 problem details with a stable code.

object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
code
required

A stable machine-readable error code.

string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"code": "example"
}