Add a model backend (REQ-100).
POST
/admin/backends
const url = 'https://example.com/api/v1/admin/backends';const options = { method: 'POST', 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 POST \ --url https://example.com/api/v1/admin/backends \ --header 'Content-Type: application/json' \ --data '{ "kind": "openai", "name": "example", "secret": "example", "base_url": "example", "preset": "example", "command": [ "example" ], "prompt_via": "stdin" }'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"}