run_code for language-level execution with structured outputs, logs, and error objects.
Supported Languages
- Python
- JavaScript
Basic Example
POST /v1/agents/runtime/{runtime_id}/code/run
Why Use Code Contexts
Code contexts let you preserve state between calls. Create a context withgravixlayer runtime code-context create, then pass --context-id on each runtime run (or context_id on each run_code call in the SDKs).
Run Python
Python execution examples
Run JavaScript
JavaScript execution examples
Create Context
Persist variables and imports across calls