Skip to main content
POST
Validate Llm Connection

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for POST /agents/validate-llm.

Two callable shapes:

  1. Inline - apiKey (+ optional baseUrl) supplied directly. Used when the user is pasting a fresh key in the form.
  2. Saved connection - savedConnectionId references a row in agent_connections.llmConnections. The BE loads the decrypted apiKey / baseUrl server-side so the browser never has to hold (or re-send) a stored plaintext to test it. Mirrors the MCP savedConnectionId discovery path.
provider
enum<string>
required

Unified LLM provider enum.

A single AgentLlmConnection row carries one provider and a set of capabilities (chat / embedding). PROVIDER_CAPABILITIES below pins which capabilities each provider can serve — picked by the FE Connections drawer and re-validated server-side on every write.

Available options:
anthropic,
openai,
openai-responses,
ollama,
azure,
azure-openai,
bedrock,
qwen,
openai-compatible
model
string
default:""
Maximum string length: 200
apiKey
string
default:""

Raw key - never stored

Maximum string length: 512
baseUrl
string | null
Maximum string length: 512
savedConnectionId
string | null

If set, BE resolves provider/apiKey/baseUrl from the tenant's saved llmConnection by id and ignores the inline apiKey / baseUrl.

Maximum string length: 100

Response

Successful Response

The response is of type Response Validatellmconnection · object.