Change a backend. Leave the secret out to keep the stored one.
PUT
/admin/backends/{backendId}
const url = 'https://example.com/api/v1/admin/backends/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"kind":"openai","name":"example","secret":"example","base_url":"example","preset":"example","command":["example"],"prompt_via":"stdin"}'};
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://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" }'Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”backendId
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
kind
required
string
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
Responses
Section titled “ Responses ”The backend.
Media typeapplication/json
object
id
required
string format: uuid
kind
required
string
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"}default
Section titled “default”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"}