Code Interpreter

Execute code

POST
/tci/execute

Executes the given code snippet and returns the output. Without a session_id, a new session is created to run the code. If you pass a valid session_id, the code runs in that session. This is useful for running multiple code snippets in the same environment, because dependencies and similar things are persisted between calls to the same session.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

Execute Request

body?ExecuteRequest

Response Body

application/json

curl -X POST "https://example.com/tci/execute" \  -H "Content-Type: application/json" \  -d '{    "code": "string",    "language": "python"  }'
{  "errors": null,  "data": {    "outputs": [      {        "type": "stdout",        "data": "string"      }    ],    "session_id": "string",    "status": "success"  }}