Generate scenarios (streaming)
curl --request POST \
--url https://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream \
--header 'Content-Type: application/json' \
--cookie session= \
--data '
{
"agent_config": {
"system_prompt": "<string>",
"tone": "",
"tools": [],
"memory": ""
},
"scenario_count": 500,
"model_config_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"include_multi_turn": false,
"org_slug": "<string>",
"project_slug": "<string>"
}
'import requests
url = "https://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream"
payload = {
"agent_config": {
"system_prompt": "<string>",
"tone": "",
"tools": [],
"memory": ""
},
"scenario_count": 500,
"model_config_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"include_multi_turn": False,
"org_slug": "<string>",
"project_slug": "<string>"
}
headers = {
"cookie": "session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_config: {system_prompt: '<string>', tone: '', tools: [], memory: ''},
scenario_count: 500,
model_config_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
include_multi_turn: false,
org_slug: '<string>',
project_slug: '<string>'
})
};
fetch('https://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream', 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://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream",
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([
'agent_config' => [
'system_prompt' => '<string>',
'tone' => '',
'tools' => [
],
'memory' => ''
],
'scenario_count' => 500,
'model_config_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'include_multi_turn' => false,
'org_slug' => '<string>',
'project_slug' => '<string>'
]),
CURLOPT_COOKIE => "session=",
CURLOPT_HTTPHEADER => [
"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://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream"
payload := strings.NewReader("{\n \"agent_config\": {\n \"system_prompt\": \"<string>\",\n \"tone\": \"\",\n \"tools\": [],\n \"memory\": \"\"\n },\n \"scenario_count\": 500,\n \"model_config_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"include_multi_turn\": false,\n \"org_slug\": \"<string>\",\n \"project_slug\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "session=")
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://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream")
.header("cookie", "session=")
.header("Content-Type", "application/json")
.body("{\n \"agent_config\": {\n \"system_prompt\": \"<string>\",\n \"tone\": \"\",\n \"tools\": [],\n \"memory\": \"\"\n },\n \"scenario_count\": 500,\n \"model_config_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"include_multi_turn\": false,\n \"org_slug\": \"<string>\",\n \"project_slug\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_config\": {\n \"system_prompt\": \"<string>\",\n \"tone\": \"\",\n \"tools\": [],\n \"memory\": \"\"\n },\n \"scenario_count\": 500,\n \"model_config_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"include_multi_turn\": false,\n \"org_slug\": \"<string>\",\n \"project_slug\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"{\"type\":\"run\",\"run_id\":\"…\",\"estimate\":{},\"requested\":10}\n{\"type\":\"scenarios\",\"scenarios\":[]}\n{\"type\":\"done\",\"run_id\":\"…\",\"scenario_count\":10,\"partial_failures\":[],\"model_generation_error\":null}\n"{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}Generate scenarios (streaming)
Same as Generate scenarios, but streams newline-delimited JSON events as scenarios are produced:
{"type":"run","run_id","estimate","requested"}{"type":"scenarios","scenarios":[...]}(repeated){"type":"done","run_id","scenario_count","partial_failures","model_generation_error"}{"type":"error","message"}{"type":"ping"}heartbeat every 10 seconds
Auth and validation errors are returned as normal JSON errors before the stream starts. Can run for up to 800 seconds.
Auth: session. Permission: run_agents or manage_agents.
POST
/
projects
/
{projectId}
/
cost-calculator
/
generate-scenarios
/
stream
Generate scenarios (streaming)
curl --request POST \
--url https://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream \
--header 'Content-Type: application/json' \
--cookie session= \
--data '
{
"agent_config": {
"system_prompt": "<string>",
"tone": "",
"tools": [],
"memory": ""
},
"scenario_count": 500,
"model_config_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"include_multi_turn": false,
"org_slug": "<string>",
"project_slug": "<string>"
}
'import requests
url = "https://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream"
payload = {
"agent_config": {
"system_prompt": "<string>",
"tone": "",
"tools": [],
"memory": ""
},
"scenario_count": 500,
"model_config_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"include_multi_turn": False,
"org_slug": "<string>",
"project_slug": "<string>"
}
headers = {
"cookie": "session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_config: {system_prompt: '<string>', tone: '', tools: [], memory: ''},
scenario_count: 500,
model_config_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
include_multi_turn: false,
org_slug: '<string>',
project_slug: '<string>'
})
};
fetch('https://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream', 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://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream",
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([
'agent_config' => [
'system_prompt' => '<string>',
'tone' => '',
'tools' => [
],
'memory' => ''
],
'scenario_count' => 500,
'model_config_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'include_multi_turn' => false,
'org_slug' => '<string>',
'project_slug' => '<string>'
]),
CURLOPT_COOKIE => "session=",
CURLOPT_HTTPHEADER => [
"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://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream"
payload := strings.NewReader("{\n \"agent_config\": {\n \"system_prompt\": \"<string>\",\n \"tone\": \"\",\n \"tools\": [],\n \"memory\": \"\"\n },\n \"scenario_count\": 500,\n \"model_config_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"include_multi_turn\": false,\n \"org_slug\": \"<string>\",\n \"project_slug\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "session=")
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://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream")
.header("cookie", "session=")
.header("Content-Type", "application/json")
.body("{\n \"agent_config\": {\n \"system_prompt\": \"<string>\",\n \"tone\": \"\",\n \"tools\": [],\n \"memory\": \"\"\n },\n \"scenario_count\": 500,\n \"model_config_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"include_multi_turn\": false,\n \"org_slug\": \"<string>\",\n \"project_slug\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pillarforge.corepillar.ai/api/v1/projects/{projectId}/cost-calculator/generate-scenarios/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_config\": {\n \"system_prompt\": \"<string>\",\n \"tone\": \"\",\n \"tools\": [],\n \"memory\": \"\"\n },\n \"scenario_count\": 500,\n \"model_config_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"include_multi_turn\": false,\n \"org_slug\": \"<string>\",\n \"project_slug\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"{\"type\":\"run\",\"run_id\":\"…\",\"estimate\":{},\"requested\":10}\n{\"type\":\"scenarios\",\"scenarios\":[]}\n{\"type\":\"done\",\"run_id\":\"…\",\"scenario_count\":10,\"partial_failures\":[],\"model_generation_error\":null}\n"{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}Authorizations
The session cookie set when you sign in to AgentHub or ModelHub in a browser. The cookie name shown here is illustrative. There are no API tokens for these endpoints.
Path Parameters
Project id.
Body
application/json
The agent the Cost Calculator simulates.
Show child attributes
Show child attributes
Required range:
1 <= x <= 1000Used only to refresh the Cost Calculator page afterwards.
Maximum string length:
200Used only to refresh the Cost Calculator page afterwards.
Maximum string length:
200Response
Event stream.
One JSON object per line.