import Riza from '@riza-io/api';

const client = new Riza({
  apiKey: process.env['RIZA_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const response = await client.tools.exec('id');

  console.log(response.execution);
}

main();
{
  "execution": {
    "duration": 123,
    "exit_code": 123,
    "stderr": "<string>",
    "stdout": "<string>"
  },
  "output": "<any>",
  "output_status": "error"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Body

application/json
env
object[]

Set of key-value pairs to add to the tool's execution environment.

Set of key-value pairs to add to the tool's execution environment.

http
object

Configuration for HTTP requests and authentication.

input
any

The input to the tool. This must be a valid JSON-serializable object. It will be validated against the tool's input schema.

revision_id
string

The Tool revision ID to execute. This optional parmeter is used to pin executions to specific versions of the Tool. If not provided, the latest (current) version of the Tool will be executed.

Response

200
application/json
OK
execution
object
required

The execution details of the function.

output
any
required

The returned value of the Tool's execute function.

output_status
enum<string>
required

The status of the output. "valid" means your Tool executed successfully and returned a valid JSON-serializable object, or void. "json_serialization_error" means your Tool executed successfully, but returned a nonserializable object. "error" means your Tool failed to execute.

Available options:
error,
json_serialization_error,
valid