POST
/
execute_brx
{
  "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

brxId
string
required
The ID of the BRK to execute
schemaValues
object
required
The input values for the BRK, matching its schema
executionOptions
object
Optional execution options for the BRK

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

executeBrxResponse
object

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

400
object
Bad Request - The request was malformed or missing required parameters
401
object
Unauthorized - Authentication credentials are missing or invalid
403
object
Forbidden - The authenticated user does not have permission to execute the requested BRK
404
object
Not Found - The requested BRK does not exist
429
object
Too Many Requests - The user has exceeded the BRK execution rate limit
500
object
Internal Server Error - An unexpected error occurred on the server

Notes

  • The schemaValues object must match the schema of the BRK. You can use the Get BRK Schema endpoint to retrieve the schema.
  • The executionOptions object 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 stream option is set to true, the response will be streamed as it is generated. This is useful for long-running executions.
  • The tokenUsage object provides information about the number of tokens used in the prompt, completion, and total. This can be useful for monitoring usage and costs.