{
  "openapi": "3.1.0",
  "info": {
    "title": "Sandboxd Code Run",
    "description": "Hosted one-shot code execution: send a snippet plus optional files, get stdout, stderr, exit code and artifacts back. Daytona execute-code compatible; no daemon to keep warm, priced per run.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://sandboxd-code-run.saastemly.com"
    }
  ],
  "paths": {
    "/v1/execute-code": {
      "post": {
        "operationId": "execute-code",
        "summary": "Runs Python, JavaScript or TypeScript code in an isolated one-shot sandbox and returns stdout, stderr, exit code and artifacts (Daytona CodeRunRequest/ExecuteResponse compatible)",
        "description": "Runs Python, JavaScript or TypeScript code in an isolated one-shot sandbox and returns stdout, stderr, exit code and artifacts (Daytona CodeRunRequest/ExecuteResponse compatible)\n\nPrice: $0.002 per call (x402, or prepaid credits with an API key).",
        "x-price-usd": 0.002,
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "example": {
                  "exitCode": 0,
                  "result": "Sum: 30\n",
                  "stderr": "",
                  "artifacts": {
                    "stdout": "Sum: 30\n",
                    "charts": []
                  },
                  "language": "python",
                  "seconds": 1,
                  "truncated": false,
                  "outputFiles": {},
                  "missingOutputs": [],
                  "tooLargeOutputs": []
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid (nothing is charged)"
          },
          "402": {
            "description": "Payment required: the x402 terms are in the PAYMENT-REQUIRED header; or send an API key"
          }
        },
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "The code to run (up to 1 MB of UTF-8)"
                  },
                  "language": {
                    "type": "string",
                    "description": "\"python\", \"javascript\" or \"typescript\"",
                    "enum": [
                      "python",
                      "javascript",
                      "typescript"
                    ]
                  },
                  "argv": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Command-line arguments for the program (sys.argv[1:] in Python, process.argv.slice(2) in Node)"
                  },
                  "env": {
                    "type": "object",
                    "description": "Environment variables; keys must match [A-Za-z_][A-Za-z0-9_]* (Daytona's rule)"
                  },
                  "timeout": {
                    "type": "integer",
                    "description": "Run timeout in seconds, 1-120 (default 60); a timed-out run answers exitCode 124"
                  },
                  "files": {
                    "type": "object",
                    "description": "Text files written into the work directory next to the program (up to 50, 1 MB each, 4 MB total); the entry point main.py/main.js/main.ts is reserved"
                  },
                  "outputs": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Relative paths to read back after the run (up to 20); up to 1 MB each comes back base64 in outputFiles, larger in tooLargeOutputs, absent in missingOutputs"
                  }
                },
                "required": [
                  "code",
                  "language"
                ]
              },
              "example": {
                "code": "x = 10\ny = 20\nprint(f\"Sum: {x + y}\")",
                "language": "python",
                "timeout": 10
              }
            }
          }
        }
      }
    },
    "/v1/execute-command": {
      "post": {
        "operationId": "execute-command",
        "summary": "Runs a shell command in an isolated one-shot sandbox and returns stdout, stderr and the exit code (Daytona ExecuteRequest/ExecuteResponse compatible)",
        "description": "Runs a shell command in an isolated one-shot sandbox and returns stdout, stderr and the exit code (Daytona ExecuteRequest/ExecuteResponse compatible)\n\nPrice: $0.002 per call (x402, or prepaid credits with an API key).",
        "x-price-usd": 0.002,
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "example": {
                  "exitCode": 0,
                  "result": "hello from the sandbox\n",
                  "stderr": "",
                  "artifacts": {
                    "stdout": "hello from the sandbox\n",
                    "charts": []
                  },
                  "seconds": 1,
                  "truncated": false,
                  "outputFiles": {},
                  "missingOutputs": [],
                  "tooLargeOutputs": []
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid (nothing is charged)"
          },
          "402": {
            "description": "Payment required: the x402 terms are in the PAYMENT-REQUIRED header; or send an API key"
          }
        },
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "command": {
                    "type": "string",
                    "description": "The shell command to run (up to 64 KB)"
                  },
                  "env": {
                    "type": "object",
                    "description": "Environment variables; keys must match [A-Za-z_][A-Za-z0-9_]* (Daytona's rule)"
                  },
                  "cwd": {
                    "type": "string",
                    "description": "Working directory, relative to the run's work directory"
                  },
                  "timeout": {
                    "type": "integer",
                    "description": "Run timeout in seconds, 1-120 (default 60); a timed-out run answers exitCode 124"
                  },
                  "files": {
                    "type": "object",
                    "description": "Text files written into the work directory before the run (up to 50, 1 MB each, 4 MB total)"
                  },
                  "outputs": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Relative paths to read back after the run (up to 20); up to 1 MB each comes back base64 in outputFiles, larger in tooLargeOutputs, absent in missingOutputs"
                  }
                },
                "required": [
                  "command"
                ]
              },
              "example": {
                "command": "echo hello from the sandbox",
                "timeout": 10
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key with prepaid credits, from https://sandboxd-code-run.saastemly.com"
      }
    }
  },
  "x-mcp-server": "https://sandboxd-code-run.saastemly.com/mcp"
}