Agents

Validate Llm Connection

Changed on

Validate an LLM provider API key and model availability.

Two callable shapes:

  • Inline - raw apiKey + optional baseUrl supplied directly, for example to test a new key before saving it.
  • Saved connection - savedConnectionId references a saved LLM connection; Streamkap loads its apiKey, baseUrl and provider server-side, so the stored secret never leaves the server.

Calls the provider's free list-models endpoint to check key validity and model existence. apiKey is required unless the provider is ollama or savedConnectionId is set (422 otherwise). 404 if savedConnectionId does not match a saved connection. Per-tenant rate limit: 30 req/min -> 429 with Retry-After.

post/agents/validate-llm

Request

Request body

provider'anthropic' | 'openai' | 'openai-responses' | 'ollama' | 'azure' | 'azure-openai' | 'bedrock' | 'qwen' | 'openai-compatible' required

Unified LLM provider enum.

A single AgentLlmConnection carries one provider and a set of capabilities (chat / embedding). Each provider supports a fixed set of capabilities, validated on every write.

modelstring
apiKeystring

Raw key - never stored

baseUrlstring nullable
savedConnectionIdstring nullable

If set, Streamkap uses the provider, apiKey and baseUrl of the tenant's saved LLM connection with this id and ignores the inline apiKey / baseUrl.

Response

Successful Response

object required

Changes