Execute code
POST /execute
Run code in a persistent REPL session and wait for the full result.
If context_id is omitted a new session is created automatically.
Supported languages: python, typescript.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Source code to execute.
Example
print('hello')Link execution to an existing context. Auto-generated if omitted.
Language runtime to use.
Environment variables for the execution.
object
Execution timeout in milliseconds.
Responses
Section titled “ Responses ”Execution completed.
object
ID of the execution context used. Auto-generated if not provided in the request.
Rich output items from the execution.
object
Whether this is the primary output item.
Base64-encoded PNG image.
Base64-encoded JPEG image.
Base64-encoded PDF.
object
object
object
Lines of standard output.
Lines of standard error.
object
Error type name.
Example
NameErrorError message.
Example
name 'x' is not definedFull traceback string.
Incremental execution counter for the session.
Bad request – validation error.
object
Summary message.
Example
Invalid requestobject
JSON field name that failed validation.
Human-readable validation failure.
Internal error (returned as an Execution object with an error field).
object
ID of the execution context used. Auto-generated if not provided in the request.
Rich output items from the execution.
object
Whether this is the primary output item.
Base64-encoded PNG image.
Base64-encoded JPEG image.
Base64-encoded PDF.
object
object
object
Lines of standard output.
Lines of standard error.
object
Error type name.
Example
NameErrorError message.
Example
name 'x' is not definedFull traceback string.
Incremental execution counter for the session.