stdout, stderr, and any unhandled exceptions.
POST /v1/agents/runtime/{runtime_id}/code/run
Basic (Python)
JavaScript and contexts
Create a persistent context, then run JavaScript so state survives across calls.gravixlayer runtime run infers language from the file extension (.py, .js) but does not accept --context-id. Use Python or cURL for context-bound runs.Parameters
string
required
The source code to execute.
string
The programming language of the code. Defaults to
"python". Use "javascript" for Node.js execution.string
An identifier for a persistent execution context.
object
Environment variables specific to this code execution block.
integer
Execution timeout in seconds. Kills the process if it exceeds this limit.
Response
string
The standard output (
stdout) produced by the executed code.boolean
True if the code executed without raising unhandled exceptions.object
Detailed error information if
success is False. Includes name (e.g., ValueError), value (the error message), and traceback (the full stack trace).object
The raw
stdout and stderr streams, formatted as lists of strings.