curl --request POST \
--url https://api.streamkap.com/agents/validate-llm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "",
"apiKey": "",
"baseUrl": "<string>",
"savedConnectionId": "<string>"
}
'import requests
url = "https://api.streamkap.com/agents/validate-llm"
payload = {
"model": "",
"apiKey": "",
"baseUrl": "<string>",
"savedConnectionId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: '', apiKey: '', baseUrl: '<string>', savedConnectionId: '<string>'})
};
fetch('https://api.streamkap.com/agents/validate-llm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.streamkap.com/agents/validate-llm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '',
'apiKey' => '',
'baseUrl' => '<string>',
'savedConnectionId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.streamkap.com/agents/validate-llm"
payload := strings.NewReader("{\n \"model\": \"\",\n \"apiKey\": \"\",\n \"baseUrl\": \"<string>\",\n \"savedConnectionId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.streamkap.com/agents/validate-llm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"\",\n \"apiKey\": \"\",\n \"baseUrl\": \"<string>\",\n \"savedConnectionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.streamkap.com/agents/validate-llm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"\",\n \"apiKey\": \"\",\n \"baseUrl\": \"<string>\",\n \"savedConnectionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Validate Llm Connection
Validate an LLM provider API key and model availability.
Two callable shapes:
- Inline - raw
apiKey+ optionalbaseUrlsupplied directly. Used when the user is pasting a fresh key in the form. - Saved connection -
savedConnectionIdreferences a storedllmConnection; BE loads the decryptedapiKey+baseUrl+providerserver-side so the browser never holds the plaintext.
Calls the provider’s free list-models endpoint to check key validity
and model existence. The “apiKey required unless ollama or saved” rule
is enforced by the request model’s @model_validator.
Per-tenant rate limit: 30 req/min/bucket -> 429 with Retry-After.
curl --request POST \
--url https://api.streamkap.com/agents/validate-llm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "",
"apiKey": "",
"baseUrl": "<string>",
"savedConnectionId": "<string>"
}
'import requests
url = "https://api.streamkap.com/agents/validate-llm"
payload = {
"model": "",
"apiKey": "",
"baseUrl": "<string>",
"savedConnectionId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: '', apiKey: '', baseUrl: '<string>', savedConnectionId: '<string>'})
};
fetch('https://api.streamkap.com/agents/validate-llm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.streamkap.com/agents/validate-llm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '',
'apiKey' => '',
'baseUrl' => '<string>',
'savedConnectionId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.streamkap.com/agents/validate-llm"
payload := strings.NewReader("{\n \"model\": \"\",\n \"apiKey\": \"\",\n \"baseUrl\": \"<string>\",\n \"savedConnectionId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.streamkap.com/agents/validate-llm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"\",\n \"apiKey\": \"\",\n \"baseUrl\": \"<string>\",\n \"savedConnectionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.streamkap.com/agents/validate-llm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"\",\n \"apiKey\": \"\",\n \"baseUrl\": \"<string>\",\n \"savedConnectionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request body for POST /agents/validate-llm.
Two callable shapes:
- Inline -
apiKey(+ optionalbaseUrl) supplied directly. Used when the user is pasting a fresh key in the form. - Saved connection -
savedConnectionIdreferences a row inagent_connections.llmConnections. The BE loads the decryptedapiKey/baseUrlserver-side so the browser never has to hold (or re-send) a stored plaintext to test it. Mirrors the MCPsavedConnectionIddiscovery path.
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.
anthropic, openai, openai-responses, ollama, azure, azure-openai, bedrock, qwen, openai-compatible 200Raw key - never stored
512512If set, BE resolves provider/apiKey/baseUrl from the tenant's saved llmConnection by id and ignores the inline apiKey / baseUrl.
100Response
Successful Response
The response is of type Response Validatellmconnection · object.
Was this page helpful?