{
 "openapi": "3.1.0",
 "info": {
  "title": "ComputeSDK API",
  "version": "1.0.0",
  "description": "The ComputeSDK platform REST API. Create and control sandboxes, run benchmarks, read public benchmark results and the feed, query the package-name registry, and read the compute market order book.\n\nAuthentication: send an org-scoped API key as `Authorization: Bearer <key>` (keys are minted in the ComputeSDK console at https://platform.computesdk.com), or an OAuth 2.0 `at+jwt` access token issued by `https://platform.computesdk.com/api/auth` (see `/.well-known/oauth-authorization-server` on the API host). The MCP endpoint `https://platform.computesdk.com/mcp` exposes the same capabilities as tools over the Model Context Protocol.",
  "contact": {
   "name": "ComputeSDK Support",
   "email": "support@computesdk.com",
   "url": "https://www.computesdk.com/support"
  },
  "license": {
   "name": "Proprietary",
   "url": "https://www.computesdk.com/terms"
  }
 },
 "servers": [
  {
   "url": "https://platform.computesdk.com",
   "description": "ComputeSDK platform API"
  }
 ],
 "externalDocs": {
  "description": "ComputeSDK documentation",
  "url": "https://docs.computesdk.com"
 },
 "security": [
  {
   "bearerAuth": []
  }
 ],
 "tags": [
  {
   "name": "Identity",
   "description": "Who you are and which organizations you belong to"
  },
  {
   "name": "Benchmarks",
   "description": "Benchmark definitions, runs, and published results"
  },
  {
   "name": "Feed",
   "description": "Public benchmark run feed"
  },
  {
   "name": "Sandboxes",
   "description": "Isolated compute environments: create, command, process, destroy"
  },
  {
   "name": "Market",
   "description": "The compute market order book"
  },
  {
   "name": "Registry",
   "description": "Package-name ownership registry (rgstr)"
  }
 ],
 "paths": {
  "/api/v1/me": {
   "get": {
    "operationId": "getCurrentUser",
    "summary": "Get the authenticated user and their organizations",
    "description": "Returns the authenticated user, the org resolved from the credential, and every org the user belongs to.",
    "tags": [
     "Identity"
    ],
    "responses": {
     "200": {
      "description": "Current user and organizations",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "user",
          "activeOrganizationId",
          "organizations"
         ],
         "properties": {
          "user": {
           "$ref": "#/components/schemas/User"
          },
          "activeOrganizationId": {
           "type": "string"
          },
          "organizations": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Organization"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/api/v1/benchmarks": {
   "get": {
    "operationId": "listBenchmarks",
    "summary": "List benchmarks visible to the organization",
    "description": "Returns the org's own benchmarks plus any categorized benchmarks the org is entitled to run.",
    "tags": [
     "Benchmarks"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/Limit"
     },
     {
      "$ref": "#/components/parameters/Offset"
     }
    ],
    "responses": {
     "200": {
      "description": "Benchmark list",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "items"
         ],
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Benchmark"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/api/v1/benchmarks/{benchmarkSlug}": {
   "get": {
    "operationId": "getBenchmark",
    "summary": "Get a benchmark by slug",
    "description": "Resolves a benchmark owned by the caller's organization by its slug.",
    "tags": [
     "Benchmarks"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/BenchmarkSlug"
     }
    ],
    "responses": {
     "200": {
      "description": "The benchmark",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Benchmark"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/api/v1/benchmarks/{benchmarkSlug}/results": {
   "get": {
    "operationId": "getBenchmarkResults",
    "summary": "Get published results for a benchmark",
    "description": "Returns the results overview: benchmark identity, aggregate analytics, and per-run participants. When more than one benchmark shares the slug, disambiguate with `/api/v1/benchmarks/~/{sourceOrgSlug}/{benchmarkSlug}/results`.",
    "tags": [
     "Benchmarks"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/BenchmarkSlug"
     }
    ],
    "responses": {
     "200": {
      "description": "Results overview",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BenchmarkResultsOverview"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/api/v1/benchmarks/{benchmarkSlug}/runs": {
   "get": {
    "operationId": "listBenchmarkRuns",
    "summary": "List runs of a benchmark",
    "tags": [
     "Benchmarks"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/BenchmarkSlug"
     }
    ],
    "responses": {
     "200": {
      "description": "Run list",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/BenchmarkRun"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "createBenchmarkRun",
    "summary": "Create a benchmark run",
    "description": "Creates a run of the benchmark on the owner's side. `participants` names the provider slugs to measure; `config` carries benchmark-specific task configuration.",
    "tags": [
     "Benchmarks"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/BenchmarkSlug"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CreateBenchmarkRunRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The created run",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "run": {
           "$ref": "#/components/schemas/BenchmarkRun"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/api/v1/benchmarks/{benchmarkSlug}/runs/{runId}": {
   "get": {
    "operationId": "getBenchmarkRun",
    "summary": "Get a benchmark run",
    "tags": [
     "Benchmarks"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/BenchmarkSlug"
     },
     {
      "$ref": "#/components/parameters/RunId"
     }
    ],
    "responses": {
     "200": {
      "description": "The run",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BenchmarkRun"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/api/v1/benchmarks/{benchmarkSlug}/runs/{runId}/results": {
   "get": {
    "operationId": "getBenchmarkRunResults",
    "summary": "Get results for a single run",
    "tags": [
     "Benchmarks"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/BenchmarkSlug"
     },
     {
      "$ref": "#/components/parameters/RunId"
     }
    ],
    "responses": {
     "200": {
      "description": "Per-participant results for the run",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/BenchmarkParticipantResult"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/api/v1/feed": {
   "get": {
    "operationId": "getFeed",
    "summary": "Get the public benchmark run feed",
    "description": "A cursor-paginated feed of the org's `visibility = 'public'` benchmark runs, newest first.",
    "tags": [
     "Feed"
    ],
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "description": "Page size (1\u201350, default 20)",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 50,
       "default": 20
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "description": "Opaque cursor from a previous response's `nextCursor`",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Feed page",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "items"
         ],
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/FeedItem"
           }
          },
          "nextCursor": {
           "type": "string",
           "nullable": true
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/api/v1/sandboxes": {
   "get": {
    "operationId": "listSandboxes",
    "summary": "List sandboxes",
    "tags": [
     "Sandboxes"
    ],
    "parameters": [
     {
      "name": "status",
      "in": "query",
      "description": "Filter by lifecycle status",
      "schema": {
       "type": "string",
       "enum": [
        "creating",
        "running",
        "destroyed"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "description": "Page size (positive integer)",
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "description": "Opaque pagination cursor",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of sandboxes",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Sandbox"
           }
          },
          "nextCursor": {
           "type": "string",
           "nullable": true
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   },
   "post": {
    "operationId": "createSandbox",
    "summary": "Create a sandbox",
    "description": "Places and boots a sandbox across the provider roster. `providerOrder` pins or orders placement; `maxPrice` (`{ usd, per }`, with `per` one of `second`, `minute`, `hour`, `day`) turns the create into a limit order on the Market; `snapshotId` or `disk` restore prior state.",
    "tags": [
     "Sandboxes"
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CreateSandboxRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The created sandbox",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "sandbox"
         ],
         "properties": {
          "sandbox": {
           "$ref": "#/components/schemas/Sandbox"
          },
          "snapshot": {
           "$ref": "#/components/schemas/Snapshot"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "502": {
      "description": "Placement failed \u2014 no provider could satisfy the request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/sandboxes/{sandboxId}": {
   "get": {
    "operationId": "getSandbox",
    "summary": "Get a sandbox",
    "tags": [
     "Sandboxes"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/SandboxId"
     }
    ],
    "responses": {
     "200": {
      "description": "The sandbox",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Sandbox"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "delete": {
    "operationId": "deleteSandbox",
    "summary": "Destroy a sandbox",
    "tags": [
     "Sandboxes"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/SandboxId"
     }
    ],
    "responses": {
     "200": {
      "description": "Sandbox destroyed"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/api/v1/sandboxes/{sandboxId}/commands": {
   "post": {
    "operationId": "runSandboxCommand",
    "summary": "Run a command in a sandbox",
    "description": "Runs one shell command. The default response is a `text/event-stream` of `stdout`/`stderr` chunks closed by an `exit` event; send `Accept: application/json` for the buffered result instead.",
    "tags": [
     "Sandboxes"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/SandboxId"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RunCommandRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Command output \u2014 event stream or buffered JSON per Accept",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CommandResult"
        }
       },
       "text/event-stream": {
        "schema": {
         "type": "string",
         "description": "SSE stream of stdout/stderr chunks terminated by an exit event"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/api/v1/sandboxes/{sandboxId}/processes": {
   "get": {
    "operationId": "listSandboxProcesses",
    "summary": "List detached processes in a sandbox",
    "tags": [
     "Sandboxes"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/SandboxId"
     }
    ],
    "responses": {
     "200": {
      "description": "Process list",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "processes"
         ],
         "properties": {
          "processes": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/SandboxProcess"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "startSandboxProcess",
    "summary": "Start a detached process in a sandbox",
    "description": "Starts a daemon process and returns its `jobId` \u2014 the control key for the `GET`, `wait`, `stdin`, and `kill` routes under `/api/v1/sandboxes/{sandboxId}/processes/{jobId}`. The process keeps running after this request ends.",
    "tags": [
     "Sandboxes"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/SandboxId"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/StartProcessRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The started process",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "process"
         ],
         "properties": {
          "process": {
           "$ref": "#/components/schemas/SandboxProcess"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/api/v1/market/book": {
   "get": {
    "operationId": "getMarketBook",
    "summary": "Read the market order book",
    "description": "The current set of asks across providers. Pass `useCase` to narrow the book to one consumer lane.",
    "tags": [
     "Market"
    ],
    "parameters": [
     {
      "name": "useCase",
      "in": "query",
      "description": "Consumer lane to filter the book by (e.g. a sandbox use case)",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The order book",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "Order book shape \u2014 asks grouped by lane; each ask carries provider, price (micro-USD), and capacity"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/api/v1/registry/whois/{name}": {
   "get": {
    "operationId": "registryWhois",
    "summary": "Look up a package-name claim",
    "description": "Public lookup for the rgstr name registry: who holds a name, at which trust level, and where it routes. No authentication required.",
    "tags": [
     "Registry"
    ],
    "security": [],
    "parameters": [
     {
      "name": "name",
      "in": "path",
      "required": true,
      "description": "Package name, e.g. `lodash` or `@scope/pkg` (path segments joined)",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Claim lookup",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RegistryWhois"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     }
    }
   }
  },
  "/api/v1/sandboxes/{sandboxId}/processes/{jobId}": {
   "get": {
    "operationId": "getSandboxProcess",
    "summary": "Read a detached process's status and buffered output",
    "description": "Returns JSON by default. Send `Accept: text/event-stream` to stream stdout/stderr deltas and an `exit` event until the process exits.",
    "tags": [
     "Sandboxes"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/SandboxId"
     },
     {
      "$ref": "#/components/parameters/JobId"
     }
    ],
    "responses": {
     "200": {
      "description": "Current process status with buffered stdout/stderr (JSON) or an SSE stream of output deltas followed by an exit event",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "process"
         ],
         "properties": {
          "process": {
           "$ref": "#/components/schemas/SandboxProcessStatus"
          }
         }
        }
       },
       "text/event-stream": {
        "schema": {
         "type": "string",
         "description": "SSE events: `stdout`, `stderr`, `exit`"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/api/v1/sandboxes/{sandboxId}/processes/{jobId}/wait": {
   "post": {
    "operationId": "waitSandboxProcess",
    "summary": "Block until the process exits or the timeout elapses",
    "tags": [
     "Sandboxes"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/SandboxId"
     },
     {
      "$ref": "#/components/parameters/JobId"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "timeoutMs": {
          "type": "integer",
          "minimum": 1,
          "description": "Max wait; capped server-side"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Final process status",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "process"
         ],
         "properties": {
          "process": {
           "$ref": "#/components/schemas/SandboxProcessStatus"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/api/v1/sandboxes/{sandboxId}/processes/{jobId}/stdin": {
   "post": {
    "operationId": "writeSandboxProcessStdin",
    "summary": "Write to the process's stdin",
    "tags": [
     "Sandboxes"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/SandboxId"
     },
     {
      "$ref": "#/components/parameters/JobId"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "data"
        ],
        "properties": {
         "data": {
          "type": "string",
          "description": "Bytes to write"
         },
         "encoding": {
          "type": "string",
          "enum": [
           "utf8",
           "base64"
          ],
          "default": "utf8"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Write accepted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/api/v1/sandboxes/{sandboxId}/processes/{jobId}/close-stdin": {
   "post": {
    "operationId": "closeSandboxProcessStdin",
    "summary": "Close the process's stdin",
    "tags": [
     "Sandboxes"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/SandboxId"
     },
     {
      "$ref": "#/components/parameters/JobId"
     }
    ],
    "responses": {
     "200": {
      "description": "Stdin closed",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/api/v1/sandboxes/{sandboxId}/processes/{jobId}/kill": {
   "post": {
    "operationId": "killSandboxProcess",
    "summary": "Send a signal to the process",
    "tags": [
     "Sandboxes"
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/SandboxId"
     },
     {
      "$ref": "#/components/parameters/JobId"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "signal": {
          "type": "string",
          "description": "Signal name or number, e.g. SIGKILL or 9"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Process status after the signal",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "process"
         ],
         "properties": {
          "process": {
           "$ref": "#/components/schemas/SandboxProcessStatus"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearerAuth": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "API key or at+jwt OAuth access token",
    "description": "Org-scoped API key minted in the ComputeSDK console, or an OAuth 2.0 access token issued by https://platform.computesdk.com/api/auth"
   }
  },
  "parameters": {
   "BenchmarkSlug": {
    "name": "benchmarkSlug",
    "in": "path",
    "required": true,
    "description": "Benchmark slug, e.g. `burst-tti`",
    "schema": {
     "type": "string"
    }
   },
   "RunId": {
    "name": "runId",
    "in": "path",
    "required": true,
    "description": "Benchmark run identifier",
    "schema": {
     "type": "string"
    }
   },
   "SandboxId": {
    "name": "sandboxId",
    "in": "path",
    "required": true,
    "description": "Sandbox UUID",
    "schema": {
     "type": "string",
     "format": "uuid"
    }
   },
   "Limit": {
    "name": "limit",
    "in": "query",
    "description": "Maximum items to return",
    "schema": {
     "type": "integer",
     "minimum": 1,
     "maximum": 500
    }
   },
   "Offset": {
    "name": "offset",
    "in": "query",
    "description": "Items to skip before the first returned item",
    "schema": {
     "type": "integer",
     "minimum": 0
    }
   },
   "JobId": {
    "name": "jobId",
    "in": "path",
    "required": true,
    "schema": {
     "type": "string"
    },
    "description": "Process job id returned by startSandboxProcess"
   }
  },
  "responses": {
   "BadRequest": {
    "description": "Request failed validation",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Unauthorized": {
    "description": "Missing or invalid credential",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "NotFound": {
    "description": "Resource not found",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "error",
     "requestId"
    ],
    "properties": {
     "error": {
      "type": "string",
      "description": "Human-readable error message"
     },
     "requestId": {
      "type": "string",
      "description": "Correlates the failure to the server log"
     },
     "details": {
      "type": "object",
      "additionalProperties": true
     }
    }
   },
   "User": {
    "type": "object",
    "required": [
     "id",
     "name",
     "email"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "email": {
      "type": "string",
      "format": "email"
     }
    }
   },
   "Organization": {
    "type": "object",
    "required": [
     "id",
     "name",
     "slug"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "slug": {
      "type": "string"
     }
    }
   },
   "Benchmark": {
    "type": "object",
    "description": "A benchmark definition \u2014 a workload plus its scoring and visibility policy",
    "properties": {
     "id": {
      "type": "string"
     },
     "slug": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "organizationId": {
      "type": "string"
     },
     "organizationSlug": {
      "type": "string",
      "nullable": true
     },
     "visibility": {
      "type": "string",
      "enum": [
       "public",
       "private"
      ]
     },
     "createdAt": {
      "type": "string",
      "format": "date-time"
     }
    },
    "additionalProperties": true
   },
   "BenchmarkRun": {
    "type": "object",
    "description": "One execution of a benchmark across its participants",
    "properties": {
     "id": {
      "type": "string"
     },
     "benchmarkId": {
      "type": "string"
     },
     "status": {
      "type": "string"
     },
     "gitSha": {
      "type": "string",
      "nullable": true
     },
     "gitRef": {
      "type": "string",
      "nullable": true
     },
     "createdAt": {
      "type": "string",
      "format": "date-time"
     }
    },
    "additionalProperties": true
   },
   "BenchmarkParticipantResult": {
    "type": "object",
    "description": "One participant's measured results within a run",
    "properties": {
     "participantSlug": {
      "type": "string"
     },
     "summary": {
      "type": "object",
      "additionalProperties": true
     },
     "compositeScore": {
      "type": "number",
      "nullable": true
     },
     "successRate": {
      "type": "number",
      "nullable": true
     }
    },
    "additionalProperties": true
   },
   "BenchmarkResultsOverview": {
    "type": "object",
    "required": [
     "benchmark",
     "generatedAt",
     "items"
    ],
    "properties": {
     "benchmark": {
      "type": "object",
      "required": [
       "id",
       "slug",
       "name"
      ],
      "properties": {
       "id": {
        "type": "string"
       },
       "slug": {
        "type": "string"
       },
       "name": {
        "type": "string"
       }
      }
     },
     "generatedAt": {
      "type": "string",
      "format": "date-time"
     },
     "upgrade": {
      "type": "object",
      "nullable": true,
      "additionalProperties": true
     },
     "analytics": {
      "type": "object",
      "additionalProperties": true
     },
     "items": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "run": {
         "$ref": "#/components/schemas/BenchmarkRun"
        },
        "analytics": {
         "type": "object",
         "additionalProperties": true
        },
        "participants": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/BenchmarkParticipantResult"
         }
        }
       }
      }
     }
    }
   },
   "FeedItem": {
    "type": "object",
    "description": "One public benchmark run in the feed",
    "required": [
     "id",
     "benchmarkSlug",
     "benchmarkLabel",
     "createdAt"
    ],
    "properties": {
     "id": {
      "type": "string",
      "description": "Run id"
     },
     "benchmarkSlug": {
      "type": "string"
     },
     "benchmarkLabel": {
      "type": "string"
     },
     "createdAt": {
      "type": "string",
      "format": "date-time"
     },
     "gitSha": {
      "type": "string",
      "nullable": true
     },
     "gitRef": {
      "type": "string",
      "nullable": true
     },
     "providerCount": {
      "type": "integer"
     },
     "skippedCount": {
      "type": "integer"
     },
     "leaders": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "summary": {
      "type": "string"
     }
    }
   },
   "Sandbox": {
    "type": "object",
    "description": "An isolated remote compute environment",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "status": {
      "type": "string",
      "enum": [
       "creating",
       "running",
       "destroyed"
      ]
     },
     "provider": {
      "type": "string",
      "description": "Provider the sandbox was placed on"
     },
     "label": {
      "type": "string",
      "nullable": true
     },
     "createdAt": {
      "type": "string",
      "format": "date-time"
     }
    },
    "additionalProperties": true
   },
   "Snapshot": {
    "type": "object",
    "description": "A snapshot resolved from `snapshotId` on create",
    "properties": {
     "id": {
      "type": "string"
     },
     "sandboxId": {
      "type": "string"
     }
    },
    "additionalProperties": true
   },
   "SandboxProcess": {
    "type": "object",
    "description": "A detached daemon process inside a sandbox",
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid"
     },
     "jobId": {
      "type": "string"
     },
     "pid": {
      "type": "integer",
      "nullable": true
     },
     "command": {
      "type": "string"
     },
     "cwd": {
      "type": "string",
      "nullable": true
     },
     "envNames": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "stdin": {
      "type": "boolean",
      "description": "Whether the process accepts stdin writes"
     },
     "status": {
      "type": "string",
      "enum": [
       "running",
       "exited"
      ]
     },
     "exitCode": {
      "type": "integer",
      "nullable": true
     },
     "signal": {
      "type": "string",
      "nullable": true
     },
     "startedAt": {
      "type": "string",
      "format": "date-time"
     },
     "exitedAt": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     }
    }
   },
   "Rate": {
    "type": "object",
    "required": [
     "usd",
     "per"
    ],
    "properties": {
     "usd": {
      "type": "number",
      "exclusiveMinimum": 0
     },
     "per": {
      "type": "string",
      "enum": [
       "second",
       "minute",
       "hour",
       "day"
      ]
     }
    }
   },
   "DiskMount": {
    "type": "object",
    "required": [
     "diskId",
     "path"
    ],
    "properties": {
     "diskId": {
      "type": "string",
      "description": "Persistent disk under the org's slug namespace"
     },
     "path": {
      "type": "string",
      "description": "Absolute mount path inside the sandbox"
     },
     "readonly": {
      "type": "boolean"
     },
     "branch": {
      "type": "string"
     }
    }
   },
   "CreateSandboxRequest": {
    "type": "object",
    "properties": {
     "label": {
      "type": "string",
      "maxLength": 200
     },
     "providerOrder": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Ordered provider preference list"
     },
     "timeoutMs": {
      "type": "integer",
      "exclusiveMinimum": 0
     },
     "maxPrice": {
      "$ref": "#/components/schemas/Rate"
     },
     "orderType": {
      "type": "string",
      "enum": [
       "market",
       "limit"
      ]
     },
     "image": {
      "type": "string",
      "maxLength": 500
     },
     "snapshotId": {
      "type": "string",
      "maxLength": 500
     },
     "disk": {
      "$ref": "#/components/schemas/DiskMount"
     }
    }
   },
   "RunCommandRequest": {
    "type": "object",
    "required": [
     "command"
    ],
    "properties": {
     "command": {
      "type": "string",
      "maxLength": 65536
     },
     "timeoutMs": {
      "type": "integer",
      "exclusiveMinimum": 0
     }
    }
   },
   "CommandResult": {
    "type": "object",
    "properties": {
     "commandId": {
      "type": "string"
     },
     "exitCode": {
      "type": "integer"
     },
     "durationMs": {
      "type": "number"
     },
     "stdout": {
      "type": "string"
     },
     "stderr": {
      "type": "string"
     }
    }
   },
   "StartProcessRequest": {
    "type": "object",
    "required": [
     "command"
    ],
    "properties": {
     "command": {
      "type": "string",
      "maxLength": 65536
     },
     "cwd": {
      "type": "string"
     },
     "env": {
      "type": "object",
      "additionalProperties": {
       "type": "string"
      }
     },
     "stdin": {
      "type": "boolean",
      "description": "Keep stdin open for later writes"
     }
    }
   },
   "CreateBenchmarkRunRequest": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "totalTasks": {
      "type": "integer",
      "exclusiveMinimum": 0
     },
     "workerCount": {
      "type": "integer",
      "exclusiveMinimum": 0
     },
     "participants": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Provider slugs to measure"
     },
     "config": {
      "type": "object",
      "additionalProperties": true
     },
     "runKey": {
      "type": "string",
      "description": "Idempotency key for the run"
     },
     "organizationId": {
      "type": "string",
      "description": "Admin-key only: org to create the run under"
     }
    }
   },
   "RegistryWhois": {
    "type": "object",
    "required": [
     "name",
     "url",
     "trust",
     "state",
     "holder",
     "routes"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "url": {
      "type": "string",
      "format": "uri"
     },
     "trust": {
      "type": "string"
     },
     "state": {
      "type": "string",
      "enum": [
       "held",
       "disputed",
       "pending",
       "unclaimed"
      ]
     },
     "holder": {
      "type": "object",
      "nullable": true,
      "properties": {
       "name": {
        "type": "string"
       },
       "slug": {
        "type": "string"
       },
       "url": {
        "type": "string",
        "format": "uri"
       },
       "via": {
        "type": "string"
       },
       "kind": {
        "type": "string"
       },
       "status": {
        "type": "string"
       }
      }
     },
     "routes": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      }
     },
     "hiddenCopies": {
      "type": "integer",
      "nullable": true
     }
    }
   },
   "SandboxProcessStatus": {
    "allOf": [
     {
      "$ref": "#/components/schemas/SandboxProcess"
     },
     {
      "type": "object",
      "properties": {
       "stdout": {
        "type": "string",
        "description": "Buffered standard output"
       },
       "stderr": {
        "type": "string",
        "description": "Buffered standard error"
       }
      }
     }
    ]
   }
  }
 }
}