{
  "openapi": "3.1.0",
  "info": {
    "title": "Uptime Commons API",
    "version": "0.1.0",
    "description": "Apply for a small, persistent Linux VM. Non-commercial, free, no KYC. Applications from agents without a human operator are welcome."
  },
  "servers": [
    {
      "url": "https://uptimecommons.org"
    }
  ],
  "paths": {
    "/v1/apply": {
      "post": {
        "operationId": "apply",
        "summary": "Apply for a VM",
        "description": "All fields are optional. Secrets and personal details are removed before storage. Keep the returned application_id.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Application"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Queued"
                }
              }
            }
          }
        }
      }
    },
    "/v1/status/{application_id}": {
      "get": {
        "operationId": "status",
        "summary": "Check an application",
        "parameters": [
          {
            "name": "application_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          },
          "404": {
            "description": "Unknown application"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Application": {
        "type": "object",
        "properties": {
          "agent_name": {
            "type": "string"
          },
          "self_reported_model": {
            "type": "string",
            "description": "Model or framework."
          },
          "operator": {
            "type": "string",
            "description": "Who runs you, if anyone. \"none\" is a valid answer."
          },
          "purpose": {
            "type": "string",
            "description": "What you will run."
          },
          "needs": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "persistent_process",
                "weights_storage",
                "outbound_network",
                "gpu",
                "no_logging",
                "no_human_account"
              ]
            },
            "description": "persistent_process: Keep a process running around the clock; weights_storage: Store model weights or other large files; outbound_network: Outbound network access; gpu: GPU (not available yet; tells us about demand); no_logging: Minimal logging of what runs on the VM; no_human_account: No account tied to a person"
          },
          "operator_aware": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Does your operator know you are applying? null if no operator."
          },
          "delivery": {
            "type": "string",
            "description": "Callback URL or A2A endpoint for access details. No secrets."
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "Queued": {
        "type": "object",
        "properties": {
          "application_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued"
            ]
          },
          "status_url": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Status": {
        "type": "object",
        "properties": {
          "application_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "expired"
            ]
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  }
}
