Execute BRK
curl --request POST \
--url https://api.example.com/execute_brx \
--header 'Content-Type: application/json' \
--data '
{
"brxId": "<string>",
"schemaValues": {},
"executionOptions": {
"maxTokens": 123,
"temperature": 123,
"topP": 123,
"model": "<string>",
"stream": true
}
}
'import requests
url = "https://api.example.com/execute_brx"
payload = {
"brxId": "<string>",
"schemaValues": {},
"executionOptions": {
"maxTokens": 123,
"temperature": 123,
"topP": 123,
"model": "<string>",
"stream": True
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
brxId: '<string>',
schemaValues: {},
executionOptions: {maxTokens: 123, temperature: 123, topP: 123, model: '<string>', stream: true}
})
};
fetch('https://api.example.com/execute_brx', 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.example.com/execute_brx",
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([
'brxId' => '<string>',
'schemaValues' => [
],
'executionOptions' => [
'maxTokens' => 123,
'temperature' => 123,
'topP' => 123,
'model' => '<string>',
'stream' => true
]
]),
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://api.example.com/execute_brx"
payload := strings.NewReader("{\n \"brxId\": \"<string>\",\n \"schemaValues\": {},\n \"executionOptions\": {\n \"maxTokens\": 123,\n \"temperature\": 123,\n \"topP\": 123,\n \"model\": \"<string>\",\n \"stream\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/execute_brx")
.header("Content-Type", "application/json")
.body("{\n \"brxId\": \"<string>\",\n \"schemaValues\": {},\n \"executionOptions\": {\n \"maxTokens\": 123,\n \"temperature\": 123,\n \"topP\": 123,\n \"model\": \"<string>\",\n \"stream\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/execute_brx")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"brxId\": \"<string>\",\n \"schemaValues\": {},\n \"executionOptions\": {\n \"maxTokens\": 123,\n \"temperature\": 123,\n \"topP\": 123,\n \"model\": \"<string>\",\n \"stream\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"400": {},
"401": {},
"403": {},
"404": {},
"429": {},
"500": {},
"executeBrxResponse": {
"httpResponse": {
"isError": true,
"statusMsg": "<string>",
"result": "<string>",
"executionId": "<string>",
"executionTime": 123,
"tokenUsage": {
"prompt": 123,
"completion": 123,
"total": 123
}
}
}
}BRK Execution
Execute BRK
Executes a BRK with the provided input values
POST
/
execute_brx
Execute BRK
curl --request POST \
--url https://api.example.com/execute_brx \
--header 'Content-Type: application/json' \
--data '
{
"brxId": "<string>",
"schemaValues": {},
"executionOptions": {
"maxTokens": 123,
"temperature": 123,
"topP": 123,
"model": "<string>",
"stream": true
}
}
'import requests
url = "https://api.example.com/execute_brx"
payload = {
"brxId": "<string>",
"schemaValues": {},
"executionOptions": {
"maxTokens": 123,
"temperature": 123,
"topP": 123,
"model": "<string>",
"stream": True
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
brxId: '<string>',
schemaValues: {},
executionOptions: {maxTokens: 123, temperature: 123, topP: 123, model: '<string>', stream: true}
})
};
fetch('https://api.example.com/execute_brx', 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.example.com/execute_brx",
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([
'brxId' => '<string>',
'schemaValues' => [
],
'executionOptions' => [
'maxTokens' => 123,
'temperature' => 123,
'topP' => 123,
'model' => '<string>',
'stream' => true
]
]),
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://api.example.com/execute_brx"
payload := strings.NewReader("{\n \"brxId\": \"<string>\",\n \"schemaValues\": {},\n \"executionOptions\": {\n \"maxTokens\": 123,\n \"temperature\": 123,\n \"topP\": 123,\n \"model\": \"<string>\",\n \"stream\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/execute_brx")
.header("Content-Type", "application/json")
.body("{\n \"brxId\": \"<string>\",\n \"schemaValues\": {},\n \"executionOptions\": {\n \"maxTokens\": 123,\n \"temperature\": 123,\n \"topP\": 123,\n \"model\": \"<string>\",\n \"stream\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/execute_brx")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"brxId\": \"<string>\",\n \"schemaValues\": {},\n \"executionOptions\": {\n \"maxTokens\": 123,\n \"temperature\": 123,\n \"topP\": 123,\n \"model\": \"<string>\",\n \"stream\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"400": {},
"401": {},
"403": {},
"404": {},
"429": {},
"500": {},
"executeBrxResponse": {
"httpResponse": {
"isError": true,
"statusMsg": "<string>",
"result": "<string>",
"executionId": "<string>",
"executionTime": 123,
"tokenUsage": {
"prompt": 123,
"completion": 123,
"total": 123
}
}
}
}This endpoint executes a BRK with the provided input values. It processes the BRK, including any dependencies, and returns the result. The input values must match the schema of the BRK. You must have at least viewer permissions for the BRK to execute it.
Request
string
required
The ID of the BRK to execute
object
required
The input values for the BRK, matching its schema
object
Example Request
{
"brxId": "brk-12345678-90ab-cdef-1234-567890abcdef",
"schemaValues": {
"variable": "example value"
},
"executionOptions": {
"maxTokens": 1000,
"temperature": 0.7,
"topP": 0.9,
"model": "gpt-4",
"stream": false
}
}
Response
object
Show properties
Show properties
object
Show properties
Show properties
boolean
Indicates whether the request resulted in an error
string
A message describing the status of the request
string
The result of the BRK execution
string
The unique identifier for this execution
number
The time taken to execute the BRK in milliseconds
Example Response
{
"executeBrxResponse": {
"httpResponse": {
"isError": false,
"statusMsg": "BRK executed successfully",
"result": "This is the result of the BRK execution with the input value: example value",
"executionId": "exec-12345678-90ab-cdef-1234-567890abcdef",
"executionTime": 1234.56,
"tokenUsage": {
"prompt": 100,
"completion": 50,
"total": 150
}
}
}
}
Error Codes
object
Bad Request - The request was malformed or missing required parameters
object
Unauthorized - Authentication credentials are missing or invalid
object
Forbidden - The authenticated user does not have permission to execute the requested BRK
object
Not Found - The requested BRK does not exist
object
Too Many Requests - The user has exceeded the BRK execution rate limit
object
Internal Server Error - An unexpected error occurred on the server
Notes
- The
schemaValuesobject must match the schema of the BRK. You can use the Get BRK Schema endpoint to retrieve the schema. - The
executionOptionsobject allows you to customize the execution behavior, such as the model to use and the sampling parameters. - The response includes the result of the execution, as well as metadata such as the execution time and token usage.
- If the
streamoption is set totrue, the response will be streamed as it is generated. This is useful for long-running executions. - The
tokenUsageobject provides information about the number of tokens used in the prompt, completion, and total. This can be useful for monitoring usage and costs.