The Code Interpreter API is shutting down on October 1st, 2025. Read more here.
import Riza from '@riza-io/api';
const client = new Riza({
apiKey: process.env['RIZA_API_KEY'], // This is the default and can be omitted
});
const response = await client.command.execFunc({
code: 'def execute(input): return { "name": input["name"], "executed": True }',
language: 'python',
input: { name: 'John' },
});
console.log(response.execution);{
"output": {
"name": "John",
"executed": true
},
"output_status": "valid",
"execution": {
"id": "",
"exit_code": 0,
"stdout": "",
"stderr": "",
"duration": 7
}
}Run a function in a secure, isolated environment. Define a function named execute. The function will be passed input as an object.
import Riza from '@riza-io/api';
const client = new Riza({
apiKey: process.env['RIZA_API_KEY'], // This is the default and can be omitted
});
const response = await client.command.execFunc({
code: 'def execute(input): return { "name": input["name"], "executed": True }',
language: 'python',
input: { name: 'John' },
});
console.log(response.execution);{
"output": {
"name": "John",
"executed": true
},
"output_status": "valid",
"execution": {
"id": "",
"exit_code": 0,
"stdout": "",
"stderr": "",
"duration": 7
}
}Documentation Index
Fetch the complete documentation index at: https://docs.riza.io/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The function to execute. Your code must define a function named "execute" that takes in a single argument and returns a JSON-serializable value.
The interpreter to use when executing code.
python, javascript, typescript Set of key-value pairs to add to the function's execution environment.
Show child attributes
List of input files.
Show child attributes
Configuration for HTTP requests and authentication.
Show child attributes
The input to the function. This must be a valid JSON-serializable object. If you do not pass an input, your function will be called with None (Python) or null (JavaScript/TypeScript) as the argument.
Configuration for execution environment limits.
Show child attributes
The ID of the runtime revision to use when executing code.
OK
The execution details of the function.
Show child attributes
The output of the function.
The status of the output. "valid" means your function executed successfully and returned a valid JSON-serializable object, or void. "json_serialization_error" means your function executed successfully, but returned a nonserializable object. "error" means your function failed to execute.
error, json_serialization_error, valid