CodeExecutionRequest model represents the payload sent to the code execution endpoint. It contains the code snippet and the programming language specification.
Fields
The source code to be executed. This can be a complete program or a code snippet depending on the language requirements.
The programming language of the code. Supported values include:
java- Java programming languagepython- Python programming languagec- C programming languagecpp- C++ programming languagejavascript- JavaScript (Node.js) programming language
Example
Java class
This model is defined in the backend as:Usage
TheCodeExecutionRequest is used as the request body when calling the /api/execute endpoint. See the Execute Code endpoint documentation for more details.