{"openapi":"3.1.0","info":{"title":"Mainbrella API","version":"1.0.0","description":"Account, billing, container, image build, and WebSocket API. Admin and marketing endpoints retain this origin and are forwarded to independently deployed Workers."},"servers":[{"url":"https://api.mainbrella.com"},{"url":"http://localhost:8787","description":"Local development"}],"tags":[{"name":"Operations"},{"name":"Authentication"},{"name":"API Keys"},{"name":"Projects"},{"name":"Domains"},{"name":"Subscriptions"},{"name":"Billing"},{"name":"Containers"},{"name":"Private Services"},{"name":"Secrets"},{"name":"Images"},{"name":"Internal"},{"name":"Admin"},{"name":"Marketing"},{"name":"Acquisition"},{"name":"Build"}],"components":{"securitySchemes":{"cookieAuth":{"type":"apiKey","in":"cookie","name":"mainbrella_session"},"sessionBearer":{"type":"http","scheme":"bearer","description":"Browser session value; container and image automation only."},"apiKeyBearer":{"type":"http","scheme":"bearer","description":"API key (mb_ prefix); account identity, container, image and SSH automation. Create at mainbrella.com/api-keys/."},"nativeBearer":{"type":"http","scheme":"bearer","description":"Native app access token; native auth endpoints only."},"sshGateway":{"type":"http","scheme":"bearer","description":"Trusted SSH gateway secret."},"imageBuild":{"type":"http","scheme":"bearer","description":"Trusted image build service secret."},"stripeSignature":{"type":"apiKey","in":"header","name":"Stripe-Signature"},"monitoring":{"type":"http","scheme":"bearer","description":"Dedicated MONITORING_SECRET; operational observations and incidents only."}},"schemas":{"ResolvedRepository":{"type":"object","properties":{"repo":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,38}\\/[A-Za-z0-9_.-]{1,100}$"},"ref":{"type":"string","minLength":1,"maxLength":200},"commit":{"type":"string","pattern":"^[a-f0-9]{40}$"},"suggestedCatalogId":{"type":"string"},"manifests":{"type":"array","items":{"type":"string"}},"private":{"type":"boolean"}},"required":["repo","ref","commit","suggestedCatalogId","manifests"]},"RepositoryLaunch":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"phase":{"type":"string","enum":["allocating","cloning","setup","starting","ready","failed","stopped"]},"options":{"type":"object","properties":{"repo":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,38}\\/[A-Za-z0-9_.-]{1,100}$"},"ref":{"type":"string","minLength":1,"maxLength":200},"catalogId":{"type":"string","enum":["node","python","rust","go","devops"]},"imageId":{"type":"string","format":"uuid"},"size":{"type":"string","enum":["lite","small","medium","large","xl"],"default":"small"},"cwd":{"type":"string","maxLength":200,"default":"."},"setupCommand":{"type":"string","minLength":1,"maxLength":4096},"startCommand":{"type":"string","minLength":1,"maxLength":4096},"port":{"type":"integer","minimum":1024,"maximum":65535},"readinessPath":{"type":"string","minLength":1,"maxLength":1024}},"required":["repo"],"additionalProperties":false},"repository":{"$ref":"#/components/schemas/ResolvedRepository"},"container":{"type":["object","null"],"properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}},"required":["id","createdAt","expiresAt"]},"executions":{"type":"object","properties":{"cloning":{"type":"string","format":"uuid"},"setup":{"type":"string","format":"uuid"},"starting":{"type":"string","format":"uuid"}}},"attempts":{"type":"object","additionalProperties":{"type":"number"}},"createdAt":{"type":"number"},"shellReadyAt":{"type":["number","null"]},"previewReadyAt":{"type":["number","null"]},"error":{"type":["string","null"]},"importParts":{"type":"integer"},"restoreLaunchConfigured":{"type":"boolean","description":"Whether a replayable foreground command was registered for future filesystem Stop/Resume and Fork."}},"required":["id","phase","options","repository","container","executions","attempts","createdAt","shellReadyAt","previewReadyAt","error"]},"BuildApp":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"prompt":{"type":"string"},"revision":{"type":"integer"},"activeTurnId":{"type":["string","null"]},"versionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","pattern":"^[a-f0-9]{40}$"},{"type":"null"}]},"verifiedVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","pattern":"^[a-f0-9]{40}$"},{"type":"null"}]},"github":{"type":"object","properties":{"repo":{"type":"string"},"branch":{"type":"string"},"commitId":{"type":["string","null"]},"url":{"type":"string","format":"uri"}},"required":["repo","branch","commitId","url"]},"container":{"type":["object","null"],"properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}},"required":["id","createdAt","expiresAt"]},"preview":{"type":["object","null"],"properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"expiresAt":{"type":"integer"}},"required":["id","url","expiresAt"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","prompt","revision","activeTurnId","versionId","verifiedVersionId","container","preview","createdAt","updatedAt"]},"BuildTurn":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"prompt":{"type":"string"},"mode":{"type":"string","enum":["build","preview","restore"]},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"activity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","tool"]},"text":{"type":"string"},"status":{"type":"string","enum":["proposed","running","skipped","blocked","succeeded","failed","unknown"]},"explanation":{"type":["string","null"],"description":"Plain-language progress or outcome with guidance on whether to wait, check the app, or try again."}},"required":["id","type","text","status","explanation"]}},"images":{"type":"array","items":{"$ref":"#/components/schemas/BuildImage"},"maxItems":4},"stage":{"type":"string"},"summary":{"type":["string","null"]},"error":{"type":["string","null"]},"errorExplanation":{"type":["string","null"],"description":"Plain-language progress or outcome with guidance on whether to wait, check the app, or try again."},"failureOperationId":{"type":["string","null"]},"log":{"type":"string"},"model":{"type":"string"},"effort":{"type":["string","null"]},"inputTokens":{"type":["integer","null"]},"outputTokens":{"type":["integer","null"]},"aiCostCents":{"type":"number","minimum":0},"createdAt":{"type":"string","format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","prompt","mode","status","activity","images","stage","summary","error","errorExplanation","failureOperationId","log","model","effort","inputTokens","outputTokens","aiCostCents","createdAt","finishedAt"]},"BuildImage":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"toolId":{"type":"string"},"label":{"type":"string"},"path":{"type":"string"}},"required":["id","toolId","label","path"]},"StorageRetention":{"type":"object","properties":{"writesBlocked":{"type":"boolean"},"deletionAt":{"type":["number","null"]},"notice":{"type":["string","null"]},"warningDeliveredAt":{"type":["number","null"]},"expiredAt":{"type":["number","null"]}},"required":["writesBlocked","deletionAt","notice","warningDeliveredAt","expiredAt"]},"BuildVersion":{"type":["object","null"],"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","pattern":"^[a-f0-9]{40}$"}]},"commitId":{"type":"string","pattern":"^[a-f0-9]{40}$"},"parentVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","pattern":"^[a-f0-9]{40}$"},{"type":"null"}]},"message":{"type":"string"},"verified":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","commitId","parentVersionId","message","verified","createdAt"]},"BuildFile":{"type":"object","properties":{"path":{"type":"string"},"size":{"type":"integer","minimum":0},"type":{"type":"string","enum":["text","image"]}},"required":["path","size","type"]},"AdminUser":{"allOf":[{"$ref":"#/components/schemas/PublicUser"},{"type":"object","properties":{"plan":{"type":"string","enum":["none","builder","pro","scale"]}},"required":["plan"]}]},"PublicUser":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":["string","null"]},"name":{"type":"string"},"created_at":{"type":"string"},"dob":{"type":["string","null"]}},"required":["id","email","name","created_at","dob"]},"PrepaidBalance":{"type":"object","properties":{"balanceCents":{"type":"number"},"availableBalanceCents":{"type":"number"},"reservedBalanceCents":{"type":"number"},"currency":{"type":"string","enum":["usd"]},"spendLimitCents":{"type":"number"},"monthlyUsageCents":{"type":"number"},"productionHourlyCents":{"type":"number"},"fundedRuntimeMs":{"type":["number","null"]},"minimumProductionRuntimeMs":{"type":"number","enum":[86400000]},"autoRecharge":{"type":"object","properties":{"enabled":{"type":"boolean"},"amountCents":{"type":"integer","minimum":500,"maximum":100000,"description":"USD cents."},"monthlyLimitCents":{"type":"integer","minimum":500,"maximum":100000,"description":"USD cents."},"spentCents":{"type":"number"},"status":{"type":"string"}},"required":["enabled","amountCents","monthlyLimitCents","spentCents","status"]}},"required":["balanceCents","availableBalanceCents","reservedBalanceCents","currency","spendLimitCents","monthlyUsageCents","productionHourlyCents","fundedRuntimeMs","minimumProductionRuntimeMs","autoRecharge"]},"MarketingUser":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":["string","null"]},"name":{"type":"string"},"created_at":{"type":"string"}},"required":["id","email","name","created_at"]},"AccountingCloseReport":{"type":"object","properties":{"month":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"periodStart":{"type":"number"},"periodEnd":{"type":"number"},"calendar":{"type":"string","enum":["UTC"]},"currency":{"type":"string","enum":["usd"]},"moneyUnit":{"type":"string","enum":["micro_usd"]},"computeUnit":{"type":"string","enum":["weighted_millisecond"]},"status":{"type":"string","enum":["reconciled","needs_review"]},"issues":{"type":"array","items":{"type":"string"}},"policyId":{"type":["string","null"]},"taxMethod":{"type":"string","enum":["unconfirmed","cash_receipts","section_451c"]},"receiptTimezone":{"type":"string"},"allocationMethod":{"type":"string"},"customerComputeCredits":{"type":"object","properties":{"fundedUnitMs":{"type":"string","pattern":"^-?\\d+(?:\\.\\d{1,2})?$","description":"Exact weighted milliseconds, including fractional milliseconds from storage nano-USD."},"revokedUnitMs":{"type":"string","pattern":"^-?\\d+(?:\\.\\d{1,2})?$","description":"Exact weighted milliseconds, including fractional milliseconds from storage nano-USD."},"consumedUnitMs":{"type":"string","pattern":"^-?\\d+(?:\\.\\d{1,2})?$","description":"Exact weighted milliseconds, including fractional milliseconds from storage nano-USD."},"outstandingUnitMs":{"type":"string","pattern":"^-?\\d+(?:\\.\\d{1,2})?$","description":"Exact weighted milliseconds, including fractional milliseconds from storage nano-USD."},"outstandingCreditCents":{"type":"number"},"historicalUnattributedUnitMs":{"type":"string","pattern":"^-?\\d+(?:\\.\\d{1,2})?$","description":"Exact weighted milliseconds, including fractional milliseconds from storage nano-USD."},"walletAccountsReconciled":{"type":"number"},"sourceReconciliation":{"type":"string","enum":["failed","passed"]}},"required":["fundedUnitMs","revokedUnitMs","consumedUnitMs","outstandingUnitMs","outstandingCreditCents","historicalUnattributedUnitMs","walletAccountsReconciled","sourceReconciliation"]},"deferredRevenue":{"type":"object","properties":{"considerationMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"earnedMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"monthlyEarnedMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"refundsMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"chargebacksMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"contraRevenueMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"outstandingMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"reconciliationDifferenceMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."}},"required":["considerationMicroUsd","earnedMicroUsd","monthlyEarnedMicroUsd","refundsMicroUsd","chargebacksMicroUsd","contraRevenueMicroUsd","outstandingMicroUsd","reconciliationDifferenceMicroUsd"]},"taxableAdvancePaymentsByReceiptYear":{"type":"array","items":{"type":"object","properties":{"receiptYear":{"type":"string"},"considerationMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"earnedInReceiptYearMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"grossIncludedThroughCloseMicroUsd":{"type":["string","null"],"pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"notYetIncludedMicroUsd":{"type":["string","null"],"pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"refundsThroughCloseMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"chargebacksThroughCloseMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."}},"required":["receiptYear","considerationMicroUsd","earnedInReceiptYearMicroUsd","grossIncludedThroughCloseMicroUsd","notYetIncludedMicroUsd","refundsThroughCloseMicroUsd","chargebacksThroughCloseMicroUsd"]}},"taxReceiptReconciliationDifferenceMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"refundTaxAdjustmentsByPaymentYear":{"type":"array","items":{"type":"object","properties":{"paymentYear":{"type":"string"},"amountMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"treatment":{"type":"string"}},"required":["paymentYear","amountMicroUsd","treatment"]}},"cash":{"type":"object","properties":{"grossReceiptsMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"salesTaxCollectedMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"salesTaxRefundedMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"processingFeesMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"stripeNetMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"stripeBalanceDifferenceMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"sourceReconciliation":{"type":"string","enum":["failed","passed"]}},"required":["grossReceiptsMicroUsd","salesTaxCollectedMicroUsd","salesTaxRefundedMicroUsd","processingFeesMicroUsd","stripeNetMicroUsd","stripeBalanceDifferenceMicroUsd","sourceReconciliation"]},"receiptsByJurisdiction":{"type":"array","items":{"type":"object","properties":{"country":{"type":["string","null"]},"state":{"type":["string","null"]},"considerationMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."},"taxCollectedMicroUsd":{"type":"string","pattern":"^-?\\d+$","description":"Exact integer. Monetary fields are micro-USD: 1 USD = 1,000,000 micro-USD."}},"required":["country","state","considerationMicroUsd","taxCollectedMicroUsd"]}}},"required":["month","periodStart","periodEnd","calendar","currency","moneyUnit","computeUnit","status","issues","policyId","taxMethod","receiptTimezone","allocationMethod","customerComputeCredits","deferredRevenue","taxableAdvancePaymentsByReceiptYear","taxReceiptReconciliationDifferenceMicroUsd","refundTaxAdjustmentsByPaymentYear","cash","receiptsByJurisdiction"]},"Capabilities":{"type":"object","properties":{"apiVersion":{"type":"string"},"authentication":{"type":"object","properties":{"apiKeys":{"type":"boolean"},"browserSessions":{"type":"boolean"},"browserTerminalCookieOnly":{"type":"boolean"}},"required":["apiKeys","browserSessions","browserTerminalCookieOnly"]},"containers":{"type":"object","properties":{"idempotentCreate":{"type":"boolean"},"creationRetentionMs":{"type":"integer","minimum":0},"generationRequired":{"type":"boolean"},"accountLimitsPath":{"type":"string"},"configurableDeadline":{"type":"boolean"}},"required":["idempotentCreate","creationRetentionMs","generationRequired","accountLimitsPath","configurableDeadline"]},"execution":{"type":"object","properties":{"foreground":{"type":"boolean"},"streaming":{"type":"boolean"},"background":{"type":"boolean"},"cancellation":{"type":"boolean"},"reconnect":{"type":"boolean"},"pty":{"type":"boolean"},"programmaticPty":{"type":"boolean"},"ptyResize":{"type":"boolean"},"stdin":{"type":"boolean"},"signals":{"type":"boolean"},"argv":{"type":"boolean"},"managedProcessListing":{"type":"boolean"},"processListing":{"type":"boolean"},"maxCommandBytes":{"type":"integer","minimum":0},"maxTimeoutMs":{"type":"integer","minimum":0},"maxOutputBytes":{"type":"integer","minimum":0},"maxConcurrentOperations":{"type":"integer","minimum":0},"maxManagedTimeoutMs":{"type":"integer","minimum":0},"retentionMs":{"type":"integer","minimum":0},"maxRetainedExecutions":{"type":"integer","minimum":0},"maxRetainedOutputBytes":{"type":"integer","minimum":0},"maxRetainedEvents":{"type":"integer","minimum":0},"retentionScope":{"type":"string","enum":["container-slot"]},"maxStdinChunkBytes":{"type":"integer","minimum":0},"maxStdinBytes":{"type":"integer","minimum":0},"maxPendingStdinBytes":{"type":"integer","minimum":0}},"required":["foreground","streaming","background","cancellation","reconnect","pty","programmaticPty","ptyResize","stdin","signals","argv","managedProcessListing","processListing","maxCommandBytes","maxTimeoutMs","maxOutputBytes","maxConcurrentOperations","maxManagedTimeoutMs","retentionMs","maxRetainedExecutions","maxRetainedOutputBytes","maxRetainedEvents","retentionScope","maxStdinChunkBytes","maxStdinBytes","maxPendingStdinBytes"]},"codeInterpreter":{"type":"object","properties":{"supported":{"type":"boolean"},"languages":{"type":"array","items":{"type":"string","enum":["python"]}},"stateful":{"type":"boolean"},"memoryPersistence":{"type":"boolean"},"maxCodeBytes":{"type":"integer","minimum":0},"maxTimeoutMs":{"type":"integer","minimum":0},"maxContextMs":{"type":"integer","minimum":0},"maxResultBytes":{"type":"integer","minimum":0}},"required":["supported","languages","stateful","memoryPersistence","maxCodeBytes","maxTimeoutMs","maxContextMs","maxResultBytes"]},"pools":{"type":"object","properties":{"managed":{"type":"boolean"},"sdkPrewarming":{"type":"boolean"},"maxPools":{"type":"integer","minimum":0},"maxPoolSize":{"type":"integer","minimum":0},"maxTtlSeconds":{"type":"integer","minimum":0}},"required":["managed","sdkPrewarming","maxPools","maxPoolSize","maxTtlSeconds"]},"files":{"type":"object","properties":{"streamingTransfers":{"type":"boolean"},"read":{"type":"boolean"},"write":{"type":"boolean"},"binary":{"type":"boolean"},"atomicReplacement":{"type":"boolean"},"list":{"type":"boolean"},"stat":{"type":"boolean"},"mkdir":{"type":"boolean"},"delete":{"type":"boolean"},"move":{"type":"boolean"},"chmod":{"type":"boolean"},"watch":{"type":"boolean"},"sharedExecutionPool":{"type":"boolean"},"maxTransferBytes":{"type":"integer","minimum":0},"transferTimeoutMs":{"type":"integer","minimum":0},"maxFileBytes":{"type":"integer","minimum":0},"maxPathBytes":{"type":"integer","minimum":0},"timeoutMs":{"type":"integer","minimum":0},"maxDirectoryEntries":{"type":"integer","minimum":0},"maxDirectoryOffset":{"type":"integer","minimum":0},"maxMetadataBytes":{"type":"integer","minimum":0}},"required":["streamingTransfers","read","write","binary","atomicReplacement","list","stat","mkdir","delete","move","chmod","watch","sharedExecutionPool","maxTransferBytes","transferTimeoutMs","maxFileBytes","maxPathBytes","timeoutMs","maxDirectoryEntries","maxDirectoryOffset","maxMetadataBytes"]},"persistence":{"type":"object","properties":{"startupConfiguration":{"type":"boolean"},"restoreLaunch":{"type":"boolean"},"filesystemAfterStop":{"type":"boolean"},"filesystemFork":{"type":"boolean"},"snapshots":{"type":"boolean"},"workspaces":{"type":"boolean"},"exports":{"type":"boolean"},"memory":{"type":"boolean"},"volumes":{"type":"boolean"}},"required":["startupConfiguration","restoreLaunch","filesystemAfterStop","filesystemFork","snapshots","workspaces","exports","memory","volumes"]},"observability":{"type":"object","properties":{"lifecycleEvents":{"type":"boolean"},"metrics":{"type":"boolean"},"webhooks":{"type":"boolean"},"otlp":{"type":"boolean"},"activityWebSocket":{"type":"boolean"},"eventRetentionMs":{"type":"integer","minimum":0},"maxLifecycleEvents":{"type":"integer","minimum":0},"maxMetricRangeMs":{"type":"integer","minimum":0},"metricBucketMs":{"type":"integer","minimum":0}},"required":["lifecycleEvents","metrics","webhooks","otlp","activityWebSocket","eventRetentionMs","maxLifecycleEvents","maxMetricRangeMs","metricBucketMs"]},"previews":{"type":"object","properties":{"supported":{"type":"boolean"},"signedUrls":{"type":"boolean"}},"required":["supported","signedUrls"]},"projects":{"type":"object","properties":{"supported":{"type":"boolean"},"customDomains":{"type":"boolean"},"localDevelopment":{"type":"boolean"},"apexIps":{"type":"array","items":{"type":"string"}}},"required":["supported","customDomains","localDevelopment","apexIps"]},"images":{"type":"object","properties":{"tags":{"type":"boolean"},"catalog":{"type":"boolean"},"availableCatalogPath":{"type":"string"},"repositoryLaunch":{"type":"boolean"},"customBuilds":{"type":"boolean"},"crossBuildCache":{"type":"boolean"},"privateRegistryImports":{"type":"boolean"},"limits":{"type":"object","properties":{"maxBuildsPerMonth":{"type":"integer","minimum":0},"maxSavedImages":{"type":"integer","minimum":0},"maxContextBytes":{"type":"integer","minimum":0},"maxDockerfileBytes":{"type":"integer","minimum":0},"maxBuildSeconds":{"type":"integer","minimum":0},"maxTags":{"type":"integer","minimum":0}},"required":["maxBuildsPerMonth","maxSavedImages","maxContextBytes","maxDockerfileBytes","maxBuildSeconds","maxTags"]}},"required":["tags","catalog","availableCatalogPath","repositoryLaunch","customBuilds","crossBuildCache","privateRegistryImports","limits"]},"resources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["lite","small","medium","large","xl"]},"name":{"type":"string"},"instance":{"type":"string"},"cpuVcpu":{"type":"number"},"memoryMiB":{"type":"number"},"diskGB":{"type":"number"},"computeUnits":{"type":"number"}},"required":["id","name","instance","cpuVcpu","memoryMiB","diskGB","computeUnits"]}},"networking":{"type":"object","properties":{"outboundInternet":{"type":"boolean"},"internetControl":{"type":"boolean"},"privateServices":{"type":"boolean"},"egressPolicies":{"type":"boolean"},"regionSelection":{"type":"boolean"}},"required":["outboundInternet","internetControl","privateServices","egressPolicies","regionSelection"]},"secrets":{"type":"object","properties":{"vault":{"type":"boolean"}},"required":["vault"]},"access":{"type":"object","properties":{"maxTerminalConnections":{"type":"integer","minimum":0},"maxSSHAccessTokens":{"type":"integer","minimum":0},"sshTokenLifetimeMs":{"type":"integer","minimum":0}},"required":["maxTerminalConnections","maxSSHAccessTokens","sshTokenLifetimeMs"]}},"required":["apiVersion","authentication","containers","execution","codeInterpreter","pools","files","persistence","observability","previews","projects","images","resources","networking","secrets","access"]},"Execution":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","format":"date-time"},"finishedAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["starting","running","succeeded","failed","canceled","timed_out","output_limit","interrupted"]},"retainUntil":{"type":"integer"},"cursor":{"type":"integer","minimum":0},"outputBytes":{"type":"integer","minimum":0},"exitCode":{"type":["integer","null"]},"timedOut":{"type":"boolean"},"outputTruncated":{"type":"boolean"},"stdinEnabled":{"type":"boolean"},"stdinClosed":{"type":"boolean"},"stdinBytes":{"type":"integer","minimum":0},"pty":{"type":"object","properties":{"cols":{"type":"integer","minimum":1,"maximum":1000},"rows":{"type":"integer","minimum":1,"maximum":1000}},"required":["cols","rows"],"additionalProperties":false}},"required":["id","createdAt","startedAt","status","retainUntil","cursor","outputBytes","exitCode","timedOut","outputTruncated"]},"CodeContext":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"language":{"type":"string","enum":["python"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"integer"}},"required":["id","language","createdAt","expiresAt"]},"CodeResult":{"type":"object","properties":{"stdout":{"type":"string"},"stderr":{"type":"string"},"outputTruncated":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","properties":{"mimeType":{"type":"string","enum":["text/plain","application/json","text/html","image/png"]},"data":{"type":"string"}},"required":["mimeType","data"]},"maxItems":4},"error":{"type":["object","null"],"properties":{"name":{"type":"string"},"message":{"type":"string"},"traceback":{"type":"string"}},"required":["name","message","traceback"]}},"required":["stdout","stderr","outputTruncated","results","error"]},"PreviewGrant":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{32}$"},"port":{"type":"integer","minimum":1024,"maximum":65535},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"integer"}},"required":["id","port","createdAt","expiresAt"]},"PrivateServiceNetwork":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$"},"lifecycle":{"type":"string","enum":["ad_hoc","production"]},"members":{"type":"array","items":{"$ref":"#/components/schemas/PrivateServiceMember"},"maxItems":32}},"required":["name","members"]},"PrivateServiceMember":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"name":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$"},"port":{"type":"integer","minimum":1024,"maximum":65535}},"required":["id","createdAt","name"],"additionalProperties":false},"Workspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":80},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"integer"},"source":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","createdAt"]},"size":{"type":"string","enum":["lite","small","medium","large","xl"]},"internet":{"type":"boolean"},"networkPolicy":{"type":"object","properties":{"allow":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":64},"deny":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":64}},"required":["allow"],"additionalProperties":false,"description":"HTTP/HTTPS egress on ports 80/443. Exact domains, *.domain, IPv4/IPv6 CIDR or *; deny wins. Hostname DNS lookup requires a matching domain allow rule; CIDR-only grants apply to literal IP requests. All resolved addresses must be public and allowed. Other protocols/ports and redirects are denied."},"secretBindings":{"type":"array","items":{"type":"string"}},"imageDigest":{"type":"string"},"imageId":{"type":"string"},"imageName":{"type":"string"},"catalogId":{"type":"string"},"bytes":{"type":["integer","null"],"minimum":0},"reservedBytes":{"type":"integer","minimum":0,"description":"Source disk capacity reserved against the live saved-workspace quota; zero after expiry or deletion."},"archived":{"type":"boolean"},"status":{"type":"string","enum":["saving","ready","failed","expired","deleted"]},"stopRequested":{"type":"boolean"},"stopCompleted":{"type":"boolean"},"launch":{"type":"object","properties":{"command":{"type":"string","minLength":1,"maxLength":4096,"pattern":"^[^\\u0000]+$","description":"Shell source up to 4096 characters; multiline commands are allowed. NUL bytes are rejected."},"cwd":{"type":"string","minLength":1,"maxLength":1024,"description":"Absolute working directory without dot segments; defaults to /workspace."},"readiness":{"type":"object","properties":{"port":{"type":"integer","minimum":1024,"maximum":65535},"path":{"type":"string","minLength":1,"maxLength":1024,"description":"Local HTTP path, default /. Redirects are not followed."},"timeoutMs":{"type":"integer","minimum":1000,"maximum":60000,"description":"Readiness deadline after machine boot, default 30000 ms."}},"required":["port"],"additionalProperties":false}},"required":["command","readiness"],"additionalProperties":false,"description":"Saved foreground shell launch recipe. No raw environment values or new secret semantics. Runs once in each restored filesystem generation."}},"required":["id","name","createdAt","expiresAt","source","size","internet","imageDigest","bytes","reservedBytes","archived","status","stopRequested","stopCompleted"]},"NativeTokens":{"type":"object","properties":{"access_token":{"type":"string"},"refresh_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"number"},"user":{"$ref":"#/components/schemas/PublicUser"}},"required":["access_token","refresh_token","token_type","expires_in","user"]},"ProjectTarget":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["container"]},"id":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"port":{"type":"integer","minimum":1024,"maximum":65535}},"required":["kind","id","createdAt","port"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["network"]},"network":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$"},"service":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$"}},"required":["kind","network","service"],"additionalProperties":false},{"type":"null"}]},"ProjectDomain":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"hostname":{"type":"string"},"status":{"type":"string","enum":["pending_dns","pending_tls","active","error"]},"dnsStatus":{"type":"string","enum":["pending","verified"]},"tlsStatus":{"type":"string","enum":["pending","active","error"]},"dnsRecords":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"value":{"type":"string"},"purpose":{"type":"string","enum":["ownership","routing","certificate"]}},"required":["type","name","value","purpose"]}},"apexRecords":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"value":{"type":"string"},"purpose":{"type":"string","enum":["ownership","routing","certificate"]}},"required":["type","name","value","purpose"]}},"routingNote":{"type":"string"},"error":{"type":["string","null"]}},"required":["id","hostname","status","dnsStatus","tlsStatus","dnsRecords","error"]},"SubscriptionState":{"type":"object","properties":{"subscription":{"type":["object","null"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"cancel_at_period_end":{"type":"boolean"}},"required":["id","status","cancel_at_period_end"],"additionalProperties":{}},"trial":{"type":["object","null"],"properties":{"plan":{"type":"string","enum":["usage","builder","pro","scale"]},"expires_at":{"type":"number","description":"Unix milliseconds; access ends automatically without charges."}},"required":["plan","expires_at"]},"plan":{"type":["string","null"],"enum":["usage","builder","pro","scale",null]},"active":{"type":"boolean"},"valid_until":{"type":["number","null"],"description":"Unix milliseconds."},"pro":{"type":"boolean"},"configured":{"type":"boolean"},"scheduled_plan":{"type":["string","null"],"enum":["usage","builder","pro","scale",null]},"scheduled_change_at":{"type":["number","null"],"description":"Unix seconds."}},"required":["subscription","trial","plan","active","valid_until","pro","configured","scheduled_plan","scheduled_change_at"]},"PrepaidHistory":{"type":"object","properties":{"storage":{"$ref":"#/components/schemas/StorageBillingSummary"},"asOf":{"type":"number"},"balance":{"$ref":"#/components/schemas/PrepaidBalance"},"totals":{"type":"object","properties":{"fundedCents":{"type":"number"},"revokedCents":{"type":"number"},"usedCents":{"type":"number"},"unattributedUsedCents":{"type":"number"},"inferenceUsedCents":{"type":"number"},"storageUsedCents":{"type":"number"}},"required":["fundedCents","revokedCents","usedCents","unattributedUsedCents","inferenceUsedCents","storageUsedCents"]},"currentHourlyCents":{"type":"number"},"activeResources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"containerId":{"type":"string"},"name":{"type":["string","null"]},"lifecycle":{"type":"string","enum":["ad_hoc","production"]},"size":{"type":"string","enum":["lite","small","medium","large","xl"]},"startAt":{"type":"number"},"endAt":{"type":["number","null"]},"runtimeMs":{"type":"number"},"computeUnitHours":{"type":"number"},"usedCents":{"type":"number"},"reservedCents":{"type":"number"},"hourlyCents":{"type":"number"},"active":{"type":"boolean"}},"required":["id","containerId","name","lifecycle","size","startAt","endAt","runtimeMs","computeUnitHours","usedCents","reservedCents","hourlyCents","active"]}},"resources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"containerId":{"type":"string"},"name":{"type":["string","null"]},"lifecycle":{"type":"string","enum":["ad_hoc","production"]},"size":{"type":"string","enum":["lite","small","medium","large","xl"]},"startAt":{"type":"number"},"endAt":{"type":["number","null"]},"runtimeMs":{"type":"number"},"computeUnitHours":{"type":"number"},"usedCents":{"type":"number"},"reservedCents":{"type":"number"},"hourlyCents":{"type":"number"},"active":{"type":"boolean"}},"required":["id","containerId","name","lifecycle","size","startAt","endAt","runtimeMs","computeUnitHours","usedCents","reservedCents","hourlyCents","active"]}},"fundings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"number"},"amountCents":{"type":"number"},"revokedCents":{"type":"number"},"reason":{"type":["string","null"],"enum":["refund","dispute",null]}},"required":["id","createdAt","amountCents","revokedCents","reason"]}},"nextResourceCursor":{"type":["string","null"]},"nextFundingCursor":{"type":["string","null"]},"historyTruncated":{"type":"boolean"},"retainedResourceLimit":{"type":"number","enum":[256]}},"required":["asOf","balance","totals","currentHourlyCents","activeResources","resources","fundings","nextResourceCursor","nextFundingCursor","historyTruncated","retainedResourceLimit"]},"StorageBillingSummary":{"type":"object","properties":{"month":{"type":"string"},"maxBytes":{"type":"number"},"retention":{"$ref":"#/components/schemas/StorageRetention"},"pricing":{"type":"object","properties":{"mode":{"type":"string","enum":["off","meter","charge"]},"markupBps":{"type":"number"},"maxBytes":{"type":"number"},"chargeFrom":{"type":["number","null"]},"storageUsdPerGbMonth":{"type":"number","enum":[0.015]},"classAUsdPerMillion":{"type":"number","enum":[4.5]},"classBUsdPerMillion":{"type":"number","enum":[0.36]},"retentionDays":{"type":"number","enum":[30]}},"required":["mode","markupBps","maxBytes","chargeFrom","storageUsdPerGbMonth","classAUsdPerMillion","classBUsdPerMillion","retentionDays"]},"projects":{"type":"array","items":{"type":"object","properties":{"appId":{"type":"string"},"exportUrl":{"type":"string"},"sourceExportUrl":{"type":"string"},"name":{"type":["string","null"]},"storedBytes":{"type":"number"},"sourceAssetsBytes":{"type":"number"},"historyBytes":{"type":"number"},"chargedCents":{"type":"number"},"estimatedMonthlyCents":{"type":"number"},"cloudflareCents":{"type":"number"},"markupCents":{"type":"number"},"adjustmentCents":{"type":"number"},"writes":{"type":"number"},"reads":{"type":"number"},"fundedThrough":{"type":["number","null"]},"writesBlocked":{"type":"boolean"}},"required":["appId","exportUrl","sourceExportUrl","name","storedBytes","sourceAssetsBytes","historyBytes","chargedCents","estimatedMonthlyCents","cloudflareCents","markupCents","adjustmentCents","writes","reads","fundedThrough","writesBlocked"]}}},"required":["month","maxBytes","retention","pricing","projects"]},"ContainerStatus":{"type":"object","properties":{"plan":{"type":["string","null"],"enum":["usage","builder","pro","scale",null]},"active":{"type":"boolean"},"containers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"size":{"type":"string","enum":["lite","small","medium","large","xl"]},"computeUnits":{"type":"number"},"instance":{"type":"string","enum":["lite","standard-1","standard-2","standard-3","standard-4"]},"status":{"type":"string","enum":["starting","running","stopped"]},"lifecycle":{"type":"string","enum":["ad_hoc","production"]},"stopReason":{"type":"string"},"internet":{"type":"boolean","description":"Immutable outbound internet selection; true for legacy generations."},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"imageId":{"type":"string"},"imageName":{"type":"string"},"catalogId":{"type":"string"},"networkPolicy":{"type":"object","properties":{"allow":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":64},"deny":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":64}},"required":["allow"],"additionalProperties":false,"description":"HTTP/HTTPS egress on ports 80/443. Exact domains, *.domain, IPv4/IPv6 CIDR or *; deny wins. Hostname DNS lookup requires a matching domain allow rule; CIDR-only grants apply to literal IP requests. All resolved addresses must be public and allowed. Other protocols/ports and redirects are denied."},"secretBindings":{"type":"array","items":{"type":"string","pattern":"^sec_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"maxItems":16},"workspaceId":{"type":"string","format":"uuid"},"persistenceExpiresAt":{"type":"integer","description":"Saved filesystem expiry in Unix milliseconds for a stopped machine."},"imageDigest":{"type":"string","description":"Deployment-resolved immutable image reference for this generation; absent on older generations."},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["starting","ready","failed"]},"port":{"type":"integer"},"path":{"type":"string"},"logPath":{"type":"string"},"checkedAt":{"type":"string","format":"date-time"},"error":{"type":"string","enum":["launch_exited","readiness_timeout"]},"logTail":{"type":"string","description":"At most 8192 UTF-8 bytes of application diagnostics on failure; authenticated account data."}},"required":["status","port","path","logPath"]},"launch":{"type":"object","properties":{"command":{"type":"string","minLength":1,"maxLength":4096,"pattern":"^[^\\u0000]+$","description":"Shell source up to 4096 characters; multiline commands are allowed. NUL bytes are rejected."},"cwd":{"type":"string","minLength":1,"maxLength":1024,"description":"Absolute working directory without dot segments; defaults to /workspace."},"readiness":{"type":"object","properties":{"port":{"type":"integer","minimum":1024,"maximum":65535},"path":{"type":"string","minLength":1,"maxLength":1024,"description":"Local HTTP path, default /. Redirects are not followed."},"timeoutMs":{"type":"integer","minimum":1000,"maximum":60000,"description":"Readiness deadline after machine boot, default 30000 ms."}},"required":["port"],"additionalProperties":false}},"required":["command","readiness"],"additionalProperties":false,"description":"Recipe for future filesystem restores. Setting this does not launch or restart the current application."}},"required":["id","name","size","computeUnits","instance","status","createdAt","expiresAt"]}},"billing":{"type":["object","null"],"properties":{"periodStart":{"type":"number"},"periodEnd":{"type":"number"},"computeUnitHours":{"type":"number"},"estimatedCents":{"type":"number"},"minimumCents":{"type":"number"},"spendLimitCents":{"type":"number"},"committedCents":{"type":"number"},"alert":{"anyOf":[{"type":"number","enum":[50]},{"type":"number","enum":[80]},{"type":"number","enum":[100]},{"type":"null"}]},"overagesEnabled":{"type":"boolean"},"invoicingPending":{"type":"boolean"},"balanceCents":{"type":"number"},"availableBalanceCents":{"type":"number"},"reservedBalanceCents":{"type":"number"},"currency":{"type":"string","enum":["usd"]},"monthlyUsageCents":{"type":"number"},"productionHourlyCents":{"type":"number"},"fundedRuntimeMs":{"type":["number","null"]},"minimumProductionRuntimeMs":{"type":"number","enum":[86400000]},"autoRecharge":{"type":"object","properties":{"enabled":{"type":"boolean"},"amountCents":{"type":"integer","minimum":500,"maximum":100000,"description":"USD cents."},"monthlyLimitCents":{"type":"integer","minimum":500,"maximum":100000,"description":"USD cents."},"spentCents":{"type":"number"},"status":{"type":"string"}},"required":["enabled","amountCents","monthlyLimitCents","spentCents","status"]}},"required":["periodStart","periodEnd","computeUnitHours","estimatedCents","minimumCents","spendLimitCents","committedCents","alert","overagesEnabled","invoicingPending"]},"limits":{"type":"object","properties":{"maxComputeUnitHours":{"type":["number","null"]},"maxConcurrentComputeUnits":{"type":"number"},"maxContainers":{"type":"number"},"maxStartsPerMonth":{"type":"number"},"maxSessionMs":{"type":"number"},"idleTimeoutMs":{"type":"number"}},"required":["maxComputeUnitHours","maxConcurrentComputeUnits","maxContainers","maxStartsPerMonth","maxSessionMs","idleTimeoutMs"]},"usage":{"type":"object","properties":{"month":{"type":"string"},"starts":{"type":"number"},"computeUnitHours":{"type":"number"},"reservedComputeUnitHours":{"type":"number"},"availableComputeUnitHours":{"type":"number"},"concurrentComputeUnits":{"type":"number"}},"required":["month","starts","computeUnitHours","reservedComputeUnitHours","availableComputeUnitHours","concurrentComputeUnits"]},"sizes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["lite","small","medium","large","xl"]},"name":{"type":"string"},"instance":{"type":"string"},"cpuVcpu":{"type":"number"},"memoryMiB":{"type":"number"},"diskGB":{"type":"number"},"computeUnits":{"type":"number"}},"required":["id","name","instance","cpuVcpu","memoryMiB","diskGB","computeUnits"]}},"imageCatalog":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["plan","active","containers","billing","limits","usage","sizes","imageCatalog"]},"SecretMetadata":{"type":"object","properties":{"id":{"type":"string","pattern":"^sec_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"name":{"type":"string","minLength":1,"maxLength":80},"hostname":{"type":"string"},"header":{"type":"string","enum":["authorization","x-api-key","api-key"]},"prefix":{"type":"string","maxLength":32},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","hostname","header","prefix","createdAt","updatedAt"]},"ManagedPool":{"type":"object","properties":{"id":{"type":"string","pattern":"^pool_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\u0000-\\u001f\\u007f]+$"},"targetSize":{"type":"integer","minimum":0,"maximum":20},"ready":{"type":"integer","minimum":0},"starting":{"type":"integer","minimum":0},"status":{"type":"string","enum":["active","paused","expired","deleting","degraded"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"selection":{"type":"object","properties":{"size":{"type":"string","enum":["lite","small","medium","large","xl"]},"internet":{"type":"boolean"},"catalogId":{"type":"string"},"imageId":{"type":"string"},"networkPolicy":{"type":"object","properties":{"allow":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":64},"deny":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":64}},"required":["allow"],"additionalProperties":false,"description":"HTTP/HTTPS egress on ports 80/443. Exact domains, *.domain, IPv4/IPv6 CIDR or *; deny wins. Hostname DNS lookup requires a matching domain allow rule; CIDR-only grants apply to literal IP requests. All resolved addresses must be public and allowed. Other protocols/ports and redirects are denied."},"secretBindings":{"type":"array","items":{"type":"string","pattern":"^sec_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"maxItems":16}},"required":["size","internet"]},"lastError":{"type":"string"}},"required":["id","name","targetSize","ready","starting","status","createdAt","updatedAt","expiresAt","selection"]},"FileEntry":{"type":"object","properties":{"name":{"type":"string"},"path":{"type":"string"},"type":{"type":"string","enum":["file","directory","symlink","fifo","socket","character","block","other"]},"size":{"type":"integer","minimum":0},"mode":{"type":"string"},"uid":{"type":"integer","minimum":0},"gid":{"type":"integer","minimum":0},"modifiedAt":{"type":"string","format":"date-time"},"linkTarget":{"type":"string"}},"required":["name","path","type","size","mode","uid","gid","modifiedAt"]},"Image":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["queued","building","publishing","ready","failed"]},"digest":{"type":["string","null"]},"baseImage":{"type":["string","null"]},"cacheFrom":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","status","createdAt","updatedAt"]}},"parameters":{}},"paths":{"/repo-launches/resolve":{"get":{"operationId":"resolvePublicRepository","tags":["Containers"],"summary":"Validate an accessible GitHub repository and suggest a runtime","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Read-only. Resolves a branch, tag or commit to an immutable commit and detects manifests in cwd. Public lookups use an optional server-side token. Private repositories require an owner-scoped read-only Import app connection; user tokens enforce the intersection of user and app access. Inaccessible repositories may be private and return a connection/access error. No payment, allocation or execution. GitHub rate limits may return 429. GitHub redirects are not followed and return github_unavailable (503).","parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,38}\\/[A-Za-z0-9_.-]{1,100}$"},"required":true,"name":"repo","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"ref","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"cwd","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResolvedRepository"},{"type":"object","properties":{"suggestedConfiguration":{"type":"object","properties":{"repo":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,38}\\/[A-Za-z0-9_.-]{1,100}$"},"ref":{"type":"string","minLength":1,"maxLength":200},"catalogId":{"type":"string","enum":["node","python","rust","go","devops"]},"imageId":{"type":"string","format":"uuid"},"size":{"type":"string","enum":["lite","small","medium","large","xl"],"default":"small"},"cwd":{"type":"string","maxLength":200,"default":"."},"setupCommand":{"type":"string","minLength":1,"maxLength":4096},"startCommand":{"type":"string","minLength":1,"maxLength":4096},"port":{"type":"integer","minimum":1024,"maximum":65535},"readinessPath":{"type":"string","minLength":1,"maxLength":1024}},"required":["repo"],"additionalProperties":false}}}]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/repo-launches":{"post":{"operationId":"createRepositoryLaunch","tags":["Containers"],"summary":"Create an owner-scoped repository launch","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Requires paid or trial access and a stable Idempotency-Key. Validates and resolves the public GitHub repository before recording a launch, using an optional server-side GitHub token. No allocation until advance. Small is the default size; cwd is relative to /workspace/repo. Optional imageId selects an owned ready custom image, requires images.repositoryLaunch and is mutually exclusive with catalogId. Existing image selection is independent of images.customBuilds. Ownership/readiness are checked before repository resolution and again before allocation. The immutable image ID is part of the keyed launch options; no fallback to a catalog image. Custom images must provide git for cloning and curl for preview checks in addition to the managed runtime tools. This consumes an already built compatible image; it does not build arbitrary repository Dockerfiles or run Compose. Setup and start commands execute only after explicit launch. Supply startCommand and port together. Optional readinessPath is a local HTTP path, defaults to /, and must return 2xx; redirects are not followed or accepted. Use /health or another 2xx endpoint for an app whose root redirects. Each recipient creates a private launch in their own account. Repeated keys return the original launch; conflicting options return 409. Server-side repo_launch_request_failed logs include the failing stage and dependency diagnostics; HTTP errors contain only the error code.","parameters":[{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"required":true,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"repo":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,38}\\/[A-Za-z0-9_.-]{1,100}$"},"ref":{"type":"string","minLength":1,"maxLength":200},"catalogId":{"type":"string","enum":["node","python","rust","go","devops"]},"imageId":{"type":"string","format":"uuid"},"size":{"type":"string","enum":["lite","small","medium","large","xl"],"default":"small"},"cwd":{"type":"string","maxLength":200,"default":"."},"setupCommand":{"type":"string","minLength":1,"maxLength":4096},"startCommand":{"type":"string","minLength":1,"maxLength":4096},"port":{"type":"integer","minimum":1024,"maximum":65535},"readinessPath":{"type":"string","minLength":1,"maxLength":1024}},"required":["repo"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoryLaunch"}}}},"201":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoryLaunch"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/repo-launches/{launchId}":{"get":{"operationId":"getRepositoryLaunch","tags":["Containers"],"summary":"Read an owned repository launch","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Read-only persisted progress, exact generation and retained execution IDs. No allocation or replay. Execution logs use the existing executions API; preview URLs use the existing previews API and are never persisted in launch records.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"launchId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoryLaunch"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/repo-launches/{launchId}/advance":{"post":{"operationId":"advanceRepositoryLaunch","tags":["Containers"],"summary":"Advance or reconcile an owned repository launch","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Repeat to resume after refresh. Uses a durable lease and stable allocation/execution keys, pins the exact container generation, and inspects retained executions before advancing. Never silently reruns failed setup. After idempotency retention expires, uncertain operations require manual reconciliation. Creates the main tmux shell in /workspace/repo before setup. Preview servers run in a separate tmux session under existing idle/hard deadlines; readiness checks HTTP for up to three minutes. Before starting, deployments with workspace persistence register a replayable foreground start command, cwd and port for future Stop/Resume and Fork. restoreLaunchConfigured is false for deployments without persistence or commands that cannot fit the 4096-character recipe contract. Restores start a fresh process; setup is not rerun and RAM is not copied. Failed setup/start preserves the shell. Active plan required to advance; GET remains available without paid access.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"launchId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoryLaunch"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/github/import/config":{"get":{"operationId":"getGithubImportConfig","tags":["Authentication"],"summary":"Check read-only GitHub Import availability","security":[],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/github/import/connect":{"post":{"operationId":"connectGithubImport","tags":["Authentication"],"summary":"Connect the read-only Import app for selected repositories","security":[{"cookieAuth":[]}],"description":"Browser session and trusted Origin required. Creates an owner-bound, one-use state and PKCE challenge. Returns GitHub authorization or installation URL; never tokens. No payment or allocation. Separate from future write-capable Build integration.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"repo":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,38}\\/[A-Za-z0-9_.-]{1,100}$"},"returnTo":{"type":"string"},"reauthorize":{"type":"boolean"}},"required":["repo"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/github/import/connection":{"get":{"operationId":"getGithubImportConnection","tags":["Authentication"],"summary":"Read the current account’s GitHub Import connection","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean"},"login":{"type":["string","null"]},"manageUrl":{"type":"string","format":"uri"}},"required":["connected","login","manageUrl"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"disconnectGithubImport","tags":["Authentication"],"summary":"Remove stored GitHub Import credentials","security":[{"cookieAuth":[]}],"description":"Browser session and trusted Origin required. Deletes encrypted credentials and pending states. Does not uninstall the GitHub App or erase existing checkouts; manage installations in GitHub and stop/delete saved workspaces separately.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/github/import/callback":{"get":{"operationId":"finishGithubImportAuthorization","tags":["Authentication"],"summary":"Finish GitHub Import authorization","security":[{"cookieAuth":[]}],"description":"Requires the same Mainbrella account and owner-bound, one-use, unexpired state. Authorization exchanges a code with PKCE and encrypts credentials server-side. Installation IDs never authorize repository access. Redirects only to the stored trusted /run/ destination.","parameters":[{"schema":{"type":"string"},"required":true,"name":"state","in":"query"},{"schema":{"type":"string"},"required":false,"name":"code","in":"query"},{"schema":{"type":"string"},"required":false,"name":"error","in":"query"},{"schema":{"type":"string"},"required":false,"name":"installation_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"setup_action","in":"query"}],"responses":{"302":{"description":"Continue to GitHub installation or return to repository setup.","headers":{"Location":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/github/import/setup":{"get":{"operationId":"finishGithubImportInstallation","tags":["Authentication"],"summary":"Return from GitHub Import installation","security":[{"cookieAuth":[]}],"description":"Requires the same Mainbrella account and owner-bound, one-use, unexpired state. Authorization exchanges a code with PKCE and encrypts credentials server-side. Installation IDs never authorize repository access. Redirects only to the stored trusted /run/ destination.","parameters":[{"schema":{"type":"string"},"required":true,"name":"state","in":"query"},{"schema":{"type":"string"},"required":false,"name":"code","in":"query"},{"schema":{"type":"string"},"required":false,"name":"error","in":"query"},{"schema":{"type":"string"},"required":false,"name":"installation_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"setup_action","in":"query"}],"responses":{"302":{"description":"Continue to GitHub installation or return to repository setup.","headers":{"Location":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/github/build/config":{"get":{"operationId":"getGithubBuildConfig","tags":["Authentication"],"summary":"Check write-capable GitHub Build availability","security":[],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/github/build/connect":{"post":{"operationId":"connectGithubBuild","tags":["Authentication"],"security":[{"cookieAuth":[]}],"summary":"Install and authorize the write-capable Build app for a project","description":"Requires a browser session and trusted Origin. Omit repo and branch to start at GitHub installation, where the user selects a personal account or organization and grants access to all or selected repositories. Installation is followed by user authorization with PKCE, then returns to the project repository picker. Optional repo and branch preserve the previous repository-specific flow. State is owner-bound, one-use, and expiring. Return query values must match this request. Installation IDs never authorize access. Credentials are encrypted and never returned.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"repo":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,38}\\/[A-Za-z0-9_.-]{1,100}$"},"branch":{"type":"string"},"returnTo":{"type":"string","maxLength":1024,"pattern":"^\\/projects\\/","description":"Same-origin /projects/ destination. Only githubProject and matching optional githubRepo/githubBranch are accepted."},"reauthorize":{"type":"boolean"}},"required":["projectId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/github/build/connection":{"get":{"operationId":"getGithubBuildConnection","tags":["Authentication"],"summary":"Read the current account’s GitHub Build connection","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean"},"login":{"type":["string","null"]},"manageUrl":{"type":"string","format":"uri"}},"required":["connected","login","manageUrl"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/github/build/repositories":{"get":{"operationId":"listGithubBuildRepositories","tags":["Projects"],"security":[{"cookieAuth":[]}],"summary":"List writable repositories available to the GitHub Build connection","description":"Uses only the signed-in user’s Build token. Lists repositories from active installations with Contents write access, filtered to repositories where the user can push. Archived, disabled, suspended, and read-only repositories are excluded. Pass nextCursor back to continue across repository pages and installations; a page can be empty while nextCursor is present. Repository linking independently verifies write access.","parameters":[{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"repositories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"fullName":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,38}\\/[A-Za-z0-9_.-]{1,100}$"},"defaultBranch":{"type":"string"},"private":{"type":"boolean"}},"required":["id","fullName","defaultBranch","private"]}},"nextCursor":{"type":["string","null"]}},"required":["repositories","nextCursor"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/github/build/callback":{"get":{"operationId":"finishGithubBuildAuthorization","tags":["Authentication"],"summary":"Finish GitHub Build authorization","security":[{"cookieAuth":[]}],"description":"Requires the same Mainbrella account and an owner-bound, one-use, unexpired state. Authorization exchanges a code with PKCE and encrypts credentials server-side. Installation IDs are navigation hints only. Redirects only to the stored /projects/ destination.","parameters":[{"schema":{"type":"string"},"required":true,"name":"state","in":"query"},{"schema":{"type":"string"},"required":false,"name":"code","in":"query"},{"schema":{"type":"string"},"required":false,"name":"error","in":"query"},{"schema":{"type":"string"},"required":false,"name":"installation_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"setup_action","in":"query"}],"responses":{"302":{"description":"Continue to GitHub installation or return to the project page.","headers":{"Location":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/github/build/setup":{"get":{"operationId":"finishGithubBuildInstallation","tags":["Authentication"],"summary":"Return from GitHub Build installation","security":[{"cookieAuth":[]}],"description":"Requires the same Mainbrella account and an owner-bound, one-use, unexpired state. Authorization exchanges a code with PKCE and encrypts credentials server-side. Installation IDs are navigation hints only. Redirects only to the stored /projects/ destination.","parameters":[{"schema":{"type":"string"},"required":true,"name":"state","in":"query"},{"schema":{"type":"string"},"required":false,"name":"code","in":"query"},{"schema":{"type":"string"},"required":false,"name":"error","in":"query"},{"schema":{"type":"string"},"required":false,"name":"installation_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"setup_action","in":"query"}],"responses":{"302":{"description":"Continue to GitHub installation or return to the project page.","headers":{"Location":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/projects/github/storage":{"delete":{"operationId":"deleteProjectHostedStorage","tags":["Projects"],"summary":"Delete the Mainbrella copy of a GitHub-linked project","security":[{"cookieAuth":[]}],"description":"Requires a trusted Origin and browser session. Verifies that current working source and referenced generated assets are already pushed to the linked GitHub branch; Generated assets are compared as part of the saved snapshot alongside source files; unpushed changes return 409 github_source_not_pushed. Blocks concurrent builds during verification and physical cleanup. Deletes hosted Git versions, source revisions, image content and stored operation payloads, then deletes every R2 object in this project’s prefix and updates billing inventory. Preserves project identity, Builder access, the GitHub link, conversation and financial evidence. Builder source, files, images and exports subsequently read from GitHub. Returns 202 with storage=deleting when physical cleanup is queued for durable scheduled retries; returns 200 with storage=github after cleanup. Repeating deletion is safe. Storage charges stop for removed bytes once physical cleanup finishes; previously accrued usage remains billable. Future builds may save a new Mainbrella working copy, which can be deleted again after pushing.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"github":{"type":["object","null"],"properties":{"repo":{"type":"string"},"branch":{"type":"string"},"commitId":{"type":["string","null"]},"url":{"type":"string","format":"uri"}},"required":["repo","branch","commitId","url"]},"storage":{"type":"string","enum":["github"]}},"required":["github","storage"]}}}},"202":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"github":{"type":["object","null"],"properties":{"repo":{"type":"string"},"branch":{"type":"string"},"commitId":{"type":["string","null"]},"url":{"type":"string","format":"uri"}},"required":["repo","branch","commitId","url"]},"storage":{"type":"string","enum":["deleting"]}},"required":["github","storage"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/projects/github":{"get":{"operationId":"getProjectGithubLink","tags":["Projects"],"summary":"Read a project’s GitHub link","security":[{"cookieAuth":[]}],"description":"Requires a browser session. Returns the repository, branch, last accepted commit, and GitHub URL for a project owned by the signed-in user.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"github":{"type":["object","null"],"properties":{"repo":{"type":"string"},"branch":{"type":"string"},"commitId":{"type":["string","null"]},"url":{"type":"string","format":"uri"}},"required":["repo","branch","commitId","url"]}},"required":["github"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"put":{"operationId":"linkProjectGithub","tags":["Projects"],"summary":"Link a project to GitHub","security":[{"cookieAuth":[]}],"description":"Requires a trusted Origin and browser session. Uses the separate write-capable Build app and checks both the user and app repository permissions. Blocks concurrent builds while transferring the complete hosted Git history to an empty destination branch or the same saved Git head. Verifies the remote before atomically switching the project, clearing hosted Git heads/version rows, and queuing hosted bundle cleanup. Existing source and hosted Git history remain available if linking fails. Existing links cannot be repointed; repeated requests for the same repository verify access. Plain projects import supported source from an existing branch or link an empty repository. Source limits are 1024 text files, 1 MiB per file and 16 MiB of serialized source. Working source and its manifest are stored in private R2; D1 retains an object reference. Connecting GitHub retains the Mainbrella working copy and its storage charges until the owner explicitly calls deleteProjectHostedStorage. Source storage uses existing prepaid funding and account storage limits; insufficient funding returns 402. Builder commits and history reads subsequently use GitHub without hosted Git fallback.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"repo":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,38}\\/[A-Za-z0-9_.-]{1,100}$"},"branch":{"type":"string","default":"main"}},"required":["repo"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"github":{"type":["object","null"],"properties":{"repo":{"type":"string"},"branch":{"type":"string"},"commitId":{"type":["string","null"]},"url":{"type":"string","format":"uri"}},"required":["repo","branch","commitId","url"]}},"required":["github"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/turns/{turnId}/diagnostics":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"getBuildTurnDiagnostics","summary":"Inspect an owned turn’s durable operation evidence","description":"Read-only, session-authenticated. Assembles ordered logical operations and attempt IDs, deployment/schema versions, dispatch intent, stream evidence, provider references, bounded command output, immutable source snapshots and independent billing/cleanup outcomes. Unknown outcomes are not replayed. Detailed records are excluded from routine SSE snapshots.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"turnId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[1]},"turnId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"error":{"type":["string","null"]},"errorExplanation":{"type":["string","null"],"description":"Plain-language progress or outcome with guidance on whether to wait, check the app, or try again."},"log":{"type":"string"},"failureOperationId":{"type":["string","null"]},"operations":{"type":"array","items":{"type":"object","properties":{"turn_id":{"type":"string","format":"uuid"},"operation_id":{"type":"string"},"attempt_id":{"type":"string"},"schema_version":{"type":"integer"},"deployment_version":{"type":["string","null"]},"kind":{"type":"string","enum":["text","image","tool","command","source","billing","cleanup"]},"label":{"type":"string"},"status":{"type":"string","enum":["proposed","skipped","blocked","succeeded","failed","unknown"]},"explanation":{"type":["string","null"],"description":"Plain-language progress or outcome with guidance on whether to wait, check the app, or try again."},"dispatch_attempted":{"type":["integer","null"]},"created_at":{"type":"number"},"started_at":{"type":["number","null"]},"updated_at":{"type":"number"},"finished_at":{"type":["number","null"]},"evidence":{"type":"object","additionalProperties":{}},"result":{},"source":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["turn_id","operation_id","attempt_id","schema_version","deployment_version","kind","label","status","explanation","dispatch_attempted","created_at","started_at","updated_at","finished_at","evidence","source"]}},"billing":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"user_id":{"type":"string"},"app_id":{"type":"string"},"turn_id":{"type":"string"},"model":{"type":"string"},"reserved_micro_usd":{"type":"number"},"cost_micro_usd":{"type":["number","null"]},"usage_json":{"type":["string","null"]},"status":{"type":"string","enum":["reserved","running","reported","settled"]},"created_at":{"type":"number"},"reported_at":{"type":["number","null"]}},"required":["id","user_id","app_id","turn_id","model","reserved_micro_usd","cost_micro_usd","usage_json","status","created_at","reported_at"]}}},"required":["schemaVersion","turnId","status","error","errorExplanation","log","failureOperationId","operations","billing"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/config":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"getBuildConfig","summary":"Read Build availability, models and billing","description":"Reports a curated list of three models: GLM-5.3 (default, best quality), Kimi K2.7 Code (coding), and GLM-5.3 Flash (lower cost). GLM models accept high (default) or max reasoning effort; Kimi reasoning is always on. Each build accepts model and effort; choices outside this list return 400. Production uses Workers AI; opt-in local development can use a Codex app-server bridge with the same build tools and validation. There is no daily turn quota; prepaid builds require available balance and reserve funds within the account spending limit before each AI request.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"available":{"type":"boolean"},"versionHistory":{"type":"boolean"},"model":{"type":"string"},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"efforts":{"type":"array","items":{"type":"string"}},"defaultEffort":{"type":"string"}},"required":["id","name","efforts","defaultEffort"]}},"maxApps":{"type":"number"},"aiBilling":{"type":"string","enum":["prepaid","included"]},"aiMarkupPercent":{"type":"number"},"computeUnitHourlyCents":{"type":"number"},"size":{"type":"string","enum":["small"]}},"required":["available","versionHistory","model","models","maxApps","aiBilling","aiMarkupPercent","computeUnitHourlyCents","size"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"listBuildApps","summary":"List account-saved apps","parameters":[{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"apps":{"type":"array","items":{"$ref":"#/components/schemas/BuildApp"},"maxItems":50}},"required":["apps"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"createBuildApp","summary":"Create an app and queue its first Workers AI build","description":"Requires active access and available prepaid balance, Origin and Idempotency-Key. Saves source files and their manifest in private R2 storage, keeps object references and app metadata in D1, and dispatches a durable Workflow. Text and image inference debit prepaid credits at Cloudflare cost plus 50%, using reported input, cached input and output tokens or explicit image dimensions/steps. Funds are held before each request within the account spending limit; unknown usage stays reserved for reconciliation. Known usage is charged even if the build fails. Small Ad Hoc runtime uses existing compute billing. No daily turn quota. Maximum 50 apps and one active turn per account. Identical retries return the same app; different prompts with the same key return 409. Queued dispatch and reported charges are reconciled by scheduled work. Local Codex text inference has no Cloudflare charge.","parameters":[{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"required":true,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":6000},"model":{"type":"string","minLength":1,"maxLength":120},"effort":{"type":"string","minLength":1,"maxLength":20}},"required":["prompt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"allOf":[{"$ref":"#/components/schemas/BuildApp"},{"type":"object","properties":{"turns":{"type":"array","items":{"$ref":"#/components/schemas/BuildTurn"}},"retention":{"$ref":"#/components/schemas/StorageRetention"}},"required":["turns","retention"]}]}},"required":["app"]}}}},"202":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"allOf":[{"$ref":"#/components/schemas/BuildApp"},{"type":"object","properties":{"turns":{"type":"array","items":{"$ref":"#/components/schemas/BuildTurn"}},"retention":{"$ref":"#/components/schemas/StorageRetention"}},"required":["turns","retention"]}]}},"required":["app"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"getBuildApp","summary":"Read an owned app and its build progress","description":"Read-only. Includes storage retention warnings and the deletion deadline, retained conversation, original generated image metadata, workflow stages, token usage, settled AI charges in fractional USD cents, saved revision and temporary preview. Image bytes are available through the owned image endpoint. Expired preview URLs are omitted. Source and conversations remain accessible without paid access.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"allOf":[{"$ref":"#/components/schemas/BuildApp"},{"type":"object","properties":{"turns":{"type":"array","items":{"$ref":"#/components/schemas/BuildTurn"}},"retention":{"$ref":"#/components/schemas/StorageRetention"}},"required":["turns","retention"]}]}},"required":["app"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"patch":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"renameBuildApp","summary":"Rename an owned app","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"allOf":[{"$ref":"#/components/schemas/BuildApp"},{"type":"object","properties":{"turns":{"type":"array","items":{"$ref":"#/components/schemas/BuildTurn"}},"retention":{"$ref":"#/components/schemas/StorageRetention"}},"required":["turns","retention"]}]}},"required":["app"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"deleteBuildApp","summary":"Stop the exact editing container and delete an app","description":"Rejects deletion during an active build. Linked projects with published endpoints, pending endpoint cleanup or custom domains return 409 project_hosting_in_use; unpublish and remove domains in Projects first. Deletes the shared project, conversations and saved revisions. Cleanup remains available after funding expires.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/events":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"streamBuildApp","summary":"Stream an owned app’s model output and build activity","description":"Session-authenticated, read-only SSE. Each app event contains the same JSON snapshot as getBuildApp, including incremental assistant text, tool activity and preview state. Reconnect after disconnect; retained activity is replayed without starting another build. Streams close when the build finishes or after 55 seconds. Account limits allow six event stream starts per minute and two concurrent event streams. Streams and exports share a platform limit of 100 concurrent streams; excess requests return 429 with Retry-After.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Server-sent app snapshots.","content":{"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/turns":{"post":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"createBuildTurn","summary":"Modify an app or restart a temporary preview","description":"Stable Idempotency-Key required. revision must match the latest successful revision. mode=build runs bounded Workers AI file, install, compile and repair steps. mode=preview rebuilds saved source without AI. Prepaid builds and previews require available balance; AI requests reserve funds within the account spending limit. No daily turn quota. Maximum 100 turns per app. Successful builds save immutable source revisions independently of containers. Git commits reject any file above 25 MiB (26,214,400 uncompressed bytes), while smaller source, image and lockfile limits still apply. Before uploading or accepting a commit, prepaid funds must cover the complete new storage footprint, metadata, Git history and write operations using the existing 30-day retention pricing and account spending limit. Insufficient funding fails the turn with storage_funding_required; oversized files fail with build_git_file_limit. Preview links last at most 30 minutes, subject to the existing Ad Hoc idle and funding deadlines. Linked projects commit directly to GitHub with the separate Build app; write access failures or branch conflicts never fall back to hosted Git. No permanent publishing or backend/database provisioning.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"required":true,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["build"]},"prompt":{"type":"string","minLength":1,"maxLength":6000},"model":{"type":"string","minLength":1,"maxLength":120},"effort":{"type":"string","minLength":1,"maxLength":20},"revision":{"type":"integer","minimum":0}},"required":["mode","prompt","revision"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["preview"]},"revision":{"type":"integer","minimum":1}},"required":["mode","revision"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"allOf":[{"$ref":"#/components/schemas/BuildApp"},{"type":"object","properties":{"turns":{"type":"array","items":{"$ref":"#/components/schemas/BuildTurn"}},"retention":{"$ref":"#/components/schemas/StorageRetention"}},"required":["turns","retention"]}]}},"required":["app"]}}}},"202":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"allOf":[{"$ref":"#/components/schemas/BuildApp"},{"type":"object","properties":{"turns":{"type":"array","items":{"$ref":"#/components/schemas/BuildTurn"}},"retention":{"$ref":"#/components/schemas/StorageRetention"}},"required":["turns","retention"]}]}},"required":["app"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/resume":{"post":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"resumeBuildDispatch","summary":"Reconcile dispatch of an existing queued build","description":"Uses the existing workflow ID; does not create a new turn or replay failed inference.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"allOf":[{"$ref":"#/components/schemas/BuildApp"},{"type":"object","properties":{"turns":{"type":"array","items":{"$ref":"#/components/schemas/BuildTurn"}},"retention":{"$ref":"#/components/schemas/StorageRetention"}},"required":["turns","retention"]}]}},"required":["app"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/stop":{"post":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"stopBuildPreview","summary":"Stop the editing container while keeping source","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"allOf":[{"$ref":"#/components/schemas/BuildApp"},{"type":"object","properties":{"turns":{"type":"array","items":{"$ref":"#/components/schemas/BuildTurn"}},"retention":{"$ref":"#/components/schemas/StorageRetention"}},"required":["turns","retention"]}]}},"required":["app"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/source":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"getBuildSource","summary":"Read saved working source, including edits from a failed build","description":"Returns complete source, independent of the bounded file ranges used by the model. Up to 1024 files, 1 MiB per UTF-8 file and 16 MiB of serialized source. Source and manifests use private R2 storage; D1 retains object references. After explicit deletion of a linked project’s Mainbrella copy, source is read from the authorized GitHub commit without recreating R2 objects.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"revision":{"type":"integer"},"files":{"type":"object","additionalProperties":{"type":"string","maxLength":1048576}}},"required":["revision","files"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/files":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"listBuildFiles","summary":"List working or committed repository files without loading their contents","description":"Read-only, session-authenticated and owner-scoped. Returns paths, byte sizes and file types from an R2 manifest or the linked GitHub commit tree. Optional versionId selects a saved commit; omit it for working source and generated assets. Does not download file bodies or extract the Git bundle.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","pattern":"^[a-f0-9]{40}$"}]},"required":false,"name":"versionId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"revision":{"type":"integer"},"version":{"$ref":"#/components/schemas/BuildVersion"},"files":{"type":"array","items":{"$ref":"#/components/schemas/BuildFile"}}},"required":["revision","version","files"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/file":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"getBuildFile","summary":"Stream one working or committed file from private R2 storage","description":"Read-only, session-authenticated and owner-scoped. path must exactly match a file in the selected manifest. Optional versionId selects a saved commit. Streams only the selected object from R2 or the authorized linked GitHub repository, without downloading other file bodies or the Git bundle. Authenticated app reads are limited to 120 requests per minute per account and 6,000 globally; repository and ZIP exports additionally allow six starts per minute and two concurrent streams per account. Limit responses return 429 with Retry-After. Text is served as text/plain with nosniff; generated images are JPEGs. Missing files return 404. Responses are private and not cached by shared caches.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","pattern":"^[a-f0-9]{40}$"}]},"required":false,"name":"versionId","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":160},"required":true,"name":"path","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Selected file bytes.","content":{"text/plain":{"schema":{"type":"string"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/export":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"exportBuildSource","summary":"Download portable source as a ZIP archive","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Source archive including original JPEG assets under public/generated. Run npm install and npm run build.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/versions":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"listBuildVersions","summary":"List saved Git versions of an owned app","description":"Read-only and available without paid access. Returns up to 100 versions, newest first. Checkpoints preserve edits from failed builds; verified indicates a successful compile. versionId identifies the current saved head and verifiedVersionId the last version with a successful preview. Hosted repositories persist as immutable Git bundles in private R2 storage; no GitHub account is required. Linked projects read commits directly from their authorized GitHub repository, use commit SHAs as version IDs, and stop writing hosted Git bundles or Git version records.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"$ref":"#/components/schemas/BuildVersion"}},"versionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","pattern":"^[a-f0-9]{40}$"},{"type":"null"}]},"verifiedVersionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","pattern":"^[a-f0-9]{40}$"},{"type":"null"}]}},"required":["versions","versionId","verifiedVersionId"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/versions/{versionId}":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"getBuildVersion","summary":"Read a version’s file list and changes from its parent","description":"Owner-scoped repository metadata, including .gitignore, the npm lockfile and referenced generated JPEGs. Lists paths, sizes, file types and additions/deletions/modifications by content hash from R2 manifests without extracting the R2 bundle or loading file bodies. Use getBuildFile with path and versionId to read a file or either side of a change.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","pattern":"^[a-f0-9]{40}$"}]},"required":true,"name":"versionId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"$ref":"#/components/schemas/BuildVersion"},"files":{"type":"array","items":{"$ref":"#/components/schemas/BuildFile"}},"changes":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"type":{"type":"string","enum":["added","modified","deleted"]},"fileType":{"type":"string","enum":["text","image"]}},"required":["path","type","fileType"]}}},"required":["version","files","changes"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/restore":{"post":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"restoreBuildVersion","summary":"Restore a saved version and create a new Git commit","description":"Requires active funded access, Origin, Idempotency-Key and the current revision. Queues a build without AI, restores source and its npm lockfile, compiles it and starts a preview. Success creates a new commit and source revision, preserving intervening history. Existing active turns and stale revisions return 409; versions belonging to another app return 404. Failed restores preserve the working source. Commits enforce the 25 MiB per-file ceiling and require prepaid funds for all new stored bytes and write operations at the existing 30-day retention pricing before acceptance; insufficient funding fails the turn with storage_funding_required.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"required":true,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"versionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","pattern":"^[a-f0-9]{40}$"}]},"revision":{"type":"integer","minimum":0}},"required":["versionId","revision"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"allOf":[{"$ref":"#/components/schemas/BuildApp"},{"type":"object","properties":{"turns":{"type":"array","items":{"$ref":"#/components/schemas/BuildTurn"}},"retention":{"$ref":"#/components/schemas/StorageRetention"}},"required":["turns","retention"]}]}},"required":["app"]}}}},"202":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"allOf":[{"$ref":"#/components/schemas/BuildApp"},{"type":"object","properties":{"turns":{"type":"array","items":{"$ref":"#/components/schemas/BuildTurn"}},"retention":{"$ref":"#/components/schemas/StorageRetention"}},"required":["turns","retention"]}]}},"required":["app"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/repository":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"exportBuildRepository","summary":"Download an owned app’s complete Git history","description":"Read-only, available without paid access or a running sandbox. Assembles the initial Git bundle and its dependent increments on demand, and streams the current saved repository, including source, referenced assets and npm lockfile, as one self-contained Git bundle. Existing full-history bundles remain supported. Download as app.bundle and run git clone -b main app.bundle app. Saved commits remain available through the retention deadline; the cloned repository can be pushed to any Git host. Exports remain available without credit, limited to six starts per minute and two concurrent exports per account. Linked projects return 409 github_repository_hosted with their GitHub URL. Exports and event streams share a platform limit of 100 concurrent streams; excess requests return 429 with Retry-After.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Complete Git bundle.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/build/apps/{appId}/images/{imageId}":{"get":{"tags":["Build"],"security":[{"cookieAuth":[]}],"operationId":"getBuildImage","summary":"Read an original image from an owned app","description":"Session-authenticated JPEG bytes streamed from private R2 storage after ownership checks. D1 stores image metadata and an object reference. Generated with Workers AI, retained independently of the sandbox and deleted with the app. Maximum 4 images per build and 12 per app. App previews and ZIP exports use local copies of these assets.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"appId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"imageId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Original generated JPEG.","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/acquisition/repositories":{"post":{"operationId":"submitAcquisitionRepository","tags":["Acquisition"],"summary":"Record an anonymous public repository submission","description":"Requires an allowed browser Origin. Accepts only a public GitHub repository, a 64-character browser-generated token, and allowlisted attribution fields; verifies repository visibility with GitHub before storing. Repeating the same token and repository returns the original lead without a second GitHub lookup; a changed repository returns 409. Does not create a captured lead or allocate compute. Enabled only when ACQUISITION_ENABLED is true.","security":[],"parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","pattern":"^[a-f0-9]{64}$"},"repo":{"type":"string"},"attribution":{"type":"object","properties":{"entryPage":{"type":"string"},"variant":{"type":"string"},"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_content":{"type":"string"},"utm_term":{"type":"string"},"creator":{"type":"string"},"gclid":{"type":"string"},"fbclid":{"type":"string"},"msclkid":{"type":"string"},"ttclid":{"type":"string"}},"required":["entryPage"],"additionalProperties":false}},"required":["token","repo","attribution"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string","format":"uuid"},"repo":{"type":"string"}},"required":["leadId","repo"]}}}},"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string","format":"uuid"},"repo":{"type":"string"}},"required":["leadId","repo"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/acquisition/link":{"post":{"operationId":"linkAcquisitionLead","tags":["Acquisition"],"summary":"Link an anonymous repository submission to the signed-in account","description":"Requires an allowed Origin and browser session. The backend uses the signed-in account email and accepts only the submission token; a lead can be linked once, within 30 days. Appends lead.captured only after linking the verified repository intent to a real account contact. Enabled only when ACQUISITION_ENABLED is true.","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"linked":{"type":"boolean","enum":[true]}},"required":["linked"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/admin/acquisition/leads":{"get":{"operationId":"listAdminAcquisitionLeads","tags":["Admin"],"summary":"List acquisition leads","description":"Requires a browser session for oneone@gmail.com. Returns stored lead contact and attribution fields but never the token hash. Bounded newest-first pagination uses an opaque lead ID cursor; limit is at most 100. Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"userId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"leadId","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"leads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"repo":{"type":"string"},"attribution":{"type":"object","properties":{"entryPage":{"type":"string"},"variant":{"type":"string"},"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_content":{"type":"string"},"utm_term":{"type":"string"},"creator":{"type":"string"},"gclid":{"type":"string"},"fbclid":{"type":"string"},"msclkid":{"type":"string"},"ttclid":{"type":"string"}},"required":["entryPage","variant"]},"createdAt":{"type":"number"},"userId":{"type":["string","null"]},"contactEmail":{"type":["string","null"]},"capturedAt":{"type":["number","null"]}},"required":["id","repo","attribution","createdAt","userId","contactEmail","capturedAt"]}},"next":{"type":["string","null"],"format":"uuid"},"limit":{"type":"number"}},"required":["leads","next","limit"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/admin/acquisition/events":{"get":{"operationId":"listAdminAcquisitionEvents","tags":["Admin"],"summary":"List acquisition product events","description":"Requires a browser session for oneone@gmail.com. Returns append-only product events with effective account first-touch attribution when available. Sequence cursor is exclusive; limit is at most 100. Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"userId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"leadId","in":"query"},{"schema":{"type":"string","enum":["repo.submitted","lead.captured","user.created","workspace.started","workload.activated","preview.opened","developer.qualified","wallet.funded_paid","compute.consumed_paid","launch.failed"]},"required":false,"name":"event","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"sequence":{"type":"number"},"key":{"type":"string"},"type":{"type":"string"},"userId":{"type":["string","null"]},"leadId":{"type":["string","null"]},"occurredAt":{"type":"number"},"recordedAt":{"type":"number"},"data":{"type":"object","additionalProperties":{}},"repo":{"type":["string","null"]},"attribution":{"type":["object","null"],"properties":{"entryPage":{"type":"string"},"variant":{"type":"string"},"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_content":{"type":"string"},"utm_term":{"type":"string"},"creator":{"type":"string"},"gclid":{"type":"string"},"fbclid":{"type":"string"},"msclkid":{"type":"string"},"ttclid":{"type":"string"}},"required":["entryPage","variant"]}},"required":["sequence","key","type","userId","leadId","occurredAt","recordedAt","data","repo","attribution"]}},"next":{"type":["number","null"]},"limit":{"type":"number"}},"required":["events","next","limit"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/health":{"get":{"operationId":"getHealth","tags":["Operations"],"summary":"Check API health","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/state":{"get":{"operationId":"getState","tags":["Operations"],"summary":"Increment and return the global durable visit counter","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"visits":{"type":"number"}},"required":["visits"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/admin/tables":{"get":{"operationId":"listAdminTables","tags":["Admin"],"summary":"List tables available to the administrator","security":[{"cookieAuth":[]}],"description":"Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"tables":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"group":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}}},"required":["id","label","group","columns"]}}},"required":["tables"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/admin/tables/{table}":{"get":{"operationId":"getAdminTable","tags":["Admin"],"summary":"Search and page administrator table rows","security":[{"cookieAuth":[]}],"description":"Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","parameters":[{"schema":{"type":"string"},"required":true,"name":"table","in":"path"},{"schema":{"type":"integer","minimum":0,"maximum":1000000},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","maxLength":100},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":{}}},"total":{"type":"number"},"offset":{"type":"number"},"limit":{"type":"number"}},"required":["items","total","offset","limit"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/admin/users":{"get":{"operationId":"listAdminUsers","tags":["Admin"],"summary":"List all users, newest first","description":"Requires a browser session for oneone@gmail.com. Returns all users ordered by created_at descending, then id descending. Plan is based on the last synced active subscription with an unexpired period, or an unexpired trial when no subscription is recorded; otherwise none. This administrative snapshot does not verify paid access with Stripe. Excludes credentials and provider identifiers. Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/AdminUser"}}},"required":["users"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/admin/users/{userId}":{"get":{"operationId":"getAdminUserDetail","tags":["Admin"],"summary":"Get a user's plan, prepaid balance and funding history","description":"Requires a browser session for oneone@gmail.com. Returns the same safe user fields as the admin user list, a current prepaid balance snapshot, and newest-first prepaid funding history. This read-only request accesses only the selected user's account service and makes no Stripe requests or billing mutations. It excludes account identifiers, saved payment details, credentials and provider identifiers. Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"userId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"fundingCursor","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/AdminUser"},"asOf":{"type":"number"},"balance":{"$ref":"#/components/schemas/PrepaidBalance"},"fundings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"number"},"amountCents":{"type":"number"},"revokedCents":{"type":"number"},"reason":{"type":["string","null"],"enum":["refund","dispute",null]}},"required":["id","createdAt","amountCents","revokedCents","reason"]}},"nextFundingCursor":{"type":["string","null"]}},"required":["user","asOf","balance","fundings","nextFundingCursor"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/api/get-marketing-users":{"get":{"operationId":"getMarketingUsers","tags":["Admin"],"summary":"List users who have not unsubscribed from marketing emails","description":"Requires a browser session for oneone@gmail.com. Returns users ordered by created_at descending, then id descending, using offset and limit pagination. Excludes users with marketing_email_unsubscribed set and users whose email matches a permanent address opt-out or another unsubscribed account, using trimmed, lowercase addresses as the marketing sender does. Includes users without an email address (email is null). Returns only id, email, name and created_at; excludes credentials and provider identifiers. Total counts eligible users before pagination. Defaults to offset 0 and limit 25; maximum offset is 1000000 and maximum limit is 100. A supplied Origin must be trusted. Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":["integer","null"],"minimum":0,"maximum":1000000,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/MarketingUser"}},"total":{"type":"integer","minimum":0},"offset":{"type":"integer","minimum":0,"maximum":1000000},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["users","total","offset","limit"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/api/send-marketing-email":{"post":{"operationId":"sendMarketingEmail","tags":["Admin"],"summary":"Send one marketing email using the Mainbrella template","description":"Requires a browser session for oneone@gmail.com and a trusted Origin header. The from field accepts one bare email address or Name <address> from an onboarded Cloudflare Email Sending domain. The message is plain text, escaped with line breaks preserved; a plain-text alternative is included. The optional fancy boolean defaults to true, inserting the message between the branded template header and footer. In both modes, both parts include an unsubscribe link to https://mainbrella.com/unsubscribe?email=<encoded recipient>. With fancy=false, the HTML contains the message on a white background with a normal font and a simple unsubscribe footer, without a visible subject heading, branded header or footer, buttons or images. Checks the user's marketing_email_unsubscribed flag and the address opt-out before every send; opted-out recipients return 409 recipient_unsubscribed without sending. Preference lookup failures return 503 email_preferences_unavailable without sending. Maximum JSON body size is 1 MiB. Waits for Email Sending to accept the message and returns its message ID, which does not confirm inbox delivery. No automatic retries. Local Wrangler development simulates sending. Served by the independently deployed mainbrella-marketing Worker through the API service binding. A missing or unavailable service returns 503.","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uri","description":"Trusted browser origin, such as https://raindrop.mainbrella.com."},"required":true,"description":"Trusted browser origin, such as https://raindrop.mainbrella.com.","name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","maxLength":254,"format":"email"},"subj":{"type":"string","minLength":1,"maxLength":998,"pattern":"^[^\\x00-\\x1f\\x7f]+$"},"from":{"type":"string","minLength":1,"maxLength":512},"message":{"type":"string","minLength":1,"maxLength":100000},"fancy":{"type":"boolean","default":true,"description":"Use the branded template; false sends the message on a white background with a normal font and a simple unsubscribe footer."}},"required":["to","subj","from","message"],"additionalProperties":false}}}},"responses":{"202":{"description":"Email accepted by Cloudflare Email Sending.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"messageId":{"type":"string"}},"required":["ok","messageId"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Provider request failed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/api/unsubscribe":{"post":{"operationId":"unsubscribeMarketingEmail","tags":["Marketing"],"summary":"Permanently unsubscribe an email address from marketing emails","description":"Public endpoint; no login, cookie or bearer token is required. The supplied email address is trimmed and lowercased, saved as a permanent address opt-out, and all matching users have marketing_email_unsubscribed set to true. The current session does not determine the recipient. Repeated requests are idempotent, and registered and unregistered addresses receive the same confirmation. The unsubscribe page calls this automatically using its email query parameter. Maximum JSON body size is 4 KiB. A supplied Origin must be trusted. Served by the independently deployed mainbrella-marketing Worker through the API service binding. A missing or unavailable service returns 503.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"}},"required":["email"],"additionalProperties":false}}}},"responses":{"200":{"description":"The address is unsubscribed from marketing emails.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/admin/accounting/ledger":{"get":{"operationId":"exportAccountingLedger","tags":["Admin"],"summary":"Export immutable accounting evidence with a fixed sequence watermark","security":[{"cookieAuth":[]}],"description":"Requires a browser cookie session for oneone@gmail.com. Monetary values in reports are exact integer micro-USD strings; ledger Stripe amounts are integer USD cents. Records survive user deletion. Storage and storage_adjustment events record signed integer nano-USD in data.costNanoUsd (1 USD = 1,000,000,000 nano-USD); weighted millisecond report strings may have two decimal places. Inference events record AI charges as integer micro-USD in data.costMicroUsd (1 USD = 1,000,000 micro-USD). Defaults to JSON, limit 1000, and ascending sequence order. Set order=desc for creation-time order (recorded_at descending, then sequence descending). For subsequent pages reuse throughSequence and nextCursor as after, keeping the same order. NDJSON exports expose X-Accounting-Through-Sequence and X-Accounting-Next-Cursor headers (empty cursor means complete). Sequence snapshots include late-recorded historical events; no event is updated or deleted. New compute evidence combines contiguous runtime into 15-minute intervals; stops, actual wallet funding/refund/dispute changes, UTC month boundaries and accounting checkpoints flush shorter intervals. This read does not flush buffered usage. Wallet balance and billing history include exact live consumption between ledger writes. Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","parameters":[{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"after","in":"query"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"throughSequence","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":1000},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["json","ndjson"]},"required":false,"name":"format","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"order","in":"query"}],"responses":{"200":{"description":"JSON page or downloadable NDJSON records.","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"sequence":{"type":"number"},"event_key":{"type":"string"},"user_id":{"type":"string"},"event_type":{"type":"string","enum":["funding","refund","stripe_balance","funding_state","compute","inference","storage","storage_adjustment","legacy_usage","wallet_checkpoint"]},"occurred_at":{"type":"number"},"recorded_at":{"type":"number"},"data":{"type":"object","additionalProperties":{}}},"required":["sequence","event_key","user_id","event_type","occurred_at","recorded_at","data"]}},"throughSequence":{"type":"number"},"nextCursor":{"type":["number","null"]}},"required":["entries","throughSequence","nextCursor"]}},"application/x-ndjson":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/admin/accounting/closes":{"get":{"operationId":"listAccountingCloses","tags":["Admin"],"summary":"Read saved monthly close revisions","security":[{"cookieAuth":[]}],"description":"Requires a browser cookie session for oneone@gmail.com. Monetary values in reports are exact integer micro-USD strings; ledger Stripe amounts are integer USD cents. Records survive user deletion. Returns up to 100 revisions newest first, optionally filtered by UTC month. Saved reports never change when late evidence arrives. Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","parameters":[{"schema":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"required":false,"name":"month","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"closes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"month":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"created_at":{"type":"number"},"created_by":{"type":"string"},"ledger_sequence":{"type":"number"},"policy_id":{"type":["string","null"]},"report":{"$ref":"#/components/schemas/AccountingCloseReport"}},"required":["id","month","created_at","created_by","ledger_sequence","policy_id","report"]}}},"required":["closes"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"createAccountingClose","tags":["Admin"],"summary":"Reconcile and save a monthly accounting close revision","security":[{"cookieAuth":[]}],"description":"Requires a browser cookie session for oneone@gmail.com. Monetary values in reports are exact integer micro-USD strings; ledger Stripe amounts are integer USD cents. Records survive user deletion. Requires trusted Origin. Month must have ended in UTC. Refreshes all prepaid account payment evidence and wallet outboxes before fixing a watermark. Reports compute credit, proportionally allocated deferred revenue, and gross taxable advance inclusion by receipt year independently. Fees and sales tax never enter compute credit or consideration. Missing evidence and unresolved treatments produce needs_review; tax inclusion is null until a CPA-approved policy is selected explicitly. No breakage recognition. Refund tax deductions and dispute classification require CPA review. This is an administrative close operation, not a tax return. Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"month":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"policyId":{"type":"string","maxLength":100}},"required":["month"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"createdAt":{"type":"number"},"ledgerSequence":{"type":"number"},"report":{"$ref":"#/components/schemas/AccountingCloseReport"}},"required":["id","createdAt","ledgerSequence","report"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/admin/accounting/policies":{"get":{"operationId":"listAccountingPolicies","tags":["Admin"],"summary":"Read recorded CPA tax-method approvals","security":[{"cookieAuth":[]}],"description":"Requires a browser cookie session for oneone@gmail.com. Monetary values in reports are exact integer micro-USD strings; ledger Stripe amounts are integer USD cents. Records survive user deletion. Returns up to 100 immutable policies newest first. No method is selected automatically. Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"policies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"number"},"created_by":{"type":"string"},"method":{"type":"string","enum":["cash_receipts","section_451c"]},"receipt_timezone":{"type":"string"},"approved_by":{"type":"string"},"evidence_reference":{"type":"string"}},"required":["id","created_at","created_by","method","receipt_timezone","approved_by","evidence_reference"]}}},"required":["policies"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"recordAccountingPolicy","tags":["Admin"],"summary":"Record a CPA-approved advance-payment tax method and evidence reference","security":[{"cookieAuth":[]}],"description":"Requires a browser cookie session for oneone@gmail.com. Monetary values in reports are exact integer micro-USD strings; ledger Stripe amounts are integer USD cents. Records survive user deletion. Requires trusted Origin. Store only a method confirmed by the named CPA and a reference to the written approval, including any required election or method change. receiptTimezone is an IANA timezone used for calendar receipt years. This record does not create refund rights, elect a tax method, or implement refundable deposits. A genuine refundable-deposit model requires separate approved terms and operational changes. Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["cash_receipts","section_451c"]},"receiptTimezone":{"type":"string","minLength":1,"maxLength":2000},"approvedBy":{"type":"string","minLength":1,"maxLength":2000},"evidenceReference":{"type":"string","minLength":1,"maxLength":2000}},"required":["method","receiptTimezone","approvedBy","evidenceReference"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"createdAt":{"type":"number"}},"required":["id","createdAt"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/capabilities":{"get":{"operationId":"getCapabilities","tags":["Operations"],"summary":"Discover API features and runtime limits","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]},{}],"description":"Read-only deployment contract with optional API-key or browser-session authentication. During a private security rollout, networking.egressPolicies and secrets.vault reflect the authenticated account; anonymous and non-allowlisted callers see false. Responses are not cached and vary on Authorization and Cookie. Requires no credentials, paid access, or provisioning. No query parameters. Does not establish live component health. Obtain account allowances and deployed image catalog through authenticated GET /containers. Unsupported features are explicit; customBuilds reflects build-service configuration. previews.supported requires explicit enablement, an isolated preview domain, routing database and runtime binding. Preview URLs use opaque bearer tokens rather than signatures, so signedUrls remains false. projects.supported requires explicit project hosting enablement and routing/runtime bindings; projects.customDomains additionally requires a configured certificate provider, except in local development. projects.localDevelopment is true only when LOCAL_DEV=true and PROJECT_DOMAIN_PROVIDER=local; it enables *.localhost aliases with simulated DNS and TLS. apexIps contains only operator-configured ingress addresses and is empty for local development.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Capabilities"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/activity":{"get":{"operationId":"connectAccountActivity","tags":["Containers"],"summary":"Subscribe to account activity over a read-only WebSocket","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Requires observability.activityWebSocket. API keys and session Bearer tokens authenticate in Authorization; browser cookies require an explicit trusted Origin. No query parameters or client-selected account IDs. The server sends {type:\"ready\"} on attachment: load an HTTP snapshot after this frame to repair missed changes. Future {type:\"changed\",id,resource,containerId,createdAt,executionId?} frames invalidate owned container lifecycle, managed execution status or preview metadata; resource is containers, executions or previews. Generations are exact ISO strings. No commands, output, credentials, preview URLs or activity history are sent. Events are best-effort hints, not a durable approval queue or replay journal. Disconnect/reconnect never executes work or renews a workspace lease. At most 8 sockets per account; connections close after 300 seconds to reauthenticate. Text ping receives pong automatically; other client messages close with 1008. Reconnect with backoff, wait for ready, then resync. Inspection requires no paid plan.","parameters":[{"schema":{"type":"string","enum":["websocket"]},"required":true,"name":"Upgrade","in":"header"},{"schema":{"type":"string","format":"uri"},"required":false,"name":"Origin","in":"header"}],"responses":{"101":{"description":"WebSocket upgraded. Ready and changed frames are JSON text."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"426":{"description":"WebSocket upgrade required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/executions":{"get":{"operationId":"listContainerExecutions","tags":["Containers"],"summary":"List retained managed jobs for one generation","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Lists up to 512 retained records for the exact owned generation, including running/terminal state. Commands, argv, environment values and idempotency keys are excluded. This is managed-job listing, not a guest-wide OS process table. Available after stop and during billing outages; never starts a machine or renews activity.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"executions":{"type":"array","items":{"$ref":"#/components/schemas/Execution"}}},"required":["executions"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"startContainerExecution","tags":["Containers"],"summary":"Start an idempotent managed shell command","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Requires owned running generation and paid access. Supply exactly one of command (shell) or argv (direct executable/arguments, no shell expansion). Optional cwd/env, stdin=true and pty={cols,rows}. PTY requires stdin=true and combines stdout/stderr on stdout; terminal line endings and input behavior apply. Closing input may hang up the PTY. Dimensions cap at 1000. Resize with the managed job endpoint. stdin defaults to closed/EOF. Idempotency-Key is required and scoped to that generation. Changed command/argv, timeout, input mode, cwd, env or initial terminal dimensions conflicts. Matching retries return retained execution. Command, argv and env values are not retained. Disconnect does not cancel. Timeout defaults to 30000 ms, caps at 900000 ms and the hard deadline. Active work renews idle activity. Shares the four-operation pool with foreground commands/files. Combined output caps at 1 MiB and 512 chunks. Compact identities, state and output remain available for 3600000 ms from admission. Each physical container slot, across all retained generations, has separate budgets of 512 identities, 33554432 raw output bytes and 16384 output events. Active jobs reserve their full 1 MiB/512-event allowance; completed jobs charge actual usage. No unexpired identity or output is evicted to admit work. Matching-key retries return their record even when a budget is full. New admissions return 429 execution_history_limit, execution_output_history_limit or execution_event_history_limit with retryAfterSeconds and Retry-After. History retry hints use the earliest retained expiry; active jobs can release unused reservation earlier, and a hint does not guarantee capacity. execution_limit refers to the shared four-operation pool and has a one-second retry hint. Cancellation targets the operation process group; deliberately detached processes remain bounded by the machine lease. A runtime restart interrupts unfinished work and stops its generation. No command is replayed. Requires GNU timeout in the image. Cookie mutations require trusted Origin.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"required":true,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"command":{"type":"string","minLength":1,"maxLength":16384},"pty":{"type":"object","properties":{"cols":{"type":"integer","minimum":1,"maximum":1000},"rows":{"type":"integer","minimum":1,"maximum":1000}},"required":["cols","rows"],"additionalProperties":false,"description":"Requires stdin=true; combined output on stdout with terminal line discipline."},"timeoutMs":{"type":"integer","minimum":1,"maximum":900000},"stdin":{"type":"boolean"},"cwd":{"type":"string","minLength":1,"maxLength":4096,"description":"Absolute UTF-8 working directory; no dot or parent segments."},"env":{"type":"object","additionalProperties":{"type":"string","maxLength":4096},"description":"At most 64 names and 16 KiB of encoded JSON. Variables other than PATH are not inherited by the provider exec API."}},"required":["command"],"additionalProperties":false},{"type":"object","properties":{"argv":{"type":"array","items":{"type":"string","maxLength":16384},"minItems":1,"maxItems":64,"description":"Total argv bytes at most the shared command limit."},"pty":{"type":"object","properties":{"cols":{"type":"integer","minimum":1,"maximum":1000},"rows":{"type":"integer","minimum":1,"maximum":1000}},"required":["cols","rows"],"additionalProperties":false,"description":"Requires stdin=true; combined output on stdout with terminal line discipline."},"timeoutMs":{"type":"integer","minimum":1,"maximum":900000},"stdin":{"type":"boolean"},"cwd":{"type":"string","minLength":1,"maxLength":4096,"description":"Absolute UTF-8 working directory; no dot or parent segments."},"env":{"type":"object","additionalProperties":{"type":"string","maxLength":4096},"description":"At most 64 names and 16 KiB of encoded JSON. Variables other than PATH are not inherited by the provider exec API."}},"required":["argv"],"additionalProperties":false}]}}}},"responses":{"202":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Execution"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Active-operation or retained-history capacity exhausted; matching retries remain safe.","headers":{"Retry-After":{"description":"Conservative retry delay in seconds, not a reservation or guarantee of capacity. Earlier command completion may free capacity.","schema":{"type":"integer","minimum":1,"maximum":3600}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["execution_limit","execution_history_limit","execution_output_history_limit","execution_event_history_limit"]},"retryAfterSeconds":{"type":"integer","minimum":1,"maximum":3600}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/executions/{executionId}/stdin":{"post":{"operationId":"writeContainerExecutionInput","tags":["Containers"],"summary":"Send raw bytes to an owned managed job","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Requires a running job created with stdin=true and a running paid generation. Writes are ordered and backpressure-aware. At most 65536 bytes per request, 1048576 accepted bytes per job and 262144 pending bytes. Accepted bytes remain counted after ambiguous writes. Input is not retained, replayed or retried. A 30-second response bound does not undo an accepted write; reconcile application state before sending again. Cookie mutations require trusted Origin.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"executionId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":false,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"bytes":{"type":"integer","minimum":0},"stdinClosed":{"type":"boolean"}},"required":["bytes","stdinClosed"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"closeContainerExecutionInput","tags":["Containers"],"summary":"Send EOF to an owned managed job","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Closes input after previously accepted writes. Does not cancel the job. Available as an owned cleanup operation during billing outages. A stopped/closed input returns a conflict. Cookie mutations require trusted Origin.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"executionId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"bytes":{"type":"number","enum":[0]},"stdinClosed":{"type":"boolean"}},"required":["bytes","stdinClosed"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/executions/{executionId}/signal":{"post":{"operationId":"signalContainerExecution","tags":["Containers"],"summary":"Signal the process group of an owned managed job","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Accepts SIGINT, SIGTERM or SIGKILL. Signal delivery is a request, not proof of exit; inspect retained state/output. SIGKILL requests cancellation. Other signals may be handled or ignored. No arbitrary PID input. Cleanup checks the current generation again before signaling and remains available during billing outages. Cookie mutations require trusted Origin.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"executionId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"signal":{"type":"string","enum":["SIGINT","SIGTERM","SIGKILL"]}},"required":["signal"],"additionalProperties":false}}}},"responses":{"202":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Execution"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/executions/{executionId}/resize":{"post":{"operationId":"resizeContainerExecutionTerminal","tags":["Containers"],"summary":"Resize an owned managed pseudo-terminal","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Requires the exact running paid generation and a live job started with pty. Each dimension is 1–1000. Does not create, attach to arbitrary guest processes or change the original idempotency fingerprint. Disconnecting the output stream only detaches. Cookie mutations require trusted Origin.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"executionId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cols":{"type":"integer","minimum":1,"maximum":1000},"rows":{"type":"integer","minimum":1,"maximum":1000}},"required":["cols","rows"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Execution"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/executions/{executionId}":{"get":{"operationId":"getContainerExecution","tags":["Containers"],"summary":"Read retained execution state and output","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Owned generation only. Available after stop and during billing outages; never starts a machine or renews idle time. Expired/mismatched records return 404. Does not reveal the command or idempotency key.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"executionId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Execution"},{"type":"object","properties":{"stdout":{"type":"string"},"stderr":{"type":"string"}},"required":["stdout","stderr"]}]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"cancelContainerExecution","tags":["Containers"],"summary":"Request cancellation of an owned execution","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Idempotent cancellation request. 202 returns the observed record; poll until terminal. Available during billing outages and after stop. Cannot affect another generation. Cookie mutations require trusted Origin.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"executionId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"202":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Execution"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/executions/{executionId}/events":{"get":{"operationId":"streamContainerExecution","tags":["Containers"],"summary":"Stream and replay execution output with a cursor","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"SSE stdout/stderr events contain sequence, type and data; id is the sequence. Resume with cursor equal to the last received id. Cursor must not exceed retained output. status event contains execution metadata; terminal status ends the stream. Streams rotate after 30000 ms and emit heartbeat comments. Disconnect only detaches. Maximum eight streams per container. Available for retained owned generations during billing outages.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"executionId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"integer","minimum":0},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Server-sent execution output events.","content":{"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/code-contexts":{"get":{"tags":["Containers"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"operationId":"listCodeContexts","summary":"List live interpreter contexts for one generation","description":"Owned read operation available during billing outages. Only executable contexts are listed; closing contexts are omitted even while cleanup remains pending. Contexts disappear on expiration, stop, or runtime recovery.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"contexts":{"type":"array","items":{"$ref":"#/components/schemas/CodeContext"}}},"required":["contexts"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Containers"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"operationId":"createCodeContext","summary":"Create a stateful Python interpreter","description":"Requires an owned paid running generation with python3 and GNU timeout installed. Python globals and imported modules persist within this context. Contexts expire after at most 900000 ms and consume one of the shared four concurrent operation slots until closed. Idle contexts do not renew container activity. Stop, timeout, disconnect during execution, or runtime recovery destroys the context. Context memory is never snapshotted or restored. Creation is not automatically retried. Cookie mutations require trusted Origin.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string","enum":["python"]}},"required":["language"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeContext"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/code-contexts/{contextId}/execute":{"post":{"tags":["Containers"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"operationId":"executeCodeInContext","summary":"Execute Python with persistent variables and rich results","description":"Code is UTF-8 and limited to 16384 bytes. One execution per context; overlap returns 409. Timeout defaults to 30000 ms and caps at 60000 ms and context expiration. Python stdout, stderr, the final expression (text, JSON and optional HTML/base64 PNG), and structured exceptions are returned. Python exceptions preserve the context. All returned string contents (stdout, stderr including native output, MIME types/data, and error fields) share a 262144-byte UTF-8 budget with outputTruncated; JSON escaping/field names are excluded, and the encoded response is bounded at 2 MiB. At most four MIME results; oversized JSON/HTML/PNG representations are omitted whole. Native/subprocess stdout and stderr are combined in stderr and also have a separate 1 MiB ingestion hard limit. Rich output is untrusted: sanitize HTML before rendering. Blocking stdin receives EOF. Timeouts, cancellation, protocol failure, or native ingestion overflow close the context. Code is never automatically retried; an ambiguous request may have executed and must not be blindly resubmitted. This process has the same sandbox privileges as commands; it is not a security boundary within the guest.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"contextId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":16384},"timeoutMs":{"type":"integer","minimum":1,"maximum":60000}},"required":["code"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeResult"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"504":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/code-contexts/{contextId}":{"delete":{"tags":["Containers"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"operationId":"closeCodeContext","summary":"Close an interpreter and release its operation slot","description":"Owned cleanup remains available during billing outages. Kills the interpreter process group; does not delete sandbox files. Concurrent deletes await the same cleanup. Failed cleanup retains the context ID and occupied operation slot for another DELETE; execution on a closing context returns 409 code_context_closed. A successful response confirms cleanup. Cookie mutations require trusted Origin.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"contextId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"closed":{"type":"boolean","enum":[true]}},"required":["closed"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/previews":{"post":{"operationId":"createContainerPreview","tags":["Containers"],"summary":"Issue a protected application preview URL","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Available on an explicitly configured isolated preview deployment, or local development with LOCAL_DEV=true. Production links use HTTPS on the preview domain; local links use HTTP on a token-specific localhost subdomain at the configured dev port. Requires owned running generation and paid access. Links are bearer capabilities: anyone with the URL may access that port until expiry or revocation. URL returned once; stored routing data contains only the token hash. Ports 1024–65535; SSH and privileged ports excluded. Up to 8 active grants per generation. TTL defaults to 900 seconds and is clipped to the hard deadline; issuance does not extend the lease. HTTP and WebSockets use the same origin. Cookies are stripped. The app must already be listening. Cookie mutations require trusted Origin. Requests cap at 1024 bytes. Index-write failure triggers grant revocation; partial cleanup returns 503 with previewId for retry. Lost responses: list and revoke, then issue a new URL.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"port":{"type":"integer","minimum":1024,"maximum":65535},"ttlSeconds":{"type":"integer","minimum":60,"maximum":3600}},"required":["port"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PreviewGrant"},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable or partial failure; retry revocation with previewId when supplied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"previewId":{"type":"string","pattern":"^[a-f0-9]{32}$"}},"required":["error"]}}}}}},"get":{"operationId":"listContainerPreviews","tags":["Containers"],"summary":"List active grants for an owned running generation","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Requires paid access and exact running generation. Remains available when issuance is disabled. Returns grant metadata only, including grants left by lost issuance responses; no URLs, raw tokens or hashes. Does not create or restart a machine.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"previews":{"type":"array","items":{"$ref":"#/components/schemas/PreviewGrant"},"maxItems":8}},"required":["previews"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"revokeContainerPreview","tags":["Containers"],"summary":"Revoke a preview and close its active transports","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Owner only; requires paid access and exact running generation. Remains available when issuance is disabled. Idempotent within that generation. Removes the owner-scoped route before closing runtime HTTP/WebSocket transports. Both operations are attempted even when one fails. Partial failures return 503 with previewId; retry the same request. Cookie mutations require trusted Origin.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","pattern":"^[a-f0-9]{32}$"},"required":true,"name":"previewId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean","enum":[true]}},"required":["revoked"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable or partial failure; retry revocation with previewId when supplied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"previewId":{"type":"string","pattern":"^[a-f0-9]{32}$"}},"required":["error"]}}}}}}},"/private-services/networks":{"get":{"operationId":"listPrivateServiceNetworks","tags":["Private Services"],"summary":"List owned networks and registered machine generations","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Private Services HTTP prototype. Account-owned registry; explicit machine membership and exact running generations. Plain HTTP on port 80 to http://NAME.internal routes to a registered application port. No arbitrary TCP, database protocol, private IP, or HTTPS support. Internet policy and machine lifecycles are independent. Public previews remain opt-in. Requests and responses are bounded to 1 MiB; requests time out after 10 seconds. WebSockets and CONNECT are rejected. Application redirects are returned without being followed. Account identity is supplied by the platform; guests need no Mainbrella API key. Cookie mutations require a trusted Origin. Registry entries may outlive stopped generations; stale entries cannot route. With search, page, or limit, returns pagination metadata; page defaults to 1 and limit to 10. Pages beyond the last page clamp to the last page. Without query parameters returns the complete registry for compatibility. Listing remains available when issuance is disabled and does not start machines.","parameters":[{"schema":{"type":"string","enum":["ad_hoc","production"],"description":"Filter networks by lifecycle; omitted legacy values are ad_hoc."},"required":false,"description":"Filter networks by lifecycle; omitted legacy values are ad_hoc.","name":"lifecycle","in":"query"},{"schema":{"type":"string","maxLength":63,"description":"Case-insensitive substring of the network name."},"required":false,"description":"Case-insensitive substring of the network name.","name":"search","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":9007199254740991},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"networks":{"type":"array","items":{"$ref":"#/components/schemas/PrivateServiceNetwork"},"maxItems":16},"total":{"type":"integer","minimum":0},"totalNetworks":{"type":"integer","minimum":0},"page":{"type":"integer","exclusiveMinimum":0},"limit":{"type":"integer","exclusiveMinimum":0}},"required":["networks"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"createPrivateServiceNetwork","tags":["Private Services"],"summary":"Create an account-owned Private Services network","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Private Services HTTP prototype. Account-owned registry; explicit machine membership and exact running generations. Plain HTTP on port 80 to http://NAME.internal routes to a registered application port. No arbitrary TCP, database protocol, private IP, or HTTPS support. Internet policy and machine lifecycles are independent. Public previews remain opt-in. Requests and responses are bounded to 1 MiB; requests time out after 10 seconds. WebSockets and CONNECT are rejected. Application redirects are returned without being followed. Account identity is supplied by the platform; guests need no Mainbrella API key. Cookie mutations require a trusted Origin. Requires paid access and explicit deployment enablement. lifecycle defaults to ad_hoc. production requires usage billing; the registry is durable and members must be production services. Empty networks do not allocate or bill compute. Up to 16 networks per account. Duplicate name returns network_name_conflict; limit returns network_limit. Body limit 1024 bytes.","parameters":[{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$"},"lifecycle":{"type":"string","enum":["ad_hoc","production"]}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivateServiceNetwork"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deletePrivateServiceNetwork","tags":["Private Services"],"summary":"Delete an empty owned network","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Private Services HTTP prototype. Account-owned registry; explicit machine membership and exact running generations. Plain HTTP on port 80 to http://NAME.internal routes to a registered application port. No arbitrary TCP, database protocol, private IP, or HTTPS support. Internet policy and machine lifecycles are independent. Public previews remain opt-in. Requests and responses are bounded to 1 MiB; requests time out after 10 seconds. WebSockets and CONNECT are rejected. Application redirects are returned without being followed. Account identity is supplied by the platform; guests need no Mainbrella API key. Cookie mutations require a trusted Origin. Idempotent. Detach all members first; otherwise network_not_empty. Remains available when issuance is disabled or machines are stopped. Does not stop machines.","parameters":[{"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$"},"required":true,"name":"network","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/private-services/members":{"put":{"operationId":"attachPrivateServiceMember","tags":["Private Services"],"summary":"Attach a running generation and optionally register an HTTP service port","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Private Services HTTP prototype. Account-owned registry; explicit machine membership and exact running generations. Plain HTTP on port 80 to http://NAME.internal routes to a registered application port. No arbitrary TCP, database protocol, private IP, or HTTPS support. Internet policy and machine lifecycles are independent. Public previews remain opt-in. Requests and responses are bounded to 1 MiB; requests time out after 10 seconds. WebSockets and CONNECT are rejected. Application redirects are returned without being followed. Account identity is supplied by the platform; guests need no Mainbrella API key. Cookie mutations require a trusted Origin. Requires paid access and deployment enablement. One network per machine generation. Members must match the network lifecycle; mismatches return 409 network_lifecycle_conflict. Upsert by machine ID; service names are unique within each network. Omit port for a caller-only machine. Conflicts return service_name_conflict or machine_already_attached. Stopped or replaced generations return container_not_running. Body limit 1024 bytes.","parameters":[{"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$"},"required":true,"name":"network","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivateServiceMember"}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PrivateServiceMember"},{"type":"object","properties":{"network":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$"}},"required":["network"],"additionalProperties":false}]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"detachPrivateServiceMember","tags":["Private Services"],"summary":"Detach an exact generation without stopping it","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Private Services HTTP prototype. Account-owned registry; explicit machine membership and exact running generations. Plain HTTP on port 80 to http://NAME.internal routes to a registered application port. No arbitrary TCP, database protocol, private IP, or HTTPS support. Internet policy and machine lifecycles are independent. Public previews remain opt-in. Requests and responses are bounded to 1 MiB; requests time out after 10 seconds. WebSockets and CONNECT are rejected. Application redirects are returned without being followed. Account identity is supplied by the platform; guests need no Mainbrella API key. Cookie mutations require a trusted Origin. Idempotent within an existing network. Delayed cleanup for an old generation cannot remove its replacement. Name is required; the exact ID and createdAt select the membership. Available when issuance is disabled or machines are stopped. Body limit 1024 bytes.","parameters":[{"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,62}$"},"required":true,"name":"network","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivateServiceMember"}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"detached":{"type":"boolean","enum":[true]}},"required":["detached"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/status":{"get":{"operationId":"getOperationalStatus","tags":["Operations"],"summary":"Read component observations and incidents","security":[],"description":"Public status with evidence scope. Missing observations or observations older than 15 minutes are unknown. Reachability and control-plane checks do not establish full workflow health. Up to 50 incidents are returned with active incidents first; active incidents prevent an overall operational state. No provisioning occurs.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["operational","degraded","outage","unknown"]},"generatedAt":{"type":"string","format":"date-time"},"staleAfterMs":{"type":"integer"},"components":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string","enum":["website","api","auth","provisioning","ssh","images","billing"]},"state":{"type":"string","enum":["operational","degraded","outage","unknown"]},"stale":{"type":"boolean"},"scope":{"type":["string","null"],"enum":["reachability","control_plane","synthetic",null]},"latencyMs":{"type":["integer","null"]},"checkedAt":{"type":["string","null"],"format":"date-time"}},"required":["component","state","stale","scope","latencyMs","checkedAt"]}},"incidents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"component":{"type":"string","enum":["website","api","auth","provisioning","ssh","images","billing"]},"title":{"type":"string"},"state":{"type":"string","enum":["investigating","identified","monitoring","resolved"]},"message":{"type":"string"},"started_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"resolved_at":{"type":["string","null"],"format":"date-time"}},"required":["id","component","title","state","message","started_at","updated_at","resolved_at"]}}},"required":["state","generatedAt","staleAfterMs","components","incidents"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/status/history":{"get":{"operationId":"getStatusHistory","tags":["Operations"],"summary":"Read recent component observations","security":[],"description":"Returns up to 100 observations from the past 31 days, optionally for one component. Follow next.before and next.beforeId together to paginate without skipping samples with equal timestamps; beforeId requires before. Expired observations are excluded even before storage maintenance; incidents are retained separately. Does not estimate availability from missing samples.","parameters":[{"schema":{"type":"string","format":"date-time"},"required":false,"name":"before","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0},"required":false,"name":"beforeId","in":"query"},{"schema":{"type":"string","enum":["website","api","auth","provisioning","ssh","images","billing"]},"required":false,"name":"component","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"observations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"component":{"type":"string","enum":["website","api","auth","provisioning","ssh","images","billing"]},"state":{"type":"string","enum":["operational","degraded","outage","unknown"]},"scope":{"type":"string","enum":["reachability","control_plane","synthetic"]},"latencyMs":{"type":["integer","null"]},"checkedAt":{"type":"string","format":"date-time"}},"required":["id","component","state","scope","latencyMs","checkedAt"]}},"retentionDays":{"type":"integer"},"next":{"type":["object","null"],"properties":{"before":{"type":"string","format":"date-time"},"beforeId":{"type":"integer"}},"required":["before","beforeId"]}},"required":["observations","retentionDays","next"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/internal/status/observations":{"post":{"operationId":"recordStatusObservations","tags":["Internal"],"summary":"Record bounded operational observations","security":[{"monitoring":[]}],"description":"Requires configured MONITORING_SECRET Bearer credential. At most seven distinct components per request. Timestamp is assigned by the server. No user/API key authentication.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"observations":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string","enum":["website","api","auth","provisioning","ssh","images","billing"]},"state":{"type":"string","enum":["operational","degraded","outage","unknown"]},"scope":{"type":"string","enum":["reachability","control_plane","synthetic"]},"latencyMs":{"type":"integer","minimum":0,"maximum":300000}},"required":["component","state","scope"],"additionalProperties":false},"minItems":1,"maxItems":7}},"required":["observations"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"checkedAt":{"type":"string","format":"date-time"}},"required":["ok","checkedAt"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/internal/status/incidents":{"post":{"operationId":"recordStatusIncident","tags":["Internal"],"summary":"Create or update a public incident","security":[{"monitoring":[]}],"description":"Requires configured MONITORING_SECRET. Upserts by UUID and preserves initial timestamp. Component cannot change; resolved incidents cannot reopen. Title/message are public operator-authored text.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"component":{"type":"string","enum":["website","api","auth","provisioning","ssh","images","billing"]},"title":{"type":"string","minLength":1,"maxLength":160},"state":{"type":"string","enum":["investigating","identified","monitoring","resolved"]},"message":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","component","title","state","message"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string","format":"uuid"}},"required":["ok","id"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/events":{"get":{"operationId":"listContainerLifecycleEvents","tags":["Containers"],"summary":"Read lifecycle history for an owned generation","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Read-only, available during billing outages and after stop. Does not provision, renew activity or contact the guest. Events have stable IDs and increasing slot-wide sequence numbers; filter by exact generation. Retention 604800000 ms, bounded to 256 events per machine slot across generations. Deduplicate by id, order by sequence and use nextCursor for pagination. historyTruncated reports when the starting event has been pruned. A started event establishes readiness; starting alone does not. Failed/stopped observations use bounded reason codes, never provider exception text. Natural-stop timestamps record when the control plane observed stop, not an exact guest timestamp. Legacy/expired generations without observations return 404. Customer webhooks are not yet available.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"integer","minimum":0},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sequence":{"type":"integer","exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time"},"occurredAt":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["starting","started","failed","stopped"]},"reason":{"type":"string"},"size":{"type":"string"},"retainUntil":{"type":"integer"}},"required":["id","sequence","createdAt","occurredAt","type","size","retainUntil"]}},"nextCursor":{"type":"integer","minimum":0},"hasMore":{"type":"boolean"},"historyTruncated":{"type":"boolean"},"retainForMs":{"type":"integer"}},"required":["events","nextCursor","hasMore","historyTruncated","retainForMs"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/metrics":{"get":{"operationId":"getContainerWorkloadMetrics","tags":["Containers"],"summary":"Read provider workload metric history for an owned generation","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Disabled until explicit operator configuration/qualification. Requires observability.metrics capability. Reads provider analytics using an opaque generation label; no guest exec or lease renewal. Requested range stays within that generation, the last seven days and 86400000 ms. Default last hour, 60000 ms buckets, bounded 1441 rows. Half-open [from,to); first bucket can begin before an unaligned from. Samples can be delayed/adaptively sampled; empty/legacy data is unobserved, never zero or healthy. CPU seconds and memory peak bytes come from workload metrics; diskUsagePeak preserves the provider value pending unit qualification. This is neither billing resource allocation nor public service health. Credentials and provider identity labels stay in the control plane.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"bucketMs":{"type":"integer"},"source":{"type":"string","enum":["cloudflare-workload-analytics"]},"state":{"type":"string","enum":["observed","unobserved"]},"buckets":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"samples":{"type":"integer","exclusiveMinimum":0},"cpuSeconds":{"type":["number","null"],"minimum":0},"memoryPeakBytes":{"type":["number","null"],"minimum":0},"diskUsagePeak":{"type":["number","null"],"minimum":0,"description":"Provider diskUsage maximum. Unit qualification remains an operator rollout gate; do not label it as bytes or billing usage."}},"required":["at","samples","cpuSeconds","memoryPeakBytes","diskUsagePeak"]}}},"required":["id","createdAt","from","to","bucketMs","source","state","buckets"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/telemetry/logs":{"get":{"operationId":"exportContainerOtlpLogs","tags":["Containers"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"summary":"Export lifecycle events as an OTLP/HTTP JSON logs request","description":"Pull export; forward the JSON body to your collector /v1/logs. Same ownership, generation and retention as /containers/events. Pagination metadata is returned in Mainbrella-Next-Cursor, Mainbrella-Has-More and Mainbrella-History-Truncated headers. Persist a cursor only after collector acknowledgement and deduplicate on event.id. Does not push to a customer URL or renew compute.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"integer","minimum":0},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Successful response.","headers":{"Mainbrella-Next-Cursor":{"schema":{"type":"string"}},"Mainbrella-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"Mainbrella-History-Truncated":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"application/json":{"schema":{"type":"object","properties":{"resourceLogs":{"type":"array","items":{"type":"object","properties":{"resource":{"type":"object","properties":{"attributes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"stringValue":{"type":"string"}},"required":["stringValue"]},{"type":"object","properties":{"intValue":{"type":"string"}},"required":["intValue"]}]}},"required":["key","value"]}}},"required":["attributes"]},"scopeLogs":{"type":"array","items":{"type":"object","properties":{"scope":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}},"required":["name","version"]},"logRecords":{"type":"array","items":{"type":"object","properties":{"timeUnixNano":{"type":"string"},"severityNumber":{"type":"integer"},"severityText":{"type":"string"},"body":{"type":"object","properties":{"stringValue":{"type":"string"}},"required":["stringValue"]},"attributes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"stringValue":{"type":"string"}},"required":["stringValue"]},{"type":"object","properties":{"intValue":{"type":"string"}},"required":["intValue"]}]}},"required":["key","value"]}}},"required":["timeUnixNano","severityNumber","severityText","body","attributes"]}}},"required":["scope","logRecords"]}}},"required":["resource","scopeLogs"]}}},"required":["resourceLogs"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/telemetry/metrics":{"get":{"operationId":"exportContainerOtlpMetrics","tags":["Containers"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"summary":"Export workload metrics as an OTLP/HTTP JSON metrics request","description":"Requires observability.metrics. Pull export for a collector /v1/metrics: sampled CPU seconds as delta sums, peak memory bytes as gauges. Uses the same generation/range checks as /containers/metrics. Missing samples are omitted. Unqualified disk units are omitted. Mainbrella-Metrics-State is observed or unobserved. Export non-overlapping intervals to avoid duplicate delta sums.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Successful response.","headers":{"Mainbrella-Metrics-State":{"schema":{"type":"string","enum":["observed","unobserved"]}}},"content":{"application/json":{"schema":{"type":"object","properties":{"resourceMetrics":{"type":"array","items":{"type":"object","properties":{"resource":{"type":"object","properties":{"attributes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"stringValue":{"type":"string"}},"required":["stringValue"]},{"type":"object","properties":{"intValue":{"type":"string"}},"required":["intValue"]}]}},"required":["key","value"]}}},"required":["attributes"]},"scopeMetrics":{"type":"array","items":{"type":"object","properties":{"scope":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}},"required":["name","version"]},"metrics":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"unit":{"type":"string"},"description":{"type":"string"},"sum":{"type":"object","properties":{"aggregationTemporality":{"type":"number","enum":[1]},"isMonotonic":{"type":"boolean","enum":[true]},"dataPoints":{"type":"array","items":{"type":"object","properties":{"startTimeUnixNano":{"type":"string"},"timeUnixNano":{"type":"string"},"asDouble":{"type":"number"},"attributes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"stringValue":{"type":"string"}},"required":["stringValue"]},{"type":"object","properties":{"intValue":{"type":"string"}},"required":["intValue"]}]}},"required":["key","value"]}}},"required":["startTimeUnixNano","timeUnixNano","asDouble","attributes"]}}},"required":["aggregationTemporality","isMonotonic","dataPoints"]},"gauge":{"type":"object","properties":{"dataPoints":{"type":"array","items":{"type":"object","properties":{"startTimeUnixNano":{"type":"string"},"timeUnixNano":{"type":"string"},"asDouble":{"type":"number"},"attributes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"stringValue":{"type":"string"}},"required":["stringValue"]},{"type":"object","properties":{"intValue":{"type":"string"}},"required":["intValue"]}]}},"required":["key","value"]}}},"required":["startTimeUnixNano","timeUnixNano","asDouble","attributes"]}}},"required":["dataPoints"]}},"required":["name","unit","description"]}}},"required":["scope","metrics"]}}},"required":["resource","scopeMetrics"]}}},"required":["resourceMetrics"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/webhook":{"get":{"operationId":"getContainerWebhook","tags":["Containers"],"summary":"Read an owned generation webhook","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Available after stop and during billing outages. One configured destination per exact generation, up to 32 retained configurations per slot. Signing secrets are never returned by reads. No guest request or lease renewal.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","maxLength":2048,"format":"uri"},"createdAt":{"type":"string","format":"date-time"},"configuredAt":{"type":"string","format":"date-time"},"retainUntil":{"type":"integer"}},"required":["id","url","createdAt","configuredAt","retainUntil"]}},"required":["webhook"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"put":{"operationId":"configureContainerWebhook","tags":["Containers"],"summary":"Configure and rotate an owned generation webhook","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Disabled until API/runtime operator configuration. Requires an exact live paid generation. HTTPS targets must match an operator-controlled relay allowlist; arbitrary customer domains, IPs, credentials, custom ports and redirects are unsupported. Body caps at 4096 bytes. Returns a new signingSecret once; encrypted in runtime storage and never sent to the guest. Every PUT rotates the configuration/secret and clears old delivery attempts; no automatic retries. If a response is lost, reconcile with GET and explicitly rotate again if needed. Optional replayFromCursor queues retained generation events after that cursor; otherwise only future events. Configuration expires seven days after setup; deliveries expire with configuration or event retention, whichever is earlier. Cookie mutations require trusted Origin.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"replayFromCursor":{"type":"integer","minimum":0}},"required":["url"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","maxLength":2048,"format":"uri"},"createdAt":{"type":"string","format":"date-time"},"configuredAt":{"type":"string","format":"date-time"},"retainUntil":{"type":"integer"}},"required":["id","url","createdAt","configuredAt","retainUntil"]},"signingSecret":{"type":"string"}},"required":["webhook","signingSecret"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"removeContainerWebhook","tags":["Containers"],"summary":"Remove an owned webhook and future deliveries","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Owned cleanup remains available during billing outages and after stop. Cancels in-flight requests and removes queued attempts. A receiver may already have accepted an in-flight request; removal cannot undo delivery. Does not affect replacement generations. Cookie mutations require trusted Origin.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","enum":[true]}},"required":["removed"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/webhook/deliveries":{"get":{"operationId":"listContainerWebhookDeliveries","tags":["Containers"],"summary":"Read bounded webhook delivery outcomes","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Up to 256 retained deliveries per slot. Includes stable lifecycle event ID, sequence, status, current retry-cycle attempts, manual retries, next/last attempt and HTTP status. Payload, response body, signing secret and provider exceptions are excluded. Delivery is at least once; consumers deduplicate by event ID and order by sequence. Eight automatic attempts use bounded backoff; response timeout is 10 seconds and success is any 2xx. Runtime recovery can cause duplicates. Reads remain available during billing outages.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sequence":{"type":"integer","exclusiveMinimum":0},"status":{"type":"string","enum":["pending","sending","delivered","exhausted"]},"attempts":{"type":"integer","minimum":0},"manualRetries":{"type":"integer","minimum":0},"nextAt":{"type":["integer","null"]},"retainUntil":{"type":"integer"},"lastAttemptAt":{"type":"integer"},"httpStatus":{"type":["integer","null"]}},"required":["id","sequence","status","attempts","manualRetries","nextAt","retainUntil"]}}},"required":["deliveries"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/webhook/retry":{"post":{"operationId":"retryContainerWebhookDelivery","tags":["Containers"],"summary":"Retry an exhausted owned webhook delivery","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Only retained exhausted deliveries are eligible. Restarts the eight-attempt retry cycle, at most three manual retries per event. The event ID stays stable. Available during billing outages; never starts a guest or renews activity. Cookie mutations require trusted Origin.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid"}},"required":["eventId"],"additionalProperties":false}}}},"responses":{"202":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sequence":{"type":"integer","exclusiveMinimum":0},"status":{"type":"string","enum":["pending","sending","delivered","exhausted"]},"attempts":{"type":"integer","minimum":0},"manualRetries":{"type":"integer","minimum":0},"nextAt":{"type":["integer","null"]},"retainUntil":{"type":"integer"},"lastAttemptAt":{"type":"integer"},"httpStatus":{"type":["integer","null"]}},"required":["id","sequence","status","attempts","manualRetries","nextAt","retainUntil"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/export":{"get":{"operationId":"exportWorkspaceFiles","tags":["Containers"],"summary":"Download a portable gzip tar archive of /workspace","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Requires owned running generation and paid access. Export is limited to 16777216 compressed bytes and 60 seconds. Quiesce writers first; concurrent writes may fail the export. Mounted filesystems are excluded. Restore a saved workspace before exporting it. Archives preserve file permissions and symlinks; the provider snapshot handle is never exported.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"}],"responses":{"200":{"description":"Portable workspace backup.","content":{"application/gzip":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/workspaces":{"get":{"operationId":"listWorkspaces","tags":["Containers"],"summary":"List account-owned saved filesystem workspaces","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Available when persistence issuance is disabled or billing is unavailable. Metadata only; provider handles remain private. Expired metadata remains for up to 24 hours. Capture usage reserves full source disk capacity, including deleted/expired workspaces and failed or uncertain saves. Retained capture reservations last at least 60 days; daily buckets may retain earlier captures for up to one extra day.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"workspaces":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"}},"limits":{"type":["object","null"],"properties":{"maxSaved":{"type":"number"},"maxReservedBytes":{"type":"number"},"retentionMs":{"type":"number"},"maxSavesPerMonth":{"type":"number"},"maxCaptureBytesPerMonth":{"type":"number"},"maxRetainedCaptureBytes":{"type":"number"}},"required":["maxSaved","maxReservedBytes","retentionMs","maxSavesPerMonth","maxCaptureBytesPerMonth","maxRetainedCaptureBytes"]},"usage":{"type":"object","properties":{"saved":{"type":"number"},"reservedBytes":{"type":"number"},"savesThisMonth":{"type":"number"},"captureBytesThisMonth":{"type":"number"},"retainedCaptureBytes":{"type":"number"},"captureBudgetResetsAt":{"type":"integer","description":"Next UTC month boundary, when monthly save and capture budgets reset."},"nextRetainedCaptureReleaseAt":{"type":["integer","null"],"description":"Earliest retained-capture accounting bucket release time, in Unix milliseconds; null when empty. Not a physical deletion deadline."},"nextRetainedCaptureReleaseBytes":{"type":"integer","minimum":0,"description":"Reserved capture bytes released at nextRetainedCaptureReleaseAt. Later captures may extend a daily bucket."}},"required":["saved","reservedBytes","savesThisMonth","captureBytesThisMonth","retainedCaptureBytes","captureBudgetResetsAt","nextRetainedCaptureReleaseAt","nextRetainedCaptureReleaseBytes"]}},"required":["workspaces","limits","usage"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"saveWorkspace","tags":["Containers"],"summary":"Snapshot an owned running generation and optionally stop it","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Requires persistence.snapshots and paid access. Idempotency-Key is required; identical retries recover capture receipts for 24 hours without charging again. Snapshot commit precedes stop. Immutable full root-filesystem snapshot; no RAM/process state or separately mounted filesystems. Stop:false leaves the source running. Stop:true destroys it only after save. Concurrent guest writes are not application-consistent; quiesce applications before saving. Retention is fixed at save and restores do not extend it. Quotas reserve the source disk capacity before capture, including archived workspaces. Monthly save-count and capture-byte limits plus retained capture-byte limits survive deletion and subscription changes. Retained bytes remain reserved for at least 60 days across UTC month boundaries. HTTP 429 errors: workspace_quota_exceeded (live storage/count), workspace_save_limit (monthly count), workspace_capture_budget_exceeded (monthly bytes), workspace_retained_budget_exceeded (retained bytes). Failed or uncertain captures retain their reservations. Existing saved workspaces retain their original expiry when limits change. Body is limited to 32 KiB. Optional immutable launch records a foreground command, working directory and local HTTP readiness check; requires persistence.restoreLaunch when restored. Canonical recipe defaults are included in the keyed save fingerprint. Saving does not launch anything in the source. Omit launch to retain filesystem-only restore behavior.","parameters":[{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"required":true,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"name":{"type":"string","minLength":1,"maxLength":80},"stop":{"type":"boolean"},"launch":{"type":"object","properties":{"command":{"type":"string","minLength":1,"maxLength":4096,"pattern":"^[^\\u0000]+$","description":"Shell source up to 4096 characters; multiline commands are allowed. NUL bytes are rejected."},"cwd":{"type":"string","minLength":1,"maxLength":1024,"description":"Absolute working directory without dot segments; defaults to /workspace."},"readiness":{"type":"object","properties":{"port":{"type":"integer","minimum":1024,"maximum":65535},"path":{"type":"string","minLength":1,"maxLength":1024,"description":"Local HTTP path, default /. Redirects are not followed."},"timeoutMs":{"type":"integer","minimum":1000,"maximum":60000,"description":"Readiness deadline after machine boot, default 30000 ms."}},"required":["port"],"additionalProperties":false}},"required":["command","readiness"],"additionalProperties":false,"description":"Saved foreground shell launch recipe. No raw environment values or new secret semantics. Runs once in each restored filesystem generation."}},"required":["id","createdAt","name"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"201":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/workspaces/{workspaceId}":{"get":{"operationId":"getWorkspace","tags":["Containers"],"summary":"Read owned workspace metadata","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workspaceId","in":"path"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"patch":{"operationId":"updateWorkspace","tags":["Containers"],"summary":"Rename or archive an owned workspace","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Archiving prevents restore until unarchived. Does not stop an already restored machine, extend expiry or release storage quota. Does not require active billing.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteWorkspace","tags":["Containers"],"summary":"Revoke future restores and release saved-workspace quota","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Idempotent for 24 hours. Releases live saved-workspace count/capacity but does not refund monthly saves, monthly capture bytes or retained capture bytes. Removes the private handle; already admitted restores/running machines continue. Cloudflare has no Worker snapshot deletion primitive; provider data expires according to its TTL, which refreshes on restore. This does not promise immediate physical erasure.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workspaceId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/auth/google":{"post":{"operationId":"googleLogin","tags":["Authentication"],"summary":"Sign in with google and create a browser session","security":[],"description":"New accounts receive a welcome email; delivery failures do not fail signup. Existing accounts and provider linking do not send another welcome email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"credential":{"type":"string"}},"required":["credential"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/PublicUser"},"created":{"type":"boolean"}},"required":["user","created"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/auth/email":{"post":{"operationId":"emailLogin","tags":["Authentication"],"summary":"Sign in with email and create a browser session","security":[],"description":"Signs in an existing password account or creates an account when the email is unused. New passwords require 8–128 characters. Email is trimmed and lowercased. A welcome email is sent after account creation; delivery failures do not fail signup. No verification email is sent. Existing provider-only accounts must use their provider. Limited to 20 attempts per minute per IP.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"password":{"type":"string","minLength":1,"maxLength":128}},"required":["email","password"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/PublicUser"},"created":{"type":"boolean"}},"required":["user","created"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/auth/app/google":{"post":{"operationId":"nativeGoogleLogin","tags":["Authentication"],"summary":"Sign in with google for a native app","security":[],"description":"New accounts receive a welcome email; delivery failures do not fail signup. Existing accounts and provider linking do not send another welcome email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"credential":{"type":"string"}},"required":["credential"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NativeTokens"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/auth/app/email":{"post":{"operationId":"nativeEmailLogin","tags":["Authentication"],"summary":"Sign in with email for a native app","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NativeTokens"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/auth/app/apple":{"post":{"operationId":"nativeAppleLogin","tags":["Authentication"],"summary":"Sign in with apple for a native app","security":[],"description":"New accounts receive a welcome email; delivery failures do not fail signup. Existing accounts and provider linking do not send another welcome email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"identity_token":{"type":"string"},"nonce":{"type":"string"},"name":{"type":"string"}},"required":["identity_token","nonce"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NativeTokens"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/auth/app/anonymous":{"post":{"operationId":"nativeAnonymousLogin","tags":["Authentication"],"summary":"Create an anonymous native account","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NativeTokens"}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/auth/me":{"get":{"operationId":"getBrowserUser","tags":["Authentication"],"summary":"Get the browser session user","description":"Returns user: null when there is no browser session.","security":[{},{"cookieAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"allOf":[{"$ref":"#/components/schemas/PublicUser"},{"type":["object","null"]}]}},"required":["user"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/auth/logout":{"post":{"operationId":"browserLogout","tags":["Authentication"],"summary":"Revoke the browser session","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/auth/app/me":{"get":{"operationId":"getNativeUser","tags":["Authentication"],"summary":"Get the native app user","security":[{"nativeBearer":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/PublicUser"}},"required":["user"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteNativeAccount","tags":["Authentication"],"summary":"Delete the native app account","security":[{"nativeBearer":[]}],"description":"Linked providers require fresh provider credentials before deletion. Git R2 cleanup is queued durably in the same database transaction before deleting the account; retained financial evidence survives account deletion.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"google_id_token":{"type":"string"},"google_access_token":{"type":"string"},"apple_identity_token":{"type":"string"},"apple_nonce":{"type":"string"},"apple_authorization_code":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Provider request failed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/auth/app/refresh":{"post":{"operationId":"refreshNativeTokens","tags":["Authentication"],"summary":"Rotate native app tokens","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"refresh_token":{"type":"string"}},"required":["refresh_token"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NativeTokens"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/auth/app/logout":{"post":{"operationId":"nativeLogout","tags":["Authentication"],"summary":"Revoke native app tokens","description":"Revokes the refresh token and, if supplied, the matching Bearer access token.","security":[{},{"nativeBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"refresh_token":{"type":"string"}},"required":["refresh_token"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/api-keys/me":{"get":{"operationId":"getAPIKeyAccount","tags":["API Keys"],"summary":"Get the account identity authenticated by an API key","description":"Returns a stable account ID for recovery ownership checks, including after key rotation. Requires an API key Bearer credential; browser cookies do not authenticate this endpoint. Does not return personal details or the key secret.","security":[{"apiKeyBearer":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string"}},"required":["accountId"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/api-keys":{"get":{"operationId":"listAPIKeys","tags":["API Keys"],"summary":"List your API keys without secrets","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]}},"required":["id","name","prefix","created_at","last_used_at"]}}},"required":["keys"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"createAPIKey","tags":["API Keys"],"summary":"Create a named API key","security":[{"cookieAuth":[]}],"description":"Requires a trusted Origin and browser session. Maximum 20 keys. The secret is returned once; it authorizes container, image and SSH operations until revoked, subject to account entitlements.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"]}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]}},"required":["id","name","prefix","created_at","last_used_at"]},"token":{"type":"string"}},"required":["key","token"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"revokeAPIKey","tags":["API Keys"],"summary":"Revoke an API key","security":[{"cookieAuth":[]}],"description":"Requires a trusted Origin and browser session. Revocation prevents subsequent API requests with this key.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/projects":{"get":{"operationId":"listProjects","tags":["Projects"],"summary":"List your projects","security":[{"cookieAuth":[]}],"description":"Requires a browser session. Returns all of the signed-in user's projects, including Builder apps, newest first. build_app_id links to the optional Builder source workspace; git_version_id is its current saved Git head. Existing Builder file, version and repository endpoints accept build_app_id.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"domain":{"type":["string","null"]},"created_at":{"type":"string"},"build_app_id":{"type":["string","null"],"format":"uuid"},"git_version_id":{"type":["string","null"],"format":"uuid"},"github_repo":{"type":["string","null"]},"github_branch":{"type":["string","null"]},"github_commit_id":{"type":["string","null"]},"github_storage":{"type":["string","null"],"enum":["retained","deleting","github",null],"description":"For GitHub-linked projects: retained means Mainbrella still stores a working copy; deleting means physical cleanup is pending; github means the saved source is read from GitHub after deleting the hosted copy. Future builds can create a new working copy."}},"required":["id","name","domain","created_at","build_app_id","git_version_id","github_repo","github_branch","github_commit_id","github_storage"]}}},"required":["projects"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"createProject","tags":["Projects"],"summary":"Create a named project","security":[{"cookieAuth":[]}],"description":"Requires a trusted Origin and browser session. The project belongs to the signed-in user. Names are trimmed and may contain up to 80 characters. An optional domain is trimmed, may contain up to 253 characters, and blank or null values are stored as null.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"domain":{"type":["string","null"],"maxLength":253,"description":"Optional project domain; blank values are stored as null."},"git":{"type":"boolean","description":"Opt in to Builder Git history by creating an idle source workspace. Defaults to false. Enabling starts no build; the first saved build creates a version. Omitting or passing false preserves any existing workspace and history."}},"required":["name"]}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"domain":{"type":["string","null"]},"created_at":{"type":"string"},"build_app_id":{"type":["string","null"],"format":"uuid"},"git_version_id":{"type":["string","null"],"format":"uuid"},"github_repo":{"type":["string","null"]},"github_branch":{"type":["string","null"]},"github_commit_id":{"type":["string","null"]},"github_storage":{"type":["string","null"],"enum":["retained","deleting","github",null],"description":"For GitHub-linked projects: retained means Mainbrella still stores a working copy; deleting means physical cleanup is pending; github means the saved source is read from GitHub after deleting the hosted copy. Future builds can create a new working copy."}},"required":["id","name","domain","created_at","build_app_id","git_version_id","github_repo","github_branch","github_commit_id","github_storage"]}},"required":["project"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"patch":{"operationId":"updateProject","tags":["Projects"],"summary":"Update a project","security":[{"cookieAuth":[]}],"description":"Requires a trusted Origin and browser session. Updates only a project owned by the signed-in user; its ID and creation time are preserved. Names are required. An omitted domain is preserved; a supplied domain is trimmed, may contain up to 253 characters, and blank or null clears it.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"domain":{"type":["string","null"],"maxLength":253,"description":"Optional project domain; blank values are stored as null."},"git":{"type":"boolean","description":"Opt in to Builder Git history by creating an idle source workspace. Defaults to false. Enabling starts no build; the first saved build creates a version. Omitting or passing false preserves any existing workspace and history."}},"required":["name"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"domain":{"type":["string","null"]},"created_at":{"type":"string"},"build_app_id":{"type":["string","null"],"format":"uuid"},"git_version_id":{"type":["string","null"],"format":"uuid"},"github_repo":{"type":["string","null"]},"github_branch":{"type":["string","null"]},"github_commit_id":{"type":["string","null"]},"github_storage":{"type":["string","null"],"enum":["retained","deleting","github",null],"description":"For GitHub-linked projects: retained means Mainbrella still stores a working copy; deleting means physical cleanup is pending; github means the saved source is read from GitHub after deleting the hosted copy. Future builds can create a new working copy."}},"required":["id","name","domain","created_at","build_app_id","git_version_id","github_repo","github_branch","github_commit_id","github_storage"]}},"required":["project"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/projects/endpoint":{"get":{"operationId":"getProjectEndpoint","tags":["Projects"],"summary":"Inspect a project endpoint and its domains","security":[{"cookieAuth":[]}],"description":"Requires a browser session and an owned project. Inspection and cleanup remain available when publication is disabled. Domain metadata on the project does not publish an application. DNS, certificate, and exact-generation backend availability are separate states. The stable default URL is public after publication. Local development exposes the default URL on localhost and permits app.localhost aliases only when LOCAL_DEV=true and PROJECT_DOMAIN_PROVIDER=local; DNS and TLS are simulated there.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"url":{"type":"string"},"target":{"$ref":"#/components/schemas/ProjectTarget"},"backendStatus":{"type":"string","enum":["running","unavailable","unlinked"]}},"required":["projectId","url","target","backendStatus"]},"domains":{"type":"array","items":{"$ref":"#/components/schemas/ProjectDomain"}},"hosting":{"type":"object","properties":{"supported":{"type":"boolean"},"customDomains":{"type":"boolean"},"localDevelopment":{"type":"boolean"},"apexIps":{"type":"array","items":{"type":"string"}}},"required":["supported","customDomains","localDevelopment","apexIps"]}},"required":["endpoint","domains","hosting"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"put":{"operationId":"publishProjectEndpoint","tags":["Projects"],"summary":"Publish a project to a container or network service","security":[{"cookieAuth":[]}],"description":"Requires a trusted Origin, browser session, paid access, and enabled project hosting. Targets an owned exact running container generation and application port, or resolves one selected registered network service to that generation. Replacement generations require explicit republication. Container leases are unchanged. Revision fencing and persisted cleanup metadata reconcile lost or concurrent publication responses; project_reconciliation_required requires retrying cleanup before publishing again.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"$ref":"#/components/schemas/ProjectTarget"}},"required":["target"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"url":{"type":"string"},"target":{"$ref":"#/components/schemas/ProjectTarget"},"backendStatus":{"type":"string","enum":["running","unavailable","unlinked"]}},"required":["projectId","url","target","backendStatus"]},"domains":{"type":"array","items":{"$ref":"#/components/schemas/ProjectDomain"}},"hosting":{"type":"object","properties":{"supported":{"type":"boolean"},"customDomains":{"type":"boolean"},"localDevelopment":{"type":"boolean"},"apexIps":{"type":"array","items":{"type":"string"}}},"required":["supported","customDomains","localDevelopment","apexIps"]}},"required":["endpoint","domains","hosting"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"unpublishProjectEndpoint","tags":["Projects"],"summary":"Disconnect a project backend","security":[{"cookieAuth":[]}],"description":"Requires a browser session and an owned project. Inspection and cleanup remain available when publication is disabled. Domain metadata on the project does not publish an application. Requires a trusted Origin. Removes public endpoint routing and revokes matching runtime bindings and active transports. Domain registrations are retained. Retry cleanup when project_reconciliation_required is returned.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"url":{"type":"string"},"target":{"$ref":"#/components/schemas/ProjectTarget"},"backendStatus":{"type":"string","enum":["running","unavailable","unlinked"]}},"required":["projectId","url","target","backendStatus"]},"domains":{"type":"array","items":{"$ref":"#/components/schemas/ProjectDomain"}},"hosting":{"type":"object","properties":{"supported":{"type":"boolean"},"customDomains":{"type":"boolean"},"localDevelopment":{"type":"boolean"},"apexIps":{"type":"array","items":{"type":"string"}}},"required":["supported","customDomains","localDevelopment","apexIps"]}},"required":["endpoint","domains","hosting"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/projects/domains":{"get":{"operationId":"listProjectDomains","tags":["Projects"],"summary":"List a project’s custom domains and DNS records","security":[{"cookieAuth":[]}],"description":"Requires a browser session and an owned project. Inspection and cleanup remain available when publication is disabled. Domain metadata on the project does not publish an application.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"domains":{"type":"array","items":{"$ref":"#/components/schemas/ProjectDomain"}}},"required":["domains"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"addProjectDomain","tags":["Projects"],"summary":"Register a custom hostname for verification","security":[{"cookieAuth":[]}],"description":"Requires a trusted Origin and an owned project. Normalizes a hostname and creates a project-specific TXT ownership challenge. URLs, IP addresses, wildcards, and platform domains are rejected. Pending registrations cannot reserve a hostname globally. Customers retain their DNS provider and nameservers. On Cloudflare DNS, use a DNS-only CNAME so the routing target is visible for verification. Root domains need provider-supported ALIAS/flattening or explicitly configured stable ingress IPs; never copy arbitrary Cloudflare edge IPs. In local development only, LOCAL_DEV=true and PROJECT_DOMAIN_PROVIDER=local allow single-label *.localhost aliases; DNS and certificate checks are simulated and no external provider is contacted.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"type":"string","minLength":1,"maxLength":253}},"required":["hostname"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"$ref":"#/components/schemas/ProjectDomain"}},"required":["domain"]}}}},"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"$ref":"#/components/schemas/ProjectDomain"}},"required":["domain"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"removeProjectDomain","tags":["Projects"],"summary":"Remove a project’s custom hostname","security":[{"cookieAuth":[]}],"description":"Requires a browser session and an owned project. Inspection and cleanup remain available when publication is disabled. Domain metadata on the project does not publish an application. Requires a trusted Origin. Removes only this project’s verified hostname mapping and closes its active origin transports. Provider certificate cleanup is retryable; a stale cleanup cannot remove another project’s claim.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"domainId","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/projects/domains/verify":{"post":{"operationId":"verifyProjectDomain","tags":["Projects"],"summary":"Check domain ownership, routing DNS, and HTTPS","security":[{"cookieAuth":[]}],"description":"Requires a trusted Origin and an owned domain registration. Verifies the account/project-specific TXT challenge before claiming routing or provisioning certificates. Cloudflare for SaaS requires both hostname and certificate activation. Static ingress requires configured A/AAAA destinations and an HTTPS gateway challenge. DNS, provider, and HTTPS checks reject redirects without following them. Only verified, active hostnames can reach applications. In local development with PROJECT_DOMAIN_PROVIDER=local, the first verification simulates DNS ownership and routing and leaves TLS pending; a second verification simulates certificate activation without public DNS or certificates.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"domainId","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"$ref":"#/components/schemas/ProjectDomain"}},"required":["domain"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/domains/config":{"get":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers.","operationId":"getDomainRegistrarConfig","summary":"Inspect domain purchase availability","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"sandbox":{"type":"boolean"},"tlds":{"type":"array","items":{"type":"string"}},"canConnect":{"type":"boolean"}},"required":["configured","sandbox","tlds","canConnect"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/domains":{"get":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers.","operationId":"listRegisteredDomains","summary":"List purchased domains and pending orders","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"object","properties":{"domainName":{"type":"string"},"projectId":{"type":["string","null"]},"expireDate":{"type":"string"},"autoRenew":{"type":"boolean"},"renewalCents":{"type":"number"},"error":{"type":["string","null"]}},"required":["domainName","projectId","expireDate","autoRenew","renewalCents","error"]}},"orders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"domainName":{"type":"string"},"projectId":{"type":["string","null"],"format":"uuid"},"kind":{"type":"string","enum":["registration","renewal"]},"years":{"type":"integer"},"amountCents":{"type":"integer"},"renewalCents":{"type":"integer"},"premium":{"type":"boolean"},"autoRenew":{"type":"boolean"},"status":{"type":"string","enum":["quoted","checkout","charging","paid","fulfilling","registered","connecting","complete","refunding","refunded","expired","review"]},"error":{"type":["string","null"]},"expiresAt":{"type":"number"}},"required":["id","domainName","projectId","kind","years","amountCents","renewalCents","premium","autoRenew","status","error","expiresAt"]}}},"required":["domains","orders"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/domains/search":{"post":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers.","operationId":"searchDomains","summary":"Search registration inventory with USD prices","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keyword":{"type":"string","minLength":1,"maxLength":100}},"required":["keyword"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"domainName":{"type":"string"},"premium":{"type":"boolean"},"amountCents":{"type":"number"},"renewalCents":{"type":"number"}},"required":["domainName","premium","amountCents","renewalCents"]}}},"required":["results"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/domains/quote":{"post":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers. Checks registrar availability, registration requirements, and trademark claims before saving a quote; the quote request fails if any registrar check fails. Quotes expire in 15 minutes. Supports ASCII .com, .net, .org, .app, .dev, .xyz registrations and terms of 1–10 years where supported. IDNs, special requirements, claims, and aftermarket inventory are excluded. Renewal price is annual. Domain ownership survives project deletion.","operationId":"quoteDomainOrder","summary":"Create an authoritative registration or renewal quote","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domainName":{"type":"string","maxLength":253},"years":{"type":"integer","minimum":1,"maximum":10},"projectId":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["registration","renewal"],"default":"registration"}},"required":["domainName","years"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"domainName":{"type":"string"},"projectId":{"type":["string","null"],"format":"uuid"},"kind":{"type":"string","enum":["registration","renewal"]},"years":{"type":"integer"},"amountCents":{"type":"integer"},"renewalCents":{"type":"integer"},"premium":{"type":"boolean"},"autoRenew":{"type":"boolean"},"status":{"type":"string","enum":["quoted","checkout","charging","paid","fulfilling","registered","connecting","complete","refunding","refunded","expired","review"]},"error":{"type":["string","null"]},"expiresAt":{"type":"number"}},"required":["id","domainName","projectId","kind","years","amountCents","renewalCents","premium","autoRenew","status","error","expiresAt"]}},"required":["order"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/domains/checkout":{"post":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers. Supply the same order ID to retry. Prices are rechecked; registration contacts and terms consent are required. Saves a card for consented annual renewals. Auto-renew charges 30 days before expiry and never exceeds the accepted renewal amount. Registrar auto-renew is disabled so registrar credit cannot renew an unpaid order.","operationId":"createDomainCheckout","summary":"Open or resume Stripe checkout for an owned quote","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"orderId":{"type":"string","format":"uuid"},"contact":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":100},"lastName":{"type":"string","minLength":1,"maxLength":100},"address1":{"type":"string","minLength":1,"maxLength":200},"address2":{"type":"string","maxLength":200},"city":{"type":"string","minLength":1,"maxLength":100},"state":{"type":"string","minLength":1,"maxLength":100},"zip":{"type":"string","minLength":1,"maxLength":30},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"email":{"type":"string","maxLength":254,"format":"email"},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"}},"required":["firstName","lastName","address1","city","state","zip","country","email","phone"],"additionalProperties":false},"autoRenew":{"type":"boolean"},"termsAccepted":{"type":"boolean","enum":[true]}},"required":["orderId","autoRenew","termsAccepted"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"domainName":{"type":"string"},"projectId":{"type":["string","null"],"format":"uuid"},"kind":{"type":"string","enum":["registration","renewal"]},"years":{"type":"integer"},"amountCents":{"type":"integer"},"renewalCents":{"type":"integer"},"premium":{"type":"boolean"},"autoRenew":{"type":"boolean"},"status":{"type":"string","enum":["quoted","checkout","charging","paid","fulfilling","registered","connecting","complete","refunding","refunded","expired","review"]},"error":{"type":["string","null"]},"expiresAt":{"type":"number"}},"required":["id","domainName","projectId","kind","years","amountCents","renewalCents","premium","autoRenew","status","error","expiresAt"]},"clientSecret":{"type":"string"},"publishableKey":{"type":"string"}},"required":["order"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/domains/order":{"get":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers. Live Stripe state, paid amount, currency, customer, and order metadata must match before registration. Persisted idempotency keys and leases prevent concurrent purchases. Definitive registration rejection triggers a Stripe refund; uncertain results enter review after the retry window. Configures apex ANAME or static A/AAAA records, www, ownership TXT, and certificates through project hosting.","operationId":"getDomainOrder","summary":"Inspect and reconcile a domain purchase","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"domainName":{"type":"string"},"projectId":{"type":["string","null"],"format":"uuid"},"kind":{"type":"string","enum":["registration","renewal"]},"years":{"type":"integer"},"amountCents":{"type":"integer"},"renewalCents":{"type":"integer"},"premium":{"type":"boolean"},"autoRenew":{"type":"boolean"},"status":{"type":"string","enum":["quoted","checkout","charging","paid","fulfilling","registered","connecting","complete","refunding","refunded","expired","review"]},"error":{"type":["string","null"]},"expiresAt":{"type":"number"}},"required":["id","domainName","projectId","kind","years","amountCents","renewalCents","premium","autoRenew","status","error","expiresAt"]}},"required":["order"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/domains/detail":{"get":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers.","operationId":"getRegisteredDomain","summary":"Inspect registration contacts, verification, DNS and locks","parameters":[{"schema":{"type":"string"},"required":true,"name":"domainName","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"object","properties":{"domainName":{"type":"string"},"expireDate":{"type":"string"},"privacyEnabled":{"type":"boolean"},"locked":{"type":"boolean"},"locks":{"type":"array","items":{"type":"string"}},"transferLockExpiresAt":{"type":"string"},"nameservers":{"type":"array","items":{"type":"string"}},"contacts":{"type":"object","properties":{"registrant":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":100},"lastName":{"type":"string","minLength":1,"maxLength":100},"address1":{"type":"string","minLength":1,"maxLength":200},"address2":{"type":"string","maxLength":200},"city":{"type":"string","minLength":1,"maxLength":100},"state":{"type":"string","minLength":1,"maxLength":100},"zip":{"type":"string","minLength":1,"maxLength":30},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"email":{"type":"string","maxLength":254,"format":"email"},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"isVerified":{"type":"boolean"},"verificationId":{"type":["number","null"]}},"required":["firstName","lastName","address1","city","state","zip","country","email","phone"],"additionalProperties":{}}},"required":["registrant"],"additionalProperties":{}},"autoRenew":{"type":"boolean"},"renewalCents":{"type":"integer"}},"required":["domainName","expireDate","privacyEnabled","locked","nameservers","contacts","autoRenew","renewalCents"],"additionalProperties":{}},"projectId":{"type":["string","null"]},"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string"},"host":{"type":["string","null"]},"answer":{"type":"string"},"ttl":{"type":"integer"},"priority":{"type":"number"}},"required":["id","type","host","answer","ttl"]}}},"required":["domain","projectId","projects","records"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/domains/connect":{"post":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers. A null projectId disconnects hosting while preserving registration, DNS mail records and renewals. A project ID connects the root and www hostnames with automatic DNS and HTTPS setup. Only owned projects are accepted; pending purchases must finish first.","operationId":"connectRegisteredDomain","summary":"Connect or disconnect a purchased domain and project","parameters":[{"schema":{"type":"string"},"required":true,"name":"domainName","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":["string","null"],"format":"uuid"}},"required":["projectId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"domainName":{"type":"string"},"projectId":{"type":["string","null"],"format":"uuid"},"kind":{"type":"string","enum":["registration","renewal"]},"years":{"type":"integer"},"amountCents":{"type":"integer"},"renewalCents":{"type":"integer"},"premium":{"type":"boolean"},"autoRenew":{"type":"boolean"},"status":{"type":"string","enum":["quoted","checkout","charging","paid","fulfilling","registered","connecting","complete","refunding","refunded","expired","review"]},"error":{"type":["string","null"]},"expiresAt":{"type":"number"}},"required":["id","domainName","projectId","kind","years","amountCents","renewalCents","premium","autoRenew","status","error","expiresAt"]},"disconnected":{"type":"boolean","enum":[true]}}}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/domains/settings":{"patch":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers.","operationId":"updateRegisteredDomain","summary":"Change renewal, privacy, contacts or transfer lock","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domainName":{"type":"string"},"autoRenew":{"type":"boolean"},"privacyEnabled":{"type":"boolean"},"locked":{"type":"boolean"},"contact":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":100},"lastName":{"type":"string","minLength":1,"maxLength":100},"address1":{"type":"string","minLength":1,"maxLength":200},"address2":{"type":"string","maxLength":200},"city":{"type":"string","minLength":1,"maxLength":100},"state":{"type":"string","minLength":1,"maxLength":100},"zip":{"type":"string","minLength":1,"maxLength":30},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"email":{"type":"string","maxLength":254,"format":"email"},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"}},"required":["firstName","lastName","address1","city","state","zip","country","email","phone"],"additionalProperties":false}},"required":["domainName"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"saved":{"type":"boolean","enum":[true]}},"required":["saved"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/domains/verification":{"post":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers.","operationId":"resendDomainContactVerification","summary":"Resend registrant email verification","parameters":[{"schema":{"type":"string"},"required":true,"name":"domainName","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"boolean","enum":[true]}},"required":["sent"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/domains/records":{"post":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers.","operationId":"createRegisteredDomainDnsRecord","summary":"Add a DNS record alongside managed hosting records","parameters":[{"schema":{"type":"string"},"required":true,"name":"domainName","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["A","AAAA","CNAME","MX","TXT","SRV","NS"]},"host":{"type":"string","maxLength":253,"pattern":"^[a-zA-Z0-9_.*@-]*$"},"answer":{"type":"string","minLength":1,"maxLength":4096},"ttl":{"type":"integer","minimum":300,"maximum":604800},"priority":{"type":"integer","minimum":0,"maximum":65535}},"required":["type","host","answer","ttl"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string"},"host":{"type":["string","null"]},"answer":{"type":"string"},"ttl":{"type":"integer"},"priority":{"type":"number"}},"required":["id","type","host","answer","ttl"]}},"required":["record"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers. Protects MainBrella ownership records and apex/www routing while a project is connected.","operationId":"deleteRegisteredDomainDnsRecord","summary":"Remove a user DNS record","parameters":[{"schema":{"type":"string"},"required":true,"name":"domainName","in":"query"},{"schema":{"type":"string","pattern":"^\\d+$"},"required":true,"name":"recordId","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/domains/auth-code":{"post":{"tags":["Domains"],"security":[{"cookieAuth":[]}],"description":"Requires a browser session. Mutations require a trusted Origin. Only the owning account can inspect, purchase, or manage registrations. Local development uses Name.com sandbox and Stripe test credentials. Registrar secrets never reach browsers.","operationId":"getRegisteredDomainTransferCode","summary":"Reveal the EPP code for an unlocked domain","parameters":[{"schema":{"type":"string"},"required":true,"name":"domainName","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"authCode":{"type":"string"}},"required":["authCode"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/subscription/config":{"get":{"operationId":"getSubscriptionConfig","tags":["Subscriptions"],"summary":"Get public plans and billing availability","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"google_client_id":{"type":"string"},"configured":{"type":"boolean"},"usage_configured":{"type":"boolean"},"prepaid_configured":{"type":"boolean"},"billing_model":{"type":"string","enum":["prepaid","legacy"]},"usage_pricing":{"type":"object","properties":{"minimumCents":{"type":"number"},"centsPerComputeUnitHour":{"type":"number"},"defaultSpendLimitCents":{"type":"number"},"maxSpendLimitCents":{"type":"number"}},"required":["minimumCents","centsPerComputeUnitHour","defaultSpendLimitCents","maxSpendLimitCents"]},"plans":{"type":"object","properties":{"usage":{"type":"object","properties":{"name":{"type":"string"},"price":{"type":"number"},"limits":{"type":"object","properties":{"maxComputeUnitHours":{"type":["number","null"]},"maxConcurrentComputeUnits":{"type":"number"},"maxContainers":{"type":"number"},"maxStartsPerMonth":{"type":"number"},"maxSessionMs":{"type":"number"},"idleTimeoutMs":{"type":"number"}},"required":["maxComputeUnitHours","maxConcurrentComputeUnits","maxContainers","maxStartsPerMonth","maxSessionMs","idleTimeoutMs"]},"machine":{"type":"object","properties":{"instance":{"type":"string"},"cpuVcpu":{"type":"number"},"memoryMiB":{"type":"number"},"diskGB":{"type":"number"}},"required":["instance","cpuVcpu","memoryMiB","diskGB"]},"sizes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["lite","small","medium","large","xl"]},"name":{"type":"string"},"instance":{"type":"string"},"cpuVcpu":{"type":"number"},"memoryMiB":{"type":"number"},"diskGB":{"type":"number"},"computeUnits":{"type":"number"}},"required":["id","name","instance","cpuVcpu","memoryMiB","diskGB","computeUnits"]}},"access":{"type":"object","properties":{"maxTerminalConnections":{"type":"number"},"maxSSHAccessTokens":{"type":"number"},"sshTokenLifetimeMs":{"type":"number"}},"required":["maxTerminalConnections","maxSSHAccessTokens","sshTokenLifetimeMs"]},"features":{"type":"object","additionalProperties":{"type":"boolean"}},"legacy":{"type":"boolean"},"billing":{"type":"object","properties":{"minimumCents":{"type":"number"},"centsPerComputeUnitHour":{"type":"number"},"defaultSpendLimitCents":{"type":"number"},"maxSpendLimitCents":{"type":"number"}},"required":["minimumCents","centsPerComputeUnitHour","defaultSpendLimitCents","maxSpendLimitCents"]}},"required":["name","price","limits","machine","sizes","access","features"]},"builder":{"type":"object","properties":{"name":{"type":"string"},"price":{"type":"number"},"limits":{"type":"object","properties":{"maxComputeUnitHours":{"type":["number","null"]},"maxConcurrentComputeUnits":{"type":"number"},"maxContainers":{"type":"number"},"maxStartsPerMonth":{"type":"number"},"maxSessionMs":{"type":"number"},"idleTimeoutMs":{"type":"number"}},"required":["maxComputeUnitHours","maxConcurrentComputeUnits","maxContainers","maxStartsPerMonth","maxSessionMs","idleTimeoutMs"]},"machine":{"type":"object","properties":{"instance":{"type":"string"},"cpuVcpu":{"type":"number"},"memoryMiB":{"type":"number"},"diskGB":{"type":"number"}},"required":["instance","cpuVcpu","memoryMiB","diskGB"]},"sizes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["lite","small","medium","large","xl"]},"name":{"type":"string"},"instance":{"type":"string"},"cpuVcpu":{"type":"number"},"memoryMiB":{"type":"number"},"diskGB":{"type":"number"},"computeUnits":{"type":"number"}},"required":["id","name","instance","cpuVcpu","memoryMiB","diskGB","computeUnits"]}},"access":{"type":"object","properties":{"maxTerminalConnections":{"type":"number"},"maxSSHAccessTokens":{"type":"number"},"sshTokenLifetimeMs":{"type":"number"}},"required":["maxTerminalConnections","maxSSHAccessTokens","sshTokenLifetimeMs"]},"features":{"type":"object","additionalProperties":{"type":"boolean"}},"legacy":{"type":"boolean"},"billing":{"type":"object","properties":{"minimumCents":{"type":"number"},"centsPerComputeUnitHour":{"type":"number"},"defaultSpendLimitCents":{"type":"number"},"maxSpendLimitCents":{"type":"number"}},"required":["minimumCents","centsPerComputeUnitHour","defaultSpendLimitCents","maxSpendLimitCents"]}},"required":["name","price","limits","machine","sizes","access","features"]},"pro":{"type":"object","properties":{"name":{"type":"string"},"price":{"type":"number"},"limits":{"type":"object","properties":{"maxComputeUnitHours":{"type":["number","null"]},"maxConcurrentComputeUnits":{"type":"number"},"maxContainers":{"type":"number"},"maxStartsPerMonth":{"type":"number"},"maxSessionMs":{"type":"number"},"idleTimeoutMs":{"type":"number"}},"required":["maxComputeUnitHours","maxConcurrentComputeUnits","maxContainers","maxStartsPerMonth","maxSessionMs","idleTimeoutMs"]},"machine":{"type":"object","properties":{"instance":{"type":"string"},"cpuVcpu":{"type":"number"},"memoryMiB":{"type":"number"},"diskGB":{"type":"number"}},"required":["instance","cpuVcpu","memoryMiB","diskGB"]},"sizes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["lite","small","medium","large","xl"]},"name":{"type":"string"},"instance":{"type":"string"},"cpuVcpu":{"type":"number"},"memoryMiB":{"type":"number"},"diskGB":{"type":"number"},"computeUnits":{"type":"number"}},"required":["id","name","instance","cpuVcpu","memoryMiB","diskGB","computeUnits"]}},"access":{"type":"object","properties":{"maxTerminalConnections":{"type":"number"},"maxSSHAccessTokens":{"type":"number"},"sshTokenLifetimeMs":{"type":"number"}},"required":["maxTerminalConnections","maxSSHAccessTokens","sshTokenLifetimeMs"]},"features":{"type":"object","additionalProperties":{"type":"boolean"}},"legacy":{"type":"boolean"},"billing":{"type":"object","properties":{"minimumCents":{"type":"number"},"centsPerComputeUnitHour":{"type":"number"},"defaultSpendLimitCents":{"type":"number"},"maxSpendLimitCents":{"type":"number"}},"required":["minimumCents","centsPerComputeUnitHour","defaultSpendLimitCents","maxSpendLimitCents"]}},"required":["name","price","limits","machine","sizes","access","features"]},"scale":{"type":"object","properties":{"name":{"type":"string"},"price":{"type":"number"},"limits":{"type":"object","properties":{"maxComputeUnitHours":{"type":["number","null"]},"maxConcurrentComputeUnits":{"type":"number"},"maxContainers":{"type":"number"},"maxStartsPerMonth":{"type":"number"},"maxSessionMs":{"type":"number"},"idleTimeoutMs":{"type":"number"}},"required":["maxComputeUnitHours","maxConcurrentComputeUnits","maxContainers","maxStartsPerMonth","maxSessionMs","idleTimeoutMs"]},"machine":{"type":"object","properties":{"instance":{"type":"string"},"cpuVcpu":{"type":"number"},"memoryMiB":{"type":"number"},"diskGB":{"type":"number"}},"required":["instance","cpuVcpu","memoryMiB","diskGB"]},"sizes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["lite","small","medium","large","xl"]},"name":{"type":"string"},"instance":{"type":"string"},"cpuVcpu":{"type":"number"},"memoryMiB":{"type":"number"},"diskGB":{"type":"number"},"computeUnits":{"type":"number"}},"required":["id","name","instance","cpuVcpu","memoryMiB","diskGB","computeUnits"]}},"access":{"type":"object","properties":{"maxTerminalConnections":{"type":"number"},"maxSSHAccessTokens":{"type":"number"},"sshTokenLifetimeMs":{"type":"number"}},"required":["maxTerminalConnections","maxSSHAccessTokens","sshTokenLifetimeMs"]},"features":{"type":"object","additionalProperties":{"type":"boolean"}},"legacy":{"type":"boolean"},"billing":{"type":"object","properties":{"minimumCents":{"type":"number"},"centsPerComputeUnitHour":{"type":"number"},"defaultSpendLimitCents":{"type":"number"},"maxSpendLimitCents":{"type":"number"}},"required":["minimumCents","centsPerComputeUnitHour","defaultSpendLimitCents","maxSpendLimitCents"]}},"required":["name","price","limits","machine","sizes","access","features"]}}}},"required":["configured","usage_configured","prepaid_configured","billing_model","usage_pricing","plans"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/subscription":{"get":{"operationId":"getSubscription","tags":["Subscriptions"],"summary":"Get subscription and paid entitlement","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionState"}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/subscription/usage":{"get":{"operationId":"getUsageBilling","tags":["Subscriptions"],"summary":"Get current billing-period compute, estimate, spending cap and alerts","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"billing":{"type":["object","null"],"properties":{"periodStart":{"type":"number"},"periodEnd":{"type":"number"},"computeUnitHours":{"type":"number"},"estimatedCents":{"type":"number"},"minimumCents":{"type":"number"},"spendLimitCents":{"type":"number"},"committedCents":{"type":"number"},"alert":{"anyOf":[{"type":"number","enum":[50]},{"type":"number","enum":[80]},{"type":"number","enum":[100]},{"type":"null"}]},"overagesEnabled":{"type":"boolean"},"invoicingPending":{"type":"boolean"},"balanceCents":{"type":"number"},"availableBalanceCents":{"type":"number"},"reservedBalanceCents":{"type":"number"},"currency":{"type":"string","enum":["usd"]},"monthlyUsageCents":{"type":"number"},"productionHourlyCents":{"type":"number"},"fundedRuntimeMs":{"type":["number","null"]},"minimumProductionRuntimeMs":{"type":"number","enum":[86400000]},"autoRecharge":{"type":"object","properties":{"enabled":{"type":"boolean"},"amountCents":{"type":"integer","minimum":500,"maximum":100000,"description":"USD cents."},"monthlyLimitCents":{"type":"integer","minimum":500,"maximum":100000,"description":"USD cents."},"spentCents":{"type":"number"},"status":{"type":"string"}},"required":["enabled","amountCents","monthlyLimitCents","spentCents","status"]}},"required":["periodStart","periodEnd","computeUnitHours","estimatedCents","minimumCents","spendLimitCents","committedCents","alert","overagesEnabled","invoicingPending"]}},"required":["billing"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"setUsageSpendLimit","tags":["Subscriptions"],"summary":"Set the account monthly compute spending cap","security":[{"cookieAuth":[]}],"description":"Requires an active usage subscription, browser cookie and trusted Origin. USD cents, $5–$1,000. The default $5 cap prevents overages; raising it requires authorizeOverages:true. A lower cap cannot discard committed runtime; stop machines first. Caps reserve full session runtime and may shorten new sessions. Estimates exclude taxes. Alerts are shown at 50%, 80% and 100%.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"spendLimitCents":{"type":"integer","minimum":500,"maximum":100000},"authorizeOverages":{"type":"boolean"}},"required":["spendLimitCents"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"billing":{"type":["object","null"],"properties":{"periodStart":{"type":"number"},"periodEnd":{"type":"number"},"computeUnitHours":{"type":"number"},"estimatedCents":{"type":"number"},"minimumCents":{"type":"number"},"spendLimitCents":{"type":"number"},"committedCents":{"type":"number"},"alert":{"anyOf":[{"type":"number","enum":[50]},{"type":"number","enum":[80]},{"type":"number","enum":[100]},{"type":"null"}]},"overagesEnabled":{"type":"boolean"},"invoicingPending":{"type":"boolean"},"balanceCents":{"type":"number"},"availableBalanceCents":{"type":"number"},"reservedBalanceCents":{"type":"number"},"currency":{"type":"string","enum":["usd"]},"monthlyUsageCents":{"type":"number"},"productionHourlyCents":{"type":"number"},"fundedRuntimeMs":{"type":["number","null"]},"minimumProductionRuntimeMs":{"type":"number","enum":[86400000]},"autoRecharge":{"type":"object","properties":{"enabled":{"type":"boolean"},"amountCents":{"type":"integer","minimum":500,"maximum":100000,"description":"USD cents."},"monthlyLimitCents":{"type":"integer","minimum":500,"maximum":100000,"description":"USD cents."},"spentCents":{"type":"number"},"status":{"type":"string"}},"required":["enabled","amountCents","monthlyLimitCents","spentCents","status"]}},"required":["periodStart","periodEnd","computeUnitHours","estimatedCents","minimumCents","spendLimitCents","committedCents","alert","overagesEnabled","invoicingPending"]}},"required":["billing"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/subscription/trial":{"post":{"operationId":"redeemTrialCoupon","tags":["Subscriptions"],"summary":"Redeem a card-free trial coupon; one trial per account","security":[{"cookieAuth":[]}],"description":"Requires a browser session cookie and trusted Origin. Bearer automation credentials do not authorize billing mutations. Legacy plans use separate hard-coded Stripe prices in local development; legacy usage billing requires explicitly configured test-mode recurring price. When prepaid funding is configured, new recurring Checkout, plan changes, upgrades and resumption return 409 prepaid_billing_required. Use /billing/topups for one-time funds. Legacy reads, completed payment reconciliation, invoice/payment-method portal and cancellation remain available.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["usage","builder","pro","scale"]},"code":{"type":"string","minLength":4,"maxLength":64}},"required":["plan","code"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionState"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/subscription/checkout":{"post":{"operationId":"createCheckout","tags":["Subscriptions"],"summary":"Create or reuse custom Elements checkout with promotion codes and required card collection","security":[{"cookieAuth":[]}],"description":"Requires a browser session cookie and trusted Origin. Bearer automation credentials do not authorize billing mutations. Legacy plans use separate hard-coded Stripe prices in local development; legacy usage billing requires explicitly configured test-mode recurring price. When prepaid funding is configured, new recurring Checkout, plan changes, upgrades and resumption return 409 prepaid_billing_required. Use /billing/topups for one-time funds. Legacy reads, completed payment reconciliation, invoice/payment-method portal and cancellation remain available.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["usage","builder","pro","scale"]}},"required":["plan"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"client_secret":{"type":"string"},"publishable_key":{"type":"string"}},"required":["client_secret","publishable_key"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/subscription/complete":{"post":{"operationId":"completeCheckout","tags":["Subscriptions"],"summary":"Verify owned checkout and paid entitlement","security":[{"cookieAuth":[]}],"description":"Requires a browser session cookie and trusted Origin. Bearer automation credentials do not authorize billing mutations. Legacy plans use separate hard-coded Stripe prices in local development; legacy usage billing requires explicitly configured test-mode recurring price. When prepaid funding is configured, new recurring Checkout, plan changes, upgrades and resumption return 409 prepaid_billing_required. Use /billing/topups for one-time funds. Legacy reads, completed payment reconciliation, invoice/payment-method portal and cancellation remain available.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string"}},"required":["session_id"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionState"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/subscription/portal":{"post":{"operationId":"createBillingPortal","tags":["Subscriptions"],"summary":"Open billing portal or confirm an upgrade","security":[{"cookieAuth":[]}],"description":"Requires a browser session cookie and trusted Origin. Bearer automation credentials do not authorize billing mutations. Legacy plans use separate hard-coded Stripe prices in local development; legacy usage billing requires explicitly configured test-mode recurring price. When prepaid funding is configured, new recurring Checkout, plan changes, upgrades and resumption return 409 prepaid_billing_required. Use /billing/topups for one-time funds. Legacy reads, completed payment reconciliation, invoice/payment-method portal and cancellation remain available.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["usage","builder","pro","scale"]}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/subscription/change":{"post":{"operationId":"changeSubscription","tags":["Subscriptions"],"summary":"Schedule a downgrade or remove a scheduled downgrade","security":[{"cookieAuth":[]}],"description":"Requires a browser session cookie and trusted Origin. Bearer automation credentials do not authorize billing mutations. Legacy plans use separate hard-coded Stripe prices in local development; legacy usage billing requires explicitly configured test-mode recurring price. When prepaid funding is configured, new recurring Checkout, plan changes, upgrades and resumption return 409 prepaid_billing_required. Use /billing/topups for one-time funds. Legacy reads, completed payment reconciliation, invoice/payment-method portal and cancellation remain available.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["usage","builder","pro","scale"]},"confirm":{"type":"boolean","enum":[true]}},"required":["plan","confirm"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionState"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/subscription/cancel":{"post":{"operationId":"cancelSubscription","tags":["Subscriptions"],"summary":"Cancel at the end of the paid period","security":[{"cookieAuth":[]}],"description":"Requires a browser session cookie and trusted Origin. Bearer automation credentials do not authorize billing mutations. Legacy plans use separate hard-coded Stripe prices in local development; legacy usage billing requires explicitly configured test-mode recurring price. When prepaid funding is configured, new recurring Checkout, plan changes, upgrades and resumption return 409 prepaid_billing_required. Use /billing/topups for one-time funds. Legacy reads, completed payment reconciliation, invoice/payment-method portal and cancellation remain available.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean","enum":[true]}},"required":["confirm"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionState"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/subscription/resume":{"post":{"operationId":"resumeSubscription","tags":["Subscriptions"],"summary":"Resume a subscription pending cancellation","security":[{"cookieAuth":[]}],"description":"Requires a browser session cookie and trusted Origin. Bearer automation credentials do not authorize billing mutations. Legacy plans use separate hard-coded Stripe prices in local development; legacy usage billing requires explicitly configured test-mode recurring price. When prepaid funding is configured, new recurring Checkout, plan changes, upgrades and resumption return 409 prepaid_billing_required. Use /billing/topups for one-time funds. Legacy reads, completed payment reconciliation, invoice/payment-method portal and cancellation remain available.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionState"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/subscription/webhook":{"post":{"operationId":"stripeWebhook","tags":["Internal"],"summary":"Reconcile signed Stripe billing events","security":[{"stripeSignature":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"data":{"type":"object","properties":{"object":{"type":"object","additionalProperties":{}}},"required":["object"]}},"required":["id","type","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"received":{"type":"boolean"}},"required":["received"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/billing/config":{"get":{"operationId":"getPrepaidBillingConfig","tags":["Billing"],"summary":"Get prepaid funding availability and purchase limits","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"storage":{"type":"object","properties":{"mode":{"type":"string","enum":["off","meter","charge"]},"markupBps":{"type":"number"},"maxBytes":{"type":"number"},"chargeFrom":{"type":["number","null"]},"storageUsdPerGbMonth":{"type":"number","enum":[0.015]},"classAUsdPerMillion":{"type":"number","enum":[4.5]},"classBUsdPerMillion":{"type":"number","enum":[0.36]},"retentionDays":{"type":"number","enum":[30]}},"required":["mode","markupBps","maxBytes","chargeFrom","storageUsdPerGbMonth","classAUsdPerMillion","classBUsdPerMillion","retentionDays"]},"configured":{"type":"boolean"},"minTopupCents":{"type":"number","enum":[500]},"maxTopupCents":{"type":"number","enum":[100000]}},"required":["configured","minTopupCents","maxTopupCents"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/billing/balance":{"get":{"operationId":"getPrepaidBalance","tags":["Billing"],"summary":"Get account funding, reserved runtime and monthly spending","security":[{"cookieAuth":[]}],"description":"Successful one-time card payments fund compute in advance. Funding carries forward. The spending cap and auto recharge authorization do not add funds. Balance can be negative after a refund or dispute.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"$ref":"#/components/schemas/PrepaidBalance"}},"required":["balance"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/billing/history":{"get":{"operationId":"getPrepaidHistory","tags":["Billing"],"summary":"Explain prepaid funding and elapsed compute consumption by allocation","security":[{"cookieAuth":[]}],"description":"Read-only wallet snapshot with epoch-millisecond asOf, exact fractional consumption cents and lifetime totals. Active allocations are always included separately; currentHourlyCents sums unexpired leases. Completed resources and fundings paginate independently newest-first with returned ID cursors; limit defaults to 50, maximum 100. Retains 256 completed allocations plus current leases. Earlier settled usage and compacted allocations remain exact in unattributedUsedCents; historyTruncated signals unavailable attribution. Resource startAt begins attributable runtime, potentially later than allocation start for older leases. Retained unresolved leases have endAt null and active false after their budget expires. Provisioning and idle time are billed; reservations hold future funds and are not consumption. Funding createdAt is purchase time; revokedCents and reason describe current refund/dispute deductions without invented reversal dates. No Stripe request, guest provisioning, lease renewal or billing mutation occurs. Legacy subscription invoices are not prepaid history.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"resourceCursor","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"fundingCursor","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrepaidHistory"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/billing/topups":{"post":{"operationId":"createPrepaidTopup","tags":["Billing"],"summary":"Create or recover embedded Stripe Checkout for a one-time balance purchase","security":[{"cookieAuth":[]}],"description":"Requires browser cookie, trusted Origin and configured Stripe publishable key. Checkout requires a billing address for accounting tax-location evidence. Send a fresh UUID per purchase and retain it until Checkout returns; repeating the same UUID recovers the same purchase and cannot change its amount. Stripe promotion codes may discount the price while the selected amountCents remains the compute balance purchased. The server verifies the live Checkout subtotal, discount and payment before crediting, including completed no-payment-required orders for 100% discounts. Actual consideration, promotional credit and any verified tax are recorded separately in an immutable accounting ledger before wallet funding. Tax never becomes compute credit; tax calculation is not enabled by this endpoint. No subscription is created. Compute prices and account limits are the same for every purchase amount. Client-supplied credit amounts never authorize funding.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":500,"maximum":100000,"description":"USD cents."},"requestId":{"type":"string","format":"uuid"}},"required":["amountCents","requestId"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"client_secret":{"type":"string"},"publishable_key":{"type":"string"},"sessionId":{"type":"string"}},"required":["client_secret","publishable_key","sessionId"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/billing/topups/complete":{"post":{"operationId":"completePrepaidTopup","tags":["Billing"],"summary":"Verify owned Checkout and apply confirmed prepaid funding once","security":[{"cookieAuth":[]}],"description":"Requires browser cookie and trusted Origin. The Checkout redirect does not prove payment. Live Checkout subtotal, Stripe discount, ownership and completion are verified. Completed zero-total orders with paid or no_payment_required status and no PaymentIntent fund the selected balance once using their Checkout session ID. Nonzero totals additionally require a verified PaymentIntent and captured card charge with matching currency, amount and refund/dispute state. Refunds revoke the corresponding proportion of purchased compute credit, rounded up; disputes revoke the full credit. Pending payments do not increase the balance.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string","pattern":"^cs_[A-Za-z0-9_]+$"}},"required":["sessionId"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"$ref":"#/components/schemas/PrepaidBalance"}},"required":["balance"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/billing/settings":{"post":{"operationId":"setPrepaidBillingSettings","tags":["Billing"],"summary":"Set monthly spending cap and optional automatic recharge authorization","security":[{"cookieAuth":[]}],"description":"Requires browser cookie and trusted Origin. Enabling automatic recharge explicitly authorizes the stated one-time amount up to the stated monthly maximum, and saving the last verified card. Pending charges count toward the maximum. Cards are never charged beyond available authorization; failed payments never fund runtime.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"spendLimitCents":{"type":"integer","minimum":500,"maximum":100000,"description":"USD cents."},"autoRecharge":{"type":"object","properties":{"enabled":{"type":"boolean"},"amountCents":{"type":"integer","minimum":500,"maximum":100000,"description":"USD cents."},"monthlyLimitCents":{"type":"integer","minimum":500,"maximum":100000,"description":"USD cents."}},"required":["enabled","amountCents","monthlyLimitCents"]}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"$ref":"#/components/schemas/PrepaidBalance"}},"required":["balance"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/billing/apple/config":{"get":{"operationId":"getAppleComputeCredit","tags":["Billing"],"summary":"Get net compute credit and a stable App Store account token","security":[{"cookieAuth":[]}],"description":"Quote MAINBRELLA_FIVE against a server-controlled USD proceeds policy for the exact storefront and price in milliunits. Credit is Apple net proceeds after commission and applicable taxes, rounded down to whole cents; no Stripe fees apply. Unsupported or unconfigured prices fail before purchase. App account token is bound to the authenticated account. Local Xcode testing requires LOCAL_DEV, explicit opt-in and a loopback request.","parameters":[{"schema":{"type":"string","pattern":"^[A-Z]{3}$"},"required":true,"name":"storefront","in":"query"},{"schema":{"type":"string","pattern":"^[A-Z]{3}$"},"required":true,"name":"currency","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"priceMilliunits","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"string","enum":["MAINBRELLA_FIVE"]},"appAccountToken":{"type":"string","format":"uuid"},"creditCents":{"type":"integer","exclusiveMinimum":0},"currency":{"type":"string","enum":["usd"]}},"required":["productId","appAccountToken","creditCents","currency"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/billing/apple/transactions":{"post":{"operationId":"completeAppleComputeCredit","tags":["Billing"],"summary":"Verify an owned Apple consumable and deliver its net credit once","security":[{"cookieAuth":[]}],"description":"Requires account cookie and trusted Origin. Verify Apple signature, bundle, environment, consumable product, quantity, purchase price and appAccountToken; refresh the transaction from Apple before delivery to detect refunds. Production accepts Production only; Sandbox belongs on a separate local development backend. Persist the original net proceeds policy and deduplicate globally by environment and transaction ID. Credit the same prepaid wallet used by web purchases, independently of Stripe availability. Refunds revoke net credit proportionally, rounded up; older successes cannot restore revoked credit. Finish the StoreKit transaction only after this response succeeds. No client-provided credit or price authorizes funding.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"signedTransactionInfo":{"type":"string","minLength":1,"maxLength":60000}},"required":["signedTransactionInfo"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"$ref":"#/components/schemas/PrepaidBalance"},"creditedCents":{"type":"integer","minimum":0},"transactionId":{"type":"string"}},"required":["balance","creditedCents","transactionId"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/billing/apple/notifications":{"post":{"operationId":"receiveAppleBillingNotification","tags":["Billing"],"summary":"Receive authenticated App Store Server Notifications V2","security":[],"description":"Apple JWS signature, certificate chain, environment, bundle and app ID authenticate this webhook; no account cookie is used. Verify the embedded transaction and refresh it from Apple. Apply funding or refund revocation idempotently to the account bound to appAccountToken. Xcode payloads are rejected. Transient verification or delivery failures return 503 so Apple retries.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"signedPayload":{"type":"string","minLength":1,"maxLength":60000}},"required":["signedPayload"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/billing/storage":{"get":{"operationId":"getStorageBilling","tags":["Billing"],"security":[{"cookieAuth":[]}],"summary":"Get retained Storage and Git usage by project","description":"Storage consumes balance while files/history remain retained, including stopped apps. Meter mode records usage without deductions. Daily deductions start prospectively at chargeFrom, use Standard daily peaks over 30 days plus provider operations, and are provisional until category invoice reconciliation. Funded 30-day retention is reserved before growth. Failed renewal blocks writes and creates a deletionAt deadline. Users receive an initial warning and seven-day/one-day reminders. Delivery of the first warning via email or this authenticated API guarantees at least 30 days to add funds or export; an undelivered warning blocks deletion. deletionAt, rather than fundedThrough, includes any platform-funded notice grace. Days after paid retention while writes are blocked are a platform expense and do not debit customer credit. exportUrl and sourceExportUrl provide owner-authenticated downloads. Before deletion, the serialized wallet rechecks funding and claims expiration; renewal cancels warnings and deletion. Billing starts with the first full UTC day of activation, without charging earlier metering history. Billing outages defer deletion and generate operator alerts. Estimates exclude account free-tier and billing-unit adjustments; egress and deletes are free.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageBillingSummary"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/admin/accounting/storage-invoices":{"get":{"operationId":"listStorageInvoices","tags":["Admin"],"security":[{"cookieAuth":[]}],"summary":"List immutable R2 invoice allocations","description":"Admin only. Includes provider evidence, separately allocated Mainbrella costs, markup and customer adjustments. Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"invoices":{"type":"array","items":{"type":"object","properties":{"invoice":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,100}$"},"month":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"evidenceReference":{"type":"string","minLength":1,"maxLength":2000},"providerNanoUsd":{"type":"object","properties":{"storage":{"type":"integer","minimum":0,"maximum":9007199254740991},"classA":{"type":"integer","minimum":0,"maximum":9007199254740991},"classB":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["storage","classA","classB"],"additionalProperties":false},"additionalPlatformUsage":{"type":"object","properties":{"byteDays":{"type":"integer","minimum":0,"maximum":9007199254740991},"classA":{"type":"integer","minimum":0,"maximum":9007199254740991},"classB":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["byteDays","classA","classB"],"additionalProperties":false}},"required":["id","month","evidenceReference","providerNanoUsd","additionalPlatformUsage"],"additionalProperties":false},"platformNanoUsd":{"type":"integer","minimum":0,"maximum":9007199254740991},"allocations":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"appId":{"type":"string"},"providerNanoUsd":{"type":"integer","minimum":0,"maximum":9007199254740991},"markupNanoUsd":{"type":"integer","minimum":0,"maximum":9007199254740991},"costNanoUsd":{"type":"integer","minimum":0,"maximum":9007199254740991},"provisionalNanoUsd":{"type":"integer","minimum":0,"maximum":9007199254740991},"adjustmentNanoUsd":{"type":"integer"}},"required":["userId","appId","providerNanoUsd","markupNanoUsd","costNanoUsd","provisionalNanoUsd","adjustmentNanoUsd"]}}},"required":["invoice","platformNanoUsd","allocations"]}}},"required":["invoices"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"reconcileStorageInvoice","tags":["Admin"],"security":[{"cookieAuth":[]}],"summary":"Reconcile an actual shared-account Standard R2 invoice","description":"Admin cookie and trusted Origin required. Submit final category invoice costs in integer nano-USD, including shared free-tier/rounding, with an evidence reference and additional unmetered Mainbrella byte-days/operations. Finished months only, after metering and daily receipts settle. Allocation uses proportional measured usage and deterministic largest-remainder rounding. Uncharged usage belongs to Mainbrella. One immutable invoice per month; identical retries return the original allocation, changed evidence returns 409. Adjustment receipts settle through the existing wallet, with negative amounts returning previously deducted balance. Served by the independently deployed mainbrella-admin Worker through the API service binding. A missing or unavailable service returns 503.","parameters":[{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,100}$"},"month":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"evidenceReference":{"type":"string","minLength":1,"maxLength":2000},"providerNanoUsd":{"type":"object","properties":{"storage":{"type":"integer","minimum":0,"maximum":9007199254740991},"classA":{"type":"integer","minimum":0,"maximum":9007199254740991},"classB":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["storage","classA","classB"],"additionalProperties":false},"additionalPlatformUsage":{"type":"object","properties":{"byteDays":{"type":"integer","minimum":0,"maximum":9007199254740991},"classA":{"type":"integer","minimum":0,"maximum":9007199254740991},"classB":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["byteDays","classA","classB"],"additionalProperties":false}},"required":["id","month","evidenceReference","providerNanoUsd","additionalPlatformUsage"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,100}$"},"month":{"type":"string","pattern":"^20\\d{2}-(0[1-9]|1[0-2])$"},"evidenceReference":{"type":"string","minLength":1,"maxLength":2000},"providerNanoUsd":{"type":"object","properties":{"storage":{"type":"integer","minimum":0,"maximum":9007199254740991},"classA":{"type":"integer","minimum":0,"maximum":9007199254740991},"classB":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["storage","classA","classB"],"additionalProperties":false},"additionalPlatformUsage":{"type":"object","properties":{"byteDays":{"type":"integer","minimum":0,"maximum":9007199254740991},"classA":{"type":"integer","minimum":0,"maximum":9007199254740991},"classB":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["byteDays","classA","classB"],"additionalProperties":false}},"required":["id","month","evidenceReference","providerNanoUsd","additionalPlatformUsage"],"additionalProperties":false},"platformNanoUsd":{"type":"integer","minimum":0,"maximum":9007199254740991},"allocations":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"appId":{"type":"string"},"providerNanoUsd":{"type":"integer","minimum":0,"maximum":9007199254740991},"markupNanoUsd":{"type":"integer","minimum":0,"maximum":9007199254740991},"costNanoUsd":{"type":"integer","minimum":0,"maximum":9007199254740991},"provisionalNanoUsd":{"type":"integer","minimum":0,"maximum":9007199254740991},"adjustmentNanoUsd":{"type":"integer"}},"required":["userId","appId","providerNanoUsd","markupNanoUsd","costNanoUsd","provisionalNanoUsd","adjustmentNanoUsd"]}}},"required":["invoice","platformNanoUsd","allocations"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers":{"get":{"operationId":"getContainers","tags":["Containers"],"summary":"Get account containers, paid allowance, and usage","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"id","in":"query"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerStatus"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"startContainer","tags":["Containers"],"summary":"Reserve a start and boot a container","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Requires paid access. lifecycle defaults to ad_hoc. production requires usage billing and a compatible production runtime; prepaid launch or fleet expansion also requires 24 hours of confirmed funding for the resulting fleet (402 insufficient_production_balance); uses renewable five-minute compute reservations, has no session or idle shutdown, and automatically recovers from runtime interruption using the same logical service identity and immutable image. Optional startupCommand (one line, at most 4096 characters) is supervised with restart backoff and runs from the image on every recovery; allowed only with production. Production cannot restore a saved workspace. Explicit DELETE removes desired state; a spending cap or loss of paid access stops compute while retaining desired service identity. Recovery resumes only with verified funding and available cap. Pending or failed payments grant no runtime. No persistent disk or HTTP readiness/uptime guarantee. Production failures return 503 production_unavailable; legacy plans return 402 production_requires_usage. Idempotency fingerprints include lifecycle and startupCommand. workspaceId restores an owned, unarchived saved filesystem workspace using its original image, size and internet policy; cannot combine with imageId/catalogId. Requires persistence.snapshots. Expired snapshots return 410, incompatible image versions return 409 before start reservation. A restore consumes a normal start and compute allowance. New generation invalidates old access; RAM and processes are not restored. No empty-image fallback. A workspace with a saved launch recipe starts that command once per restored generation and reports separate readiness: starting, ready on local HTTP 2xx, or failed. Readiness is asynchronous and visible on GET /containers and keyed restore retries; these never relaunch the command. A failed or timed-out launch keeps the machine accessible with an 8192-byte diagnostic tail and log path. Current and previous guest logs are each capped at 1 MiB. Restore launch requires persistence.restoreLaunch and a compatible runtime, otherwise returns 503 workspace_launch_unavailable before start admission. This initial check is not a continuous uptime guarantee. Optional name is a display label of 1–80 characters after trimming, without control characters; omitted names retain generated labels. Body is optional and limited to 64 KiB; size defaults to lite and accepts lite, small, medium, large, xl. Runtime is reserved against both confirmed prepaid funding and the account spending cap, or the monthly compute allowance for legacy plans; unused runtime is released on stop and is never billed. Prepaid balance carries forward; monthly consumption caps reset at the UTC month boundary and prepaid sessions can cross that boundary within their funds and cap. Legacy sessions end at that boundary. Usage cap exhaustion returns 429 spend_limit_reached; an unresolved invoice write returns 503 billing_reconciliation_required. imageId and catalogId are mutually exclusive. Optional Idempotency-Key (1–128 letters, digits, underscores or hyphens) resolves retries to one account-scoped reservation for 24 hours. Keyed responses include creation identity and current starting/running status. networkPolicy requires networking.egressPolicies, operator rollout access for the authenticated account, and a qualified private runtime/relay, implies internet:false, and cannot combine with internet:true. secretBindings contains owned secret IDs, requires a networkPolicy and secrets.vault; values remain outside the guest. Policies and binding IDs are immutable per generation and part of the idempotency fingerprint. internet defaults to true. internet:false requires networking.internetControl and a compatible private runtime; otherwise fails closed with 503 network_policy_unavailable before reserving a start. Changed name, image, size or internet selection returns 409 idempotency_key_conflict; stopped/replaced reservations return 409 creation_no_longer_running. Unkeyed requests reserve a new start. Cookie requests require a trusted Origin.","parameters":[{"schema":{"type":"string","description":"Trusted browser origin; required for cookie mutations."},"required":false,"description":"Trusted browser origin; required for cookie mutations.","name":"Origin","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"required":false,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"lifecycle":{"type":"string","enum":["ad_hoc","production"]},"startupCommand":{"type":"string","maxLength":4096,"pattern":"^[^\\u0000\\r\\n]*$"},"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\u0000-\\u001f\\u007f]+$"},"imageId":{"type":"string"},"catalogId":{"type":"string"},"size":{"type":"string","enum":["lite","small","medium","large","xl"]},"internet":{"type":"boolean"},"networkPolicy":{"type":"object","properties":{"allow":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":64},"deny":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":64}},"required":["allow"],"additionalProperties":false,"description":"HTTP/HTTPS egress on ports 80/443. Exact domains, *.domain, IPv4/IPv6 CIDR or *; deny wins. Hostname DNS lookup requires a matching domain allow rule; CIDR-only grants apply to literal IP requests. All resolved addresses must be public and allowed. Other protocols/ports and redirects are denied."},"secretBindings":{"type":"array","items":{"type":"string","pattern":"^sec_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"maxItems":16},"workspaceId":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ContainerStatus"},{"type":"object","properties":{"creation":{"type":"object","properties":{"id":{"type":"string"},"containerId":{"type":"string"},"createdAt":{"type":"string"},"status":{"type":"string","enum":["starting","running","stopped"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["starting","ready","failed"]},"port":{"type":"integer"},"path":{"type":"string"},"logPath":{"type":"string"},"checkedAt":{"type":"string","format":"date-time"},"error":{"type":"string","enum":["launch_exited","readiness_timeout"]},"logTail":{"type":"string","description":"At most 8192 UTF-8 bytes of application diagnostics on failure; authenticated account data."}},"required":["status","port","path","logPath"]}},"required":["id","containerId","createdAt","status"]}}}]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Capacity, image selection, idempotency conflict, or original creation no longer running.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"creation":{"type":"object","properties":{"id":{"type":"string"},"containerId":{"type":"string"},"status":{"type":"string","enum":["stopped"]}},"required":["id","containerId","status"]}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"stopContainer","tags":["Containers"],"summary":"Permanently delete a selected account container","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Destructive deletion without saving the filesystem. Use POST /containers/stop for a resumable stop. Removes any suspended slot and production desired state. An ID is required when multiple containers exist. createdAt rejects stale actions. Cookie requests require a trusted Origin. Cleanup remains available during billing outages. The historical operation ID is retained for generated-client compatibility.","parameters":[{"schema":{"type":"string"},"required":false,"name":"id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"createdAt","in":"query"},{"schema":{"type":"string","description":"Trusted browser origin; required for cookie mutations."},"required":false,"description":"Trusted browser origin; required for cookie mutations.","name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerStatus"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/ssh":{"post":{"operationId":"issueSSHAccess","tags":["Containers"],"summary":"Issue short-lived SSH access to a running container","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Returns a secret-bearing command. Cookie requests require a trusted Origin. expiresAt is Unix milliseconds.","parameters":[{"schema":{"type":"string","description":"Trusted browser origin; required for cookie mutations."},"required":false,"description":"Trusted browser origin; required for cookie mutations.","name":"Origin","in":"header"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"}},"required":["id"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"command":{"type":"string"},"expiresAt":{"type":"number"},"hostname":{"type":"string"}},"required":["command","expiresAt","hostname"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/terminal":{"get":{"operationId":"connectBrowserTerminal","tags":["Containers"],"summary":"Upgrade to a browser terminal WebSocket","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"id","in":"query"},{"schema":{"type":"string"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"integer"},"required":false,"name":"cols","in":"query"},{"schema":{"type":"integer"},"required":false,"name":"rows","in":"query"},{"schema":{"type":"string"},"required":true,"name":"Origin","in":"header"},{"schema":{"type":"string","enum":["websocket"]},"required":true,"name":"Upgrade","in":"header"}],"responses":{"101":{"description":"Terminal WebSocket established."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"426":{"description":"WebSocket upgrade required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/ssh/validate":{"post":{"operationId":"validateSSHAccess","tags":["Internal"],"summary":"Validate SSH access for the trusted gateway","security":[{"sshGateway":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"expiresAt":{"type":"number"}},"required":["expiresAt"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/ssh/connect":{"get":{"operationId":"connectSSHGateway","tags":["Internal"],"summary":"Upgrade the trusted SSH gateway connection","security":[{"sshGateway":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"x-mainbrella-ssh-token","in":"header"},{"schema":{"type":"string","enum":["websocket"]},"required":true,"name":"Upgrade","in":"header"}],"responses":{"101":{"description":"SSH WebSocket established; query parameters are not accepted."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/startup":{"patch":{"operationId":"configureContainerStartup","tags":["Containers"],"summary":"Configure the command for future filesystem restores","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Requires persistence.startupConfiguration, paid access and the exact running ad_hoc generation. Saves a canonical foreground launch recipe on the source without starting, restarting or changing its current process. Stop/Resume and Fork inherit this recipe; previously saved snapshots remain immutable. Explicit Save still requires its own launch field. launch:null clears future automatic startup. Requests are limited to 32 KiB; repeated identical requests are safe. Production uses its separate startupCommand supervisor and rejects this setting. An older runtime returns 503 workspace_launch_unavailable. Cookie mutations require a trusted Origin. No RAM or process preservation.","parameters":[{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^(small|c[1-9]\\d{0,2})$"},"createdAt":{"type":"string","format":"date-time"},"launch":{"type":["object","null"],"properties":{"command":{"type":"string","minLength":1,"maxLength":4096,"pattern":"^[^\\u0000]+$","description":"Shell source up to 4096 characters; multiline commands are allowed. NUL bytes are rejected."},"cwd":{"type":"string","minLength":1,"maxLength":1024,"description":"Absolute working directory without dot segments; defaults to /workspace."},"readiness":{"type":"object","properties":{"port":{"type":"integer","minimum":1024,"maximum":65535},"path":{"type":"string","minLength":1,"maxLength":1024,"description":"Local HTTP path, default /. Redirects are not followed."},"timeoutMs":{"type":"integer","minimum":1000,"maximum":60000,"description":"Readiness deadline after machine boot, default 30000 ms."}},"required":["port"],"additionalProperties":false}},"required":["command","readiness"],"additionalProperties":false,"description":"Saved foreground shell launch recipe. No raw environment values or new secret semantics. Runs once in each restored filesystem generation."}},"required":["id","createdAt","launch"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^(small|c[1-9]\\d{0,2})$"},"createdAt":{"type":"string","format":"date-time"},"launch":{"type":["object","null"],"properties":{"command":{"type":"string","minLength":1,"maxLength":4096,"pattern":"^[^\\u0000]+$","description":"Shell source up to 4096 characters; multiline commands are allowed. NUL bytes are rejected."},"cwd":{"type":"string","minLength":1,"maxLength":1024,"description":"Absolute working directory without dot segments; defaults to /workspace."},"readiness":{"type":"object","properties":{"port":{"type":"integer","minimum":1024,"maximum":65535},"path":{"type":"string","minLength":1,"maxLength":1024,"description":"Local HTTP path, default /. Redirects are not followed."},"timeoutMs":{"type":"integer","minimum":1000,"maximum":60000,"description":"Readiness deadline after machine boot, default 30000 ms."}},"required":["port"],"additionalProperties":false}},"required":["command","readiness"],"additionalProperties":false,"description":"Saved foreground shell launch recipe. No raw environment values or new secret semantics. Runs once in each restored filesystem generation."}},"required":["id","createdAt","launch"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/stop":{"post":{"operationId":"suspendContainer","tags":["Containers"],"summary":"Save the filesystem and stop a container","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"The snapshot is committed before compute stops. Failure leaves the running source intact. The stopped slot remains listed and reserved for resume without running compute charges. Saved storage quotas and expiry apply. DELETE /containers permanently deletes a machine; this endpoint preserves its filesystem. Requires persistence.filesystemAfterStop, exact generation and Idempotency-Key. Retry an uncertain result with the same key and body. A configured source launch recipe is inherited and starts a new foreground process once on restore; readiness is reported separately from machine status. Filesystem only: no RAM, processes, mounted volumes, or automatic protection from provider crashes. Quiesce applications before capture for application-consistent data. Cookie mutations require a trusted Origin.","parameters":[{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"required":true,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^(small|c[1-9]\\d{0,2})$"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","createdAt"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ContainerStatus"},{"type":"object","properties":{"creation":{"type":"object","properties":{"id":{"type":"string"},"containerId":{"type":"string"},"createdAt":{"type":"string"},"status":{"type":"string","enum":["starting","running","stopped"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["starting","ready","failed"]},"port":{"type":"integer"},"path":{"type":"string"},"logPath":{"type":"string"},"checkedAt":{"type":"string","format":"date-time"},"error":{"type":"string","enum":["launch_exited","readiness_timeout"]},"logTail":{"type":"string","description":"At most 8192 UTF-8 bytes of application diagnostics on failure; authenticated account data."}},"required":["status","port","path","logPath"]}},"required":["id","containerId","createdAt","status"]}}}]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/resume":{"post":{"operationId":"resumeContainer","tags":["Containers"],"summary":"Resume a stopped container from its saved filesystem","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Restores the reserved slot with a new createdAt generation and a normal paid start. The old generation cannot access the replacement. Expired, deleted, or incompatible snapshots fail without an empty-image fallback. Requires persistence.filesystemAfterStop, exact generation and Idempotency-Key. Retry an uncertain result with the same key and body. A configured source launch recipe is inherited and starts a new foreground process once on restore; readiness is reported separately from machine status. Filesystem only: no RAM, processes, mounted volumes, or automatic protection from provider crashes. Quiesce applications before capture for application-consistent data. Cookie mutations require a trusted Origin.","parameters":[{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"required":true,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^(small|c[1-9]\\d{0,2})$"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","createdAt"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ContainerStatus"},{"type":"object","properties":{"creation":{"type":"object","properties":{"id":{"type":"string"},"containerId":{"type":"string"},"createdAt":{"type":"string"},"status":{"type":"string","enum":["starting","running","stopped"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["starting","ready","failed"]},"port":{"type":"integer"},"path":{"type":"string"},"logPath":{"type":"string"},"checkedAt":{"type":"string","format":"date-time"},"error":{"type":"string","enum":["launch_exited","readiness_timeout"]},"logTail":{"type":"string","description":"At most 8192 UTF-8 bytes of application diagnostics on failure; authenticated account data."}},"required":["status","port","path","logPath"]}},"required":["id","containerId","createdAt","status"]}}}]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/fork":{"post":{"operationId":"forkContainer","tags":["Containers"],"summary":"Fork a running container filesystem into an independent machine","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Captures an owned running generation and creates a separate machine from that snapshot. Source continues running. Image, size, outbound policy and secret bindings are inherited. Optional name labels the fork. A snapshot and a normal paid start count against account quotas. Requires persistence.filesystemFork, exact generation and Idempotency-Key. Retry an uncertain result with the same key and body. A configured source launch recipe is inherited and starts a new foreground process once on restore; readiness is reported separately from machine status. Filesystem only: no RAM, processes, mounted volumes, or automatic protection from provider crashes. Quiesce applications before capture for application-consistent data. Cookie mutations require a trusted Origin.","parameters":[{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"required":true,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^(small|c[1-9]\\d{0,2})$"},"createdAt":{"type":"string","format":"date-time"},"name":{"type":"string","minLength":1,"maxLength":80}},"required":["id","createdAt"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ContainerStatus"},{"type":"object","properties":{"creation":{"type":"object","properties":{"id":{"type":"string"},"containerId":{"type":"string"},"createdAt":{"type":"string"},"status":{"type":"string","enum":["starting","running","stopped"]},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["starting","ready","failed"]},"port":{"type":"integer"},"path":{"type":"string"},"logPath":{"type":"string"},"checkedAt":{"type":"string","format":"date-time"},"error":{"type":"string","enum":["launch_exited","readiness_timeout"]},"logTail":{"type":"string","description":"At most 8192 UTF-8 bytes of application diagnostics on failure; authenticated account data."}},"required":["status","port","path","logPath"]}},"required":["id","containerId","createdAt","status"]}}}]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/secrets":{"get":{"operationId":"listSecrets","tags":["Secrets"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"summary":"List owned secret metadata","description":"Metadata only. Available during billing outages and disabled issuance. Values and encrypted records are never returned.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"secrets":{"type":"array","items":{"$ref":"#/components/schemas/SecretMetadata"}}},"required":["secrets"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"createSecret","tags":["Secrets"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"summary":"Store an encrypted, host-scoped outbound credential","description":"Requires secrets.vault, operator rollout access for the authenticated account, and paid access. Hostname, header and prefix are immutable. Bind the returned ID using secretBindings when creating a machine with networkPolicy. Injection happens outside the guest for HTTPS to the exact allowed hostname. Choose a trusted upstream and scoped, revocable token: an upstream can disclose or transform its credentials in responses. Secret mediation is not a guarantee against a malicious upstream. Cookie mutations require a trusted Origin.","parameters":[{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"value":{"type":"string","minLength":1,"maxLength":4096,"pattern":"^[\\x21-\\x7e]+$","description":"Write-only credential; never returned, logged, or placed in the guest."},"hostname":{"type":"string","minLength":1,"maxLength":253},"header":{"type":"string","enum":["authorization","x-api-key","api-key"]},"prefix":{"type":"string","maxLength":32}},"required":["name","value","hostname","header"]}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretMetadata"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/secrets/{secretId}":{"put":{"operationId":"rotateSecret","tags":["Secrets"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"summary":"Replace the value of an owned secret","description":"Requires operator rollout access and paid access. Host/header scope is unchanged. New mediated requests use the replacement value. Already accepted upstream requests cannot be revoked.","parameters":[{"schema":{"type":"string","pattern":"^sec_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"required":true,"name":"secretId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":4096,"pattern":"^[\\x21-\\x7e]+$","description":"Write-only credential; never returned, logged, or placed in the guest."}},"required":["value"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretMetadata"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteSecret","tags":["Secrets"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"summary":"Revoke an owned secret","description":"Available without paid access or enabled issuance. Subsequent requests that require this binding fail closed; already accepted upstream requests may complete. Revoke the upstream credential separately when necessary.","parameters":[{"schema":{"type":"string","pattern":"^sec_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"required":true,"name":"secretId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/pools":{"get":{"operationId":"listPools","tags":["Pools"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"summary":"List account-managed prewarming pools","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"pools":{"type":"array","items":{"$ref":"#/components/schemas/ManagedPool"},"maxItems":8}},"required":["pools"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"createPool","tags":["Pools"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"summary":"Create a time-bounded pool with automatic replenishment","description":"Requires pools.managed and paid access. Maximum eight pools per account. targetSize is unclaimed inventory, including starts in progress; zero pauses and drains inventory. Required ttlSeconds bounds automatic spending to at most 24 hours. Warm guests are ordinary billed ad-hoc containers and consume existing starts, compute allowance, concurrency and spending caps, even before acquisition. Their original session and idle deadlines remain in effect. Replenishment runs through account Durable Object alarms, remains bounded by billing and quota, and retries temporary errors with backoff; readiness is not guaranteed. Image/network selection and expiry are immutable. On expiry, only unclaimed inventory is stopped. Idempotency-Key retains one pool creation for 24 hours; a deleted original returns 409 pool_no_longer_exists. Cookie mutations require a trusted Origin.","parameters":[{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"required":true,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"size":{"type":"string","enum":["lite","small","medium","large","xl"]},"internet":{"type":"boolean"},"catalogId":{"type":"string"},"imageId":{"type":"string"},"networkPolicy":{"type":"object","properties":{"allow":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":64},"deny":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":64}},"required":["allow"],"additionalProperties":false,"description":"HTTP/HTTPS egress on ports 80/443. Exact domains, *.domain, IPv4/IPv6 CIDR or *; deny wins. Hostname DNS lookup requires a matching domain allow rule; CIDR-only grants apply to literal IP requests. All resolved addresses must be public and allowed. Other protocols/ports and redirects are denied."},"secretBindings":{"type":"array","items":{"type":"string","pattern":"^sec_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"maxItems":16},"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\u0000-\\u001f\\u007f]+$"},"targetSize":{"type":"integer","minimum":0,"maximum":20},"ttlSeconds":{"type":"integer","minimum":60,"maximum":86400}},"required":["name","targetSize","ttlSeconds"],"additionalProperties":false}}}},"responses":{"200":{"description":"Idempotent replay.","content":{"application/json":{"schema":{"type":"object","properties":{"pool":{"$ref":"#/components/schemas/ManagedPool"}},"required":["pool"]}}}},"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"pool":{"$ref":"#/components/schemas/ManagedPool"}},"required":["pool"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/pools/{poolId}":{"get":{"operationId":"getPool","tags":["Pools"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"summary":"Read managed pool readiness and refill errors","parameters":[{"schema":{"type":"string","pattern":"^pool_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"required":true,"name":"poolId","in":"path"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"pool":{"$ref":"#/components/schemas/ManagedPool"}},"required":["pool"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"patch":{"operationId":"updatePool","tags":["Pools"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"summary":"Rename or resize a managed pool","description":"Only name and targetSize can change. Lowering targetSize stops excess unclaimed inventory; acquired machines are unaffected. Zero pauses replenishment and drains inventory. Expired pools cannot be extended. Cookie mutations require a trusted Origin.","parameters":[{"schema":{"type":"string","pattern":"^pool_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"required":true,"name":"poolId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\u0000-\\u001f\\u007f]+$"},"targetSize":{"type":"integer","minimum":0,"maximum":20}},"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"pool":{"$ref":"#/components/schemas/ManagedPool"}},"required":["pool"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deletePool","tags":["Pools"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"summary":"Delete a managed pool and stop its unclaimed guests","description":"Deletion is idempotent and available during billing outages or disabled pool issuance. Acquired guests are unaffected. Ambiguous stops remain generation-fenced and retry on alarms; 503 pool_cleanup_pending means deletion is persisted and cleanup remains in progress. Cookie mutations require a trusted Origin.","parameters":[{"schema":{"type":"string","pattern":"^pool_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"required":true,"name":"poolId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/pools/{poolId}/acquire":{"post":{"operationId":"acquirePoolContainer","tags":["Pools"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"summary":"Atomically acquire one running pool guest","description":"Requires Idempotency-Key; no body or an empty JSON object. Removes exactly one running generation from inventory and schedules replacement. Acquired guests are never returned to a pool. Session and idle deadlines are not reset. Returns 409 pool_empty if none is ready, 410 pool_expired after expiry. Replays retain the original generation for 24 hours; stopped/replaced generations return 409 acquisition_no_longer_running. Reusing a key for a different pool returns 409 idempotency_key_conflict. Cookie mutations require a trusted Origin.","parameters":[{"schema":{"type":"string","pattern":"^pool_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"required":true,"name":"poolId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"required":true,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"poolId":{"type":"string","pattern":"^pool_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"container":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"size":{"type":"string","enum":["lite","small","medium","large","xl"]},"computeUnits":{"type":"number"},"instance":{"type":"string","enum":["lite","standard-1","standard-2","standard-3","standard-4"]},"status":{"type":"string","enum":["starting","running","stopped"]},"lifecycle":{"type":"string","enum":["ad_hoc","production"]},"stopReason":{"type":"string"},"internet":{"type":"boolean","description":"Immutable outbound internet selection; true for legacy generations."},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"imageId":{"type":"string"},"imageName":{"type":"string"},"catalogId":{"type":"string"},"networkPolicy":{"type":"object","properties":{"allow":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":64},"deny":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":64}},"required":["allow"],"additionalProperties":false,"description":"HTTP/HTTPS egress on ports 80/443. Exact domains, *.domain, IPv4/IPv6 CIDR or *; deny wins. Hostname DNS lookup requires a matching domain allow rule; CIDR-only grants apply to literal IP requests. All resolved addresses must be public and allowed. Other protocols/ports and redirects are denied."},"secretBindings":{"type":"array","items":{"type":"string","pattern":"^sec_[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$"},"maxItems":16},"workspaceId":{"type":"string","format":"uuid"},"persistenceExpiresAt":{"type":"integer","description":"Saved filesystem expiry in Unix milliseconds for a stopped machine."},"imageDigest":{"type":"string","description":"Deployment-resolved immutable image reference for this generation; absent on older generations."},"readiness":{"type":"object","properties":{"status":{"type":"string","enum":["starting","ready","failed"]},"port":{"type":"integer"},"path":{"type":"string"},"logPath":{"type":"string"},"checkedAt":{"type":"string","format":"date-time"},"error":{"type":"string","enum":["launch_exited","readiness_timeout"]},"logTail":{"type":"string","description":"At most 8192 UTF-8 bytes of application diagnostics on failure; authenticated account data."}},"required":["status","port","path","logPath"]},"launch":{"type":"object","properties":{"command":{"type":"string","minLength":1,"maxLength":4096,"pattern":"^[^\\u0000]+$","description":"Shell source up to 4096 characters; multiline commands are allowed. NUL bytes are rejected."},"cwd":{"type":"string","minLength":1,"maxLength":1024,"description":"Absolute working directory without dot segments; defaults to /workspace."},"readiness":{"type":"object","properties":{"port":{"type":"integer","minimum":1024,"maximum":65535},"path":{"type":"string","minLength":1,"maxLength":1024,"description":"Local HTTP path, default /. Redirects are not followed."},"timeoutMs":{"type":"integer","minimum":1000,"maximum":60000,"description":"Readiness deadline after machine boot, default 30000 ms."}},"required":["port"],"additionalProperties":false}},"required":["command","readiness"],"additionalProperties":false,"description":"Recipe for future filesystem restores. Setting this does not launch or restart the current application."}},"required":["id","name","size","computeUnits","instance","status","createdAt","expiresAt"]}},"required":["poolId","container"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"405":{"description":"Method not allowed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Saved workspace has expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/exec":{"post":{"operationId":"executeContainerCommand","tags":["Containers"],"summary":"Run a bounded foreground shell command","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Runs /bin/sh -lc without a PTY on an owned running generation. Does not create a machine or reserve a start. Command is limited to 16384 UTF-8 bytes; request body to 32 KiB. Combined stdout/stderr is limited to 1 MiB. Timeout includes process startup and is capped by the hard deadline. Timeout or excess output terminates the process and returns partial output with a null exitCode. A disconnect requests cancellation when observable; the timeout always bounds the request. Results are not retained and commands are not idempotent: do not blindly retry after transport failure. Cookie requests require a trusted Origin.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","description":"Trusted browser origin; required for cookie mutations."},"required":false,"description":"Trusted browser origin; required for cookie mutations.","name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"command":{"type":"string","minLength":1,"maxLength":16384,"description":"Shell command, at most 16 KiB in UTF-8."},"timeoutMs":{"type":"integer","minimum":1,"maximum":60000,"default":30000}},"required":["command"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"stdout":{"type":"string"},"stderr":{"type":"string"},"exitCode":{"type":["integer","null"]},"timedOut":{"type":"boolean"},"outputTruncated":{"type":"boolean"}},"required":["stdout","stderr","exitCode","timedOut","outputTruncated"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/files/transfer":{"get":{"operationId":"downloadContainerFile","tags":["Containers"],"summary":"Stream a file download","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Streams a regular file in an owned running generation under backpressure, up to 67108864 bytes without a file-sized Worker buffer. Shares the execution pool, renews idle activity, and ends within 300000 ms or the generation deadline. Requires Linux, /bin/sh and GNU coreutils. Files use the sandbox's existing lifecycle and persistence behavior. Transfers cannot resume; mutations are never automatically retried. Returns a required Content-Length backed by an exact fixed-length response stream and raw bytes. A changing file is not a consistent snapshot; truncation and disconnects fail the response stream. Consumers must discard incomplete output.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","minLength":2,"maxLength":4096},"required":true,"name":"path","in":"query"}],"responses":{"200":{"description":"Streamed file bytes.","headers":{"Content-Length":{"required":true,"description":"Exact uncompressed byte length; the fixed-length response fails on truncation or overflow.","schema":{"type":"integer","minimum":0,"maximum":67108864}}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"put":{"operationId":"uploadContainerFile","tags":["Containers"],"summary":"Stream an atomic file upload","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Streams a regular file in an owned running generation under backpressure, up to 67108864 bytes without a file-sized Worker buffer. Shares the execution pool, renews idle activity, and ends within 300000 ms or the generation deadline. Requires Linux, /bin/sh and GNU coreutils. Files use the sandbox's existing lifecycle and persistence behavior. Transfers cannot resume; mutations are never automatically retried. The required size is the exact body length. A short, oversized or aborted input never replaces the destination. A clean EOF authorizes atomic rename after all bytes have arrived. Parent must exist; directories and leaf symlinks are rejected. Mode is 0600 for new files; replacement preserves permission bits. A lost response can hide a completed rename: inspect state before retrying. Interrupted processes may leave a hidden temporary file beside the destination. Cookie writes require a trusted Origin.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","minLength":2,"maxLength":4096},"required":true,"name":"path","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":67108864},"required":false,"name":"size","in":"query"},{"schema":{"type":"string"},"required":false,"name":"Origin","in":"header"}],"requestBody":{"required":false,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"size":{"type":"integer","minimum":0,"maximum":67108864}},"required":["path","size"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/files":{"get":{"operationId":"readContainerFile","tags":["Containers"],"summary":"Read a binary file","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Accesses files in an owned running generation without SSH. Does not create a machine or consume a start. Files are limited to 1048576 bytes; oversized reads return an error without partial data. Runtime operations are bounded by 30000 ms and the hard deadline, share the four-command execution pool, and renew idle activity. Files remain ephemeral. Custom images need /bin/sh and GNU coreutils. Cookie writes require a trusted Origin. Reads regular files, including symlink targets inside the guest. Returns raw application/octet-stream bytes with caching disabled.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","minLength":2,"maxLength":4096,"description":"Absolute guest file path, at most 4096 UTF-8 bytes. Empty, dot and parent segments are rejected."},"required":true,"description":"Absolute guest file path, at most 4096 UTF-8 bytes. Empty, dot and parent segments are rejected.","name":"path","in":"query"},{"schema":{"type":"string","description":"Trusted browser origin; required for cookie writes."},"required":false,"description":"Trusted browser origin; required for cookie writes.","name":"Origin","in":"header"}],"responses":{"200":{"description":"Raw file bytes.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"put":{"operationId":"writeContainerFile","tags":["Containers"],"summary":"Write a binary file","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Accesses files in an owned running generation without SSH. Does not create a machine or consume a start. Files are limited to 1048576 bytes; oversized reads return an error without partial data. Runtime operations are bounded by 30000 ms and the hard deadline, share the four-command execution pool, and renew idle activity. Files remain ephemeral. Custom images need /bin/sh and GNU coreutils. Cookie writes require a trusted Origin. The body is raw bytes; an empty body writes an empty file. The parent directory must exist. Writes use a temporary file and atomic rename; regular files are replaced, while directories and existing symlinks are rejected. New files use mode 0600; replacement preserves permission bits. A lost response may hide a successful write: read to reconcile before retrying.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","minLength":2,"maxLength":4096,"description":"Absolute guest file path, at most 4096 UTF-8 bytes. Empty, dot and parent segments are rejected."},"required":true,"description":"Absolute guest file path, at most 4096 UTF-8 bytes. Empty, dot and parent segments are rejected.","name":"path","in":"query"},{"schema":{"type":"string","description":"Trusted browser origin; required for cookie writes."},"required":false,"description":"Trusted browser origin; required for cookie writes.","name":"Origin","in":"header"}],"requestBody":{"required":false,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"size":{"type":"integer","minimum":0,"maximum":1048576}},"required":["path","size"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/files/list":{"get":{"tags":["Containers"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Owned, generation-qualified guest filesystem operation. Rechecks the generation and paid lease before launch, shares the four-operation execution pool and renews idle activity. Bounded by 30000 ms and the hard deadline; output is at most 1048576 bytes. Requires bash, GNU coreutils, findutils and sed in the image. Intermediate symlinks resolve inside the owned guest. No start is consumed. Files are ephemeral. Mutations are never automatically retried; inspect state after a lost response. One level only, sorted by UTF-8 filename bytes. Child symlinks are not followed. The directory itself may be a symlink. Pagination rescans the directory; changes between pages can duplicate or omit entries. Non-UTF-8 filenames fail explicitly rather than returning an unusable replacement path.","operationId":"listContainerDirectory","summary":"List a directory page","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":4096,"description":"Absolute UTF-8 guest path, at most 4096 bytes. No empty, dot or parent segments. Root is allowed only for list/stat."},"required":true,"description":"Absolute UTF-8 guest path, at most 4096 bytes. No empty, dot or parent segments. Root is allowed only for list/stat.","name":"path","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":1000000,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","description":"Required for cookie mutations; Bearer keys may omit it."},"required":false,"description":"Required for cookie mutations; Bearer keys may omit it.","name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"entries":{"type":"array","items":{"$ref":"#/components/schemas/FileEntry"}},"nextOffset":{"type":["integer","null"]}},"required":["path","entries","nextOffset"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/files/stat":{"get":{"tags":["Containers"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Owned, generation-qualified guest filesystem operation. Rechecks the generation and paid lease before launch, shares the four-operation execution pool and renews idle activity. Bounded by 30000 ms and the hard deadline; output is at most 1048576 bytes. Requires bash, GNU coreutils, findutils and sed in the image. Intermediate symlinks resolve inside the owned guest. No start is consumed. Files are ephemeral. Mutations are never automatically retried; inspect state after a lost response. Returns metadata for the symlink itself by default, including its target; followSymlinks=true reads the target instead. Broken symlinks can be inspected without dereferencing. Modification times have second precision.","operationId":"statContainerFile","summary":"Read file metadata","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":4096,"description":"Absolute UTF-8 guest path, at most 4096 bytes. No empty, dot or parent segments. Root is allowed only for list/stat."},"required":true,"description":"Absolute UTF-8 guest path, at most 4096 bytes. No empty, dot or parent segments. Root is allowed only for list/stat.","name":"path","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"followSymlinks","in":"query"},{"schema":{"type":"string","description":"Required for cookie mutations; Bearer keys may omit it."},"required":false,"description":"Required for cookie mutations; Bearer keys may omit it.","name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileEntry"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/files/mkdir":{"post":{"tags":["Containers"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Owned, generation-qualified guest filesystem operation. Rechecks the generation and paid lease before launch, shares the four-operation execution pool and renews idle activity. Bounded by 30000 ms and the hard deadline; output is at most 1048576 bytes. Requires bash, GNU coreutils, findutils and sed in the image. Intermediate symlinks resolve inside the owned guest. No start is consumed. Files are ephemeral. Mutations are never automatically retried; inspect state after a lost response. recursive=true creates missing parents; existing non-symlink directories succeed. Default permissions are 0700 for the final directory. Parent permissions follow the guest umask. Existing leaf symlinks and non-directories conflict.","operationId":"createContainerDirectory","summary":"Create a directory","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","description":"Required for cookie mutations; Bearer keys may omit it."},"required":false,"description":"Required for cookie mutations; Bearer keys may omit it.","name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":4096,"description":"Absolute UTF-8 guest path, at most 4096 bytes. No empty, dot or parent segments. Root is allowed only for list/stat."},"recursive":{"type":"boolean"},"mode":{"type":"string","pattern":"^0[0-7]{3}$","description":"Octal permission bits, from 0000 through 0777."}},"required":["path"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"ok":{"type":"boolean","enum":[true]}},"required":["path","ok"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/files/remove":{"delete":{"tags":["Containers"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Owned, generation-qualified guest filesystem operation. Rechecks the generation and paid lease before launch, shares the four-operation execution pool and renews idle activity. Bounded by 30000 ms and the hard deadline; output is at most 1048576 bytes. Requires bash, GNU coreutils, findutils and sed in the image. Intermediate symlinks resolve inside the owned guest. No start is consumed. Files are ephemeral. Mutations are never automatically retried; inspect state after a lost response. Removes a symlink itself without following its target. Directories must be empty unless recursive=true. Missing paths return 404. Recursive deletion may partially complete before interruption. Root cannot be removed.","operationId":"removeContainerFile","summary":"Remove a file or directory","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":4096,"description":"Absolute UTF-8 guest path, at most 4096 bytes. No empty, dot or parent segments. Root is allowed only for list/stat."},"required":true,"description":"Absolute UTF-8 guest path, at most 4096 bytes. No empty, dot or parent segments. Root is allowed only for list/stat.","name":"path","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"recursive","in":"query"},{"schema":{"type":"string","description":"Required for cookie mutations; Bearer keys may omit it."},"required":false,"description":"Required for cookie mutations; Bearer keys may omit it.","name":"Origin","in":"header"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"ok":{"type":"boolean","enum":[true]}},"required":["path","ok"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/files/move":{"post":{"tags":["Containers"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Owned, generation-qualified guest filesystem operation. Rechecks the generation and paid lease before launch, shares the four-operation execution pool and renews idle activity. Bounded by 30000 ms and the hard deadline; output is at most 1048576 bytes. Requires bash, GNU coreutils, findutils and sed in the image. Intermediate symlinks resolve inside the owned guest. No start is consumed. Files are ephemeral. Mutations are never automatically retried; inspect state after a lost response. Destination must be unused and its parent must exist; no replacement or directory nesting is performed. Moves preserve symlinks. Across filesystems the guest may copy then remove, so interruption can leave both paths. Root and moves into the source subtree are rejected.","operationId":"moveContainerFile","summary":"Move a file or directory","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","description":"Required for cookie mutations; Bearer keys may omit it."},"required":false,"description":"Required for cookie mutations; Bearer keys may omit it.","name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":4096,"description":"Absolute UTF-8 guest path, at most 4096 bytes. No empty, dot or parent segments. Root is allowed only for list/stat."},"destination":{"type":"string","minLength":1,"maxLength":4096,"description":"Absolute UTF-8 guest path, at most 4096 bytes. No empty, dot or parent segments. Root is allowed only for list/stat."}},"required":["path","destination"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"destination":{"type":"string"},"ok":{"type":"boolean","enum":[true]}},"required":["path","destination","ok"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/containers/files/chmod":{"patch":{"tags":["Containers"],"security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Owned, generation-qualified guest filesystem operation. Rechecks the generation and paid lease before launch, shares the four-operation execution pool and renews idle activity. Bounded by 30000 ms and the hard deadline; output is at most 1048576 bytes. Requires bash, GNU coreutils, findutils and sed in the image. Intermediate symlinks resolve inside the owned guest. No start is consumed. Files are ephemeral. Mutations are never automatically retried; inspect state after a lost response. Changes the selected entry's permission bits. Leaf symlinks are rejected. No recursive chmod, owner changes or special mode bits. Root cannot be modified.","operationId":"setContainerFileMode","summary":"Set file permission bits","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"createdAt","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":4096,"description":"Absolute UTF-8 guest path, at most 4096 bytes. No empty, dot or parent segments. Root is allowed only for list/stat."},"required":true,"description":"Absolute UTF-8 guest path, at most 4096 bytes. No empty, dot or parent segments. Root is allowed only for list/stat.","name":"path","in":"query"},{"schema":{"type":"string","description":"Required for cookie mutations; Bearer keys may omit it."},"required":false,"description":"Required for cookie mutations; Bearer keys may omit it.","name":"Origin","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","pattern":"^0[0-7]{3}$","description":"Octal permission bits, from 0000 through 0777."}},"required":["mode"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"mode":{"type":"string","pattern":"^0[0-7]{3}$","description":"Octal permission bits, from 0000 through 0777."},"ok":{"type":"boolean","enum":[true]}},"required":["path","mode","ok"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Paid access required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/images/tags":{"get":{"operationId":"listImageTags","tags":["Images"],"summary":"List account image tags","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"imageId":{"type":"string","format":"uuid"},"updatedAt":{"type":"string"}},"required":["tag","imageId","updatedAt"]}}},"required":["tags"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/images/tags/{tag}":{"get":{"operationId":"resolveImageTag","tags":["Images"],"summary":"Resolve a tag to an immutable owned image version","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$"},"required":true,"name":"tag","in":"path"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"tag":{"type":"string"},"image":{"$ref":"#/components/schemas/Image"}},"required":["tag","image"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"put":{"operationId":"setImageTag","tags":["Images"],"summary":"Create or move an account image tag","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Only owned, ready images may be tagged. Maximum 30 tags per account. Each image ID is an immutable version; moving a tag does not change existing containers. Cookie requests require a trusted Origin.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$"},"required":true,"name":"tag","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"imageId":{"type":"string","format":"uuid"}},"required":["imageId"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"tag":{"type":"string"},"imageId":{"type":"string","format":"uuid"},"updatedAt":{"type":"string"}},"required":["tag","imageId","updatedAt"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteImageTag","tags":["Images"],"summary":"Remove an account image tag","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$"},"required":true,"name":"tag","in":"path"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/images":{"get":{"operationId":"listImages","tags":["Images"],"summary":"List account images and monthly build usage","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"$ref":"#/components/schemas/Image"}},"buildsEnabled":{"type":"boolean"},"privateRegistriesEnabled":{"type":"boolean"},"limits":{"type":"object","properties":{"maxBuildsPerMonth":{"type":"number"},"maxSavedImages":{"type":"number"},"maxContextBytes":{"type":"number"},"maxDockerfileBytes":{"type":"number"},"maxBuildSeconds":{"type":"number"},"maxTags":{"type":"number"}},"required":["maxBuildsPerMonth","maxSavedImages","maxContextBytes","maxDockerfileBytes","maxBuildSeconds","maxTags"]},"usage":{"type":"object","properties":{"month":{"type":"string"},"builds":{"type":"number"}},"required":["month","builds"]}},"required":["images","buildsEnabled","privateRegistriesEnabled","limits","usage"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"createImage","tags":["Images"],"summary":"Queue a custom image build","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Cookie requests require a trusted Origin. Dockerfile must start with FROM mainbrella:base; one build stage. Optional gzip context is limited to 512 KiB, Dockerfile to 16 KiB. cacheFrom selects an owned ready image for inline layer caching. baseImage is a JSON string containing {image, username?, password?}; image must be digest-pinned on ghcr.io or docker.io with namespace/repository. Both credentials must be supplied together, encrypted at rest and consumed once by the trusted preparation job; they never reach the build job. Requires privateRegistriesEnabled. The selected base is loaded as mainbrella:base and must satisfy the Linux amd64 runtime compatibility checks. Images are limited to 512 MiB. A cache hit is not guaranteed.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"dockerfile":{"type":"string"},"context":{"type":"string","format":"binary"},"cacheFrom":{"type":"string","format":"uuid"},"baseImage":{"type":"string","description":"JSON-encoded object with image, username and password; credentials optional as a pair"}},"required":["name","dockerfile"]}}}},"responses":{"202":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"image":{"$ref":"#/components/schemas/Image"}},"required":["image"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate, quota, or connection limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/images/{id}":{"get":{"operationId":"getImage","tags":["Images"],"summary":"Get an owned image","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"image":{"$ref":"#/components/schemas/Image"}},"required":["image"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteImage","tags":["Images"],"summary":"Delete an owned image and queue deployment reconciliation","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"description":"Active builds cannot be deleted. Cookie requests require a trusted Origin.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/images/{id}/logs":{"get":{"operationId":"getImageLogs","tags":["Images"],"summary":"Get image build logs","security":[{"cookieAuth":[]},{"sessionBearer":[]},{"apiKeyBearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"logs":{"type":"string"},"status":{"type":"string"}},"required":["logs","status"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Origin or permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/internal/image-builds/manifest":{"get":{"operationId":"getImageManifest","tags":["Internal"],"summary":"Get deployable custom images","security":[{"imageBuild":[]}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"images":{"type":"object","additionalProperties":{"type":"object","properties":{"image":{"type":"string"}},"required":["image"]}}},"required":["images"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/internal/image-builds/deployment-lock":{"post":{"operationId":"acquireImageDeploymentLock","tags":["Internal"],"summary":"Acquire the image deployment lease","security":[{"imageBuild":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","format":"uuid"}},"required":["token"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"acquired":{"type":"boolean"}},"required":["acquired"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"releaseImageDeploymentLock","tags":["Internal"],"summary":"Release the image deployment lease","security":[{"imageBuild":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","format":"uuid"}},"required":["token"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"released":{"type":"boolean"}},"required":["released"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/internal/image-builds/{id}/source":{"post":{"operationId":"claimImageBuildSource","tags":["Internal"],"summary":"Claim queued build source for a trusted runner","security":[{"imageBuild":[]}],"description":"One-use claim. Atomically clears stored registry credentials. The response may contain sensitive credentials and must never be logged or uploaded as an artifact. A lost response requires a new build.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"dockerfile":{"type":"string"},"contextBase64":{"type":["string","null"]},"baseImage":{"type":["object","null"],"properties":{"image":{"type":"string","maxLength":512,"description":"Digest-pinned ghcr.io or docker.io image with a namespace and repository"},"username":{"type":"string","minLength":1,"maxLength":256},"password":{"type":"string","minLength":1,"maxLength":4096}},"required":["image"]},"cacheImage":{"type":["string","null"]}},"required":["dockerfile","contextBase64","baseImage","cacheImage"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}},"/internal/image-builds/{id}/status":{"post":{"operationId":"updateImageBuildStatus","tags":["Internal"],"summary":"Report trusted image publication or build failure","security":[{"imageBuild":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["failed","publishing","ready"]},"image":{"type":"string"},"logs":{"type":"string"}},"required":["status"]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"boolean"}},"required":["updated"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Authentication required or credential invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicts with current state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"provider":{"type":"string"}},"required":["error"]}}}}}}}},"webhooks":{}}