{
  "openapi": "3.1.0",
  "info": {
    "title": "United Compute API",
    "version": "0.1.0",
    "description": "Rent sandboxed, end-to-end encrypted Apple Silicon compute. Job payloads are encrypted client-side to the chosen provider's Secure Enclave key (ECDH P-256 + HKDF + chunked AES-256-GCM, see the protocol doc), so use the `uc` CLI / SDK for jobs (`curl -fsSL https://unitedcompute.si/install.sh | sh`). /v1/chat/completions is an OpenAI-compatible convenience endpoint where the coordinator encrypts on your behalf (not end-to-end)."
  },
  "servers": [{ "url": "https://api.unitedcompute.si" }],
  "components": {
    "securitySchemes": { "apiKey": { "type": "http", "scheme": "bearer", "description": "uc_live_... key from POST /v1/signup" } },
    "schemas": {
      "Error": { "type": "object", "properties": { "error": { "type": "string" } } }
    }
  },
  "paths": {
    "/v1/signup": {
      "post": {
        "summary": "Create a trial renter account (rate limited)",
        "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string" }, "name": { "type": "string" } } } } } },
        "responses": { "201": { "description": "API key (store it; shown once)", "content": { "application/json": { "schema": { "type": "object", "properties": { "apiKey": { "type": "string" }, "accountId": { "type": "string" }, "creditsMicros": { "type": "integer" }, "verified": { "type": "boolean" } } } } } } }
      }
    },
    "/v1/runtimes": { "get": { "summary": "Workloads, models and prices (micro-USD per second)", "responses": { "200": { "description": "Runtime catalogue" } } } },
    "/v1/network": { "get": { "summary": "Providers online / idle by chip family", "responses": { "200": { "description": "Network stats" } } } },
    "/v1/account": { "get": { "summary": "Credits and usage", "security": [{ "apiKey": [] }], "responses": { "200": { "description": "Account" } } } },
    "/v1/chat/completions": {
      "post": {
        "summary": "OpenAI-compatible chat completions (convenience path; NOT end-to-end encrypted, header x-uc-e2e: false)",
        "security": [{ "apiKey": [] }],
        "requestBody": { "content": { "application/json": { "schema": { "type": "object", "required": ["messages"], "properties": {
          "model": { "type": "string", "examples": ["qwen3-4b"] },
          "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" } } } },
          "max_tokens": { "type": "integer" }, "temperature": { "type": "number" } } } } } },
        "responses": { "200": { "description": "chat.completion object" }, "503": { "description": "no provider available", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }
      }
    },
    "/v1/jobs": { "post": { "summary": "Create an end-to-end encrypted job (use the SDK: requires client-side ECDH)", "security": [{ "apiKey": [] }], "responses": { "201": { "description": "jobId + provider public keys" } } } },
    "/v1/jobs/{id}": { "get": { "summary": "Job status", "security": [{ "apiKey": [] }], "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], "responses": { "200": { "description": "Job" } } } },
    "/v1/transparency": { "get": { "summary": "Hash-chained provider key transparency log", "responses": { "200": { "description": "Log entries" } } } }
  }
}
