Code Interpreter
Run Code Interpreter
POST /v1/analysis
Request body json
-
code
stringrequiredPython code to execute. Common libraries such as matplotlib are pre-installed. The ability to install new packages will be available in the future.
-
files
arrayArray 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]"
}
}