curl --request POST \
--url https://api.streamkap.com/agents/system-prompt-suggestion \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentType": "<string>",
"model": "",
"apiKey": "",
"baseUrl": "<string>",
"savedConnectionId": "<string>",
"agentName": "<string>",
"description": "<string>",
"inputTopics": [
"<string>"
],
"selectedFields": [
"<string>"
],
"tools": [
{
"name": "<string>",
"description": ""
}
],
"outputSchema": [
{
"name": "<string>",
"type": "<string>"
}
],
"filterSQL": "<string>",
"existingCustomInstructions": "<string>",
"generationHint": "<string>"
}
'import requests
url = "https://api.streamkap.com/agents/system-prompt-suggestion"
payload = {
"agentType": "<string>",
"model": "",
"apiKey": "",
"baseUrl": "<string>",
"savedConnectionId": "<string>",
"agentName": "<string>",
"description": "<string>",
"inputTopics": ["<string>"],
"selectedFields": ["<string>"],
"tools": [
{
"name": "<string>",
"description": ""
}
],
"outputSchema": [
{
"name": "<string>",
"type": "<string>"
}
],
"filterSQL": "<string>",
"existingCustomInstructions": "<string>",
"generationHint": "<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({
agentType: '<string>',
model: '',
apiKey: '',
baseUrl: '<string>',
savedConnectionId: '<string>',
agentName: '<string>',
description: '<string>',
inputTopics: ['<string>'],
selectedFields: ['<string>'],
tools: [{name: '<string>', description: ''}],
outputSchema: [{name: '<string>', type: '<string>'}],
filterSQL: '<string>',
existingCustomInstructions: '<string>',
generationHint: '<string>'
})
};
fetch('https://api.streamkap.com/agents/system-prompt-suggestion', 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/system-prompt-suggestion",
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([
'agentType' => '<string>',
'model' => '',
'apiKey' => '',
'baseUrl' => '<string>',
'savedConnectionId' => '<string>',
'agentName' => '<string>',
'description' => '<string>',
'inputTopics' => [
'<string>'
],
'selectedFields' => [
'<string>'
],
'tools' => [
[
'name' => '<string>',
'description' => ''
]
],
'outputSchema' => [
[
'name' => '<string>',
'type' => '<string>'
]
],
'filterSQL' => '<string>',
'existingCustomInstructions' => '<string>',
'generationHint' => '<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/system-prompt-suggestion"
payload := strings.NewReader("{\n \"agentType\": \"<string>\",\n \"model\": \"\",\n \"apiKey\": \"\",\n \"baseUrl\": \"<string>\",\n \"savedConnectionId\": \"<string>\",\n \"agentName\": \"<string>\",\n \"description\": \"<string>\",\n \"inputTopics\": [\n \"<string>\"\n ],\n \"selectedFields\": [\n \"<string>\"\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\"\n }\n ],\n \"outputSchema\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"filterSQL\": \"<string>\",\n \"existingCustomInstructions\": \"<string>\",\n \"generationHint\": \"<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/system-prompt-suggestion")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentType\": \"<string>\",\n \"model\": \"\",\n \"apiKey\": \"\",\n \"baseUrl\": \"<string>\",\n \"savedConnectionId\": \"<string>\",\n \"agentName\": \"<string>\",\n \"description\": \"<string>\",\n \"inputTopics\": [\n \"<string>\"\n ],\n \"selectedFields\": [\n \"<string>\"\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\"\n }\n ],\n \"outputSchema\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"filterSQL\": \"<string>\",\n \"existingCustomInstructions\": \"<string>\",\n \"generationHint\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.streamkap.com/agents/system-prompt-suggestion")
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 \"agentType\": \"<string>\",\n \"model\": \"\",\n \"apiKey\": \"\",\n \"baseUrl\": \"<string>\",\n \"savedConnectionId\": \"<string>\",\n \"agentName\": \"<string>\",\n \"description\": \"<string>\",\n \"inputTopics\": [\n \"<string>\"\n ],\n \"selectedFields\": [\n \"<string>\"\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\"\n }\n ],\n \"outputSchema\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"filterSQL\": \"<string>\",\n \"existingCustomInstructions\": \"<string>\",\n \"generationHint\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"generatedPrompt": "<string>",
"tokensIn": 123,
"tokensOut": 123,
"model": "<string>",
"provider": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Suggest Agent System Prompt
Generate a starter customInstructions block for the wizard.
Same two credential shapes as /agents/validate-llm:
- Inline - raw
apiKey(+ optionalbaseUrl) supplied directly. - Saved connection -
savedConnectionIdreferences a storedllmConnection; BE loads decryptedapiKey/baseUrl/providerserver-side so the browser never holds the plaintext.
Composes a meta-system-prompt + a structured user message describing
the agent (type, name, description, topics, fields, tools, output
schema, optional existing draft) and calls the user’s own LLM. The
runtime build_system_prompt already emits the per-agentType base
template + schema field listing + tool signatures at deploy time, so
the LLM is constrained to produce only the user-facing instructions
slot - the meta-prompt enforces that explicitly. Nothing is persisted.
Per-tenant rate limit: dedicated BUCKET_PROMPT_SUGGEST bucket
(30/min/tenant) separate from validate-llm, so heavy “Generate”
usage (humans iterating on prompt drafts) doesn’t eat into the
credential-check budget. Provider failures (timeouts, 4xx, schema
errors) surface as 400 with the provider’s error message so the FE’s
existing error-extraction works unchanged.
curl --request POST \
--url https://api.streamkap.com/agents/system-prompt-suggestion \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentType": "<string>",
"model": "",
"apiKey": "",
"baseUrl": "<string>",
"savedConnectionId": "<string>",
"agentName": "<string>",
"description": "<string>",
"inputTopics": [
"<string>"
],
"selectedFields": [
"<string>"
],
"tools": [
{
"name": "<string>",
"description": ""
}
],
"outputSchema": [
{
"name": "<string>",
"type": "<string>"
}
],
"filterSQL": "<string>",
"existingCustomInstructions": "<string>",
"generationHint": "<string>"
}
'import requests
url = "https://api.streamkap.com/agents/system-prompt-suggestion"
payload = {
"agentType": "<string>",
"model": "",
"apiKey": "",
"baseUrl": "<string>",
"savedConnectionId": "<string>",
"agentName": "<string>",
"description": "<string>",
"inputTopics": ["<string>"],
"selectedFields": ["<string>"],
"tools": [
{
"name": "<string>",
"description": ""
}
],
"outputSchema": [
{
"name": "<string>",
"type": "<string>"
}
],
"filterSQL": "<string>",
"existingCustomInstructions": "<string>",
"generationHint": "<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({
agentType: '<string>',
model: '',
apiKey: '',
baseUrl: '<string>',
savedConnectionId: '<string>',
agentName: '<string>',
description: '<string>',
inputTopics: ['<string>'],
selectedFields: ['<string>'],
tools: [{name: '<string>', description: ''}],
outputSchema: [{name: '<string>', type: '<string>'}],
filterSQL: '<string>',
existingCustomInstructions: '<string>',
generationHint: '<string>'
})
};
fetch('https://api.streamkap.com/agents/system-prompt-suggestion', 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/system-prompt-suggestion",
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([
'agentType' => '<string>',
'model' => '',
'apiKey' => '',
'baseUrl' => '<string>',
'savedConnectionId' => '<string>',
'agentName' => '<string>',
'description' => '<string>',
'inputTopics' => [
'<string>'
],
'selectedFields' => [
'<string>'
],
'tools' => [
[
'name' => '<string>',
'description' => ''
]
],
'outputSchema' => [
[
'name' => '<string>',
'type' => '<string>'
]
],
'filterSQL' => '<string>',
'existingCustomInstructions' => '<string>',
'generationHint' => '<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/system-prompt-suggestion"
payload := strings.NewReader("{\n \"agentType\": \"<string>\",\n \"model\": \"\",\n \"apiKey\": \"\",\n \"baseUrl\": \"<string>\",\n \"savedConnectionId\": \"<string>\",\n \"agentName\": \"<string>\",\n \"description\": \"<string>\",\n \"inputTopics\": [\n \"<string>\"\n ],\n \"selectedFields\": [\n \"<string>\"\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\"\n }\n ],\n \"outputSchema\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"filterSQL\": \"<string>\",\n \"existingCustomInstructions\": \"<string>\",\n \"generationHint\": \"<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/system-prompt-suggestion")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentType\": \"<string>\",\n \"model\": \"\",\n \"apiKey\": \"\",\n \"baseUrl\": \"<string>\",\n \"savedConnectionId\": \"<string>\",\n \"agentName\": \"<string>\",\n \"description\": \"<string>\",\n \"inputTopics\": [\n \"<string>\"\n ],\n \"selectedFields\": [\n \"<string>\"\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\"\n }\n ],\n \"outputSchema\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"filterSQL\": \"<string>\",\n \"existingCustomInstructions\": \"<string>\",\n \"generationHint\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.streamkap.com/agents/system-prompt-suggestion")
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 \"agentType\": \"<string>\",\n \"model\": \"\",\n \"apiKey\": \"\",\n \"baseUrl\": \"<string>\",\n \"savedConnectionId\": \"<string>\",\n \"agentName\": \"<string>\",\n \"description\": \"<string>\",\n \"inputTopics\": [\n \"<string>\"\n ],\n \"selectedFields\": [\n \"<string>\"\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\"\n }\n ],\n \"outputSchema\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"filterSQL\": \"<string>\",\n \"existingCustomInstructions\": \"<string>\",\n \"generationHint\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"generatedPrompt": "<string>",
"tokensIn": 123,
"tokensOut": 123,
"model": "<string>",
"provider": "<string>"
}{
"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/system-prompt-suggestion.
Mirrors ValidateLlmRequest for the credential half (inline apiKey or
savedConnectionId, with the same XOR rule) and adds the agent-context
fields the meta-prompt needs to draft a starter customInstructions
block. The runtime build_system_prompt already injects the per-agentType
base template, schema field listing, and tool signatures - so the LLM is
asked to produce only the user-facing instructions slot, never the
boilerplate wrapper. See app.services.agent_prompt_suggester for the
meta-prompt that enforces that.
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 Agent type (e.g. react, workflow)
1 - 50200Raw key - never stored
512512If set, BE resolves provider/apiKey/baseUrl from the tenant's saved llmConnection by id and ignores the inline apiKey / baseUrl.
1001005002050Tool name + description list. Replaces the older toolNames-only shape.
50Show child attributes
Show child attributes
50Show child attributes
Show child attributes
Active record-filter (matches AgentInputConfig.filterSQL). Anchors the LLM's prompt to the actual shape of records reaching the agent.
4000Existing draft to refine. Matches the FE textarea cap.
8000Optional one-line steer the user types into the wizard's 'Hint for AI' input. The meta-prompt already gets the agent's metadata, so this should carry use-case intent (tone, edge-case priority, what to emphasize) rather than restate the data shape.
500Response
Successful Response
Response body for POST /agents/system-prompt-suggestion.
Token counts come straight from the provider's usage block (zeroed
when the provider didn't return one). model / provider echo back
the resolved values so the FE can display "generated with anthropic /
claude-sonnet-4-5" alongside the suggestion.
Was this page helpful?