Skip to main content

Code Interpreter

Run Code Interpreter

POST /v1/analysis

Request body json

  • code string required

    Python code to execute. Common libraries such as matplotlib are pre-installed. The ability to install new packages will be available in the future.

  • files array

    Array of file objects (to obtain a file ID, upload first using the Files API):

    {
    "file_id": "[FILE ID]",
    "name": "[FILE NAME]"
    "type": "[FILE MIME TYPE]"
    }

Returns

{
"success": true,
"output": {
"type": "[OUTPUT TYPE]",
"content": "[OUTPUT CONTENT]"
}
}