Quick Start
Send code, get a result. All you need is a runtime token.Your code is wrapped in an async function, so you can use
await and return directly.Response Format
Every response includes:Sandbox Environment
Code runs in a Node.js VM sandbox. You get standard JavaScript built-ins (JSON, Date, Math, Array, Promise, etc.) plus these helpers:
Not available:
require(), import(), fetch(), eval(), process, fs, or any npm packages. All external access goes through callTool().
Examples
Chain Multiple Tools
Search the web and summarize the results — two tool calls composed in a single execution:Use Connected Services
External integrations require a PCID (connection ID). Discover it first:Transform Data
Process and reshape data between tool calls:Working with Artifacts
Artifacts let you create and read files that persist across executions. This is useful for generating reports, storing intermediate results, or building files that your application retrieves later.When You Need a Chat ID
The Quick Start above works for stateless code execution — send code, get a result. But artifacts require a chat context (theX-Chat-Id header) so the platform knows where to store files.
There are two ways to get a chat ID:
Option 1: Use chat_create (recommended)
Use the Agent Management chat_create tool:
Using Your Chat ID
Once you have a chat ID, include theX-Chat-Id header in your code execution requests:
Create a File
createdArtifacts in the response and is stored in the platform.
Supported file types: csv, txt, json, html, xml, js, ts, md, py
Read a File
In a later execution (same chat ID), read it back:Retrieve Artifacts via API
Outside of code execution, list and download artifacts using the Agent Management tools or the REST API: Usingchat_list_artifacts:

