{"openapi":"3.1.0","info":{"title":"Smolny Provider API","version":"1.2.0","description":"Project-scoped Incus virtual machines, Firecracker microVMs and durable workspaces through the Smolny HTTPS edge. An agent key must hold every scope listed in x-smolny-scopes, plus scopes required by any supplied options. Project features and limits still apply. Use GET /v1/permissions for the active credential."},"servers":[{"url":"https://api.smolny.tech","description":"Public Smolny API"},{"url":"/","description":"Current deployment"}],"security":[{"BearerAuth":[]}],"paths":{"/healthz":{"get":{"operationId":"getHealth","summary":"Check the API process","security":[],"responses":{"200":{"description":"API process is serving requests","content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"const":"ok"}}}}}},"503":{"$ref":"#/components/responses/Error"}}}},"/llms.txt":{"get":{"operationId":"getAgentQuickstart","summary":"Read the public starter instructions for an agent","security":[],"responses":{"200":{"description":"Agent instructions and OpenAPI link","content":{"text/plain":{"schema":{"type":"string"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/openapi.json":{"get":{"operationId":"getOpenApi","summary":"Read the OpenAPI contract","security":[],"responses":{"200":{"description":"OpenAPI 3.1 document","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"$ref":"#/components/responses/Error"}}}},"/dashboard/api/auth/yandex":{"get":{"operationId":"getYandexBrowserSignIn","summary":"Check availability of Yandex ID sign-in for the trusted dashboard","security":[],"parameters":[{"name":"X-Smolny-Dashboard","in":"header","required":true,"schema":{"type":"string","const":"1"}}],"responses":{"200":{"description":"Provider availability and linking status for the active customer session","content":{"application/json":{"schema":{"type":"object","required":["enabled","linked"],"properties":{"enabled":{"type":"boolean"},"linked":{"type":"boolean"}}}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"beginYandexBrowserSignIn","summary":"Begin a browser-bound Yandex ID authorization-code flow","description":"This route is available only from the trusted dashboard. Register requires a private smr_ invitation. Link requires an existing authenticated customer cookie and an explicit account linking request. Login returns to the project bound to the verified Yandex ID. Navigate the same browser to authorization_url.","security":[],"parameters":[{"name":"Origin","in":"header","required":true,"schema":{"type":"string","const":"https://api.smolny.tech"}},{"name":"X-Smolny-Dashboard","in":"header","required":true,"schema":{"type":"string","const":"1"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["mode"],"additionalProperties":false,"properties":{"mode":{"enum":["login","link"]}}},{"type":"object","required":["mode","invitation"],"additionalProperties":false,"properties":{"mode":{"const":"register"},"invitation":{"type":"string","format":"password","pattern":"^smr_[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"}}}]}}}},"responses":{"200":{"description":"One-time redirect URL and temporary browser cookie","content":{"application/json":{"schema":{"type":"object","required":["authorization_url"],"properties":{"authorization_url":{"type":"string","format":"uri"}}}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/auth/yandex/callback":{"get":{"operationId":"finishYandexBrowserSignIn","summary":"Accept the Yandex ID browser callback at the canonical HTTPS origin","description":"Called by Yandex OAuth through the initiating browser. Requires its one-time browser cookie and state. Exchanges a code server-side, or handles denied consent. Redirects to the dashboard with a fixed destination and issues a customer session on success.","security":[],"parameters":[{"name":"state","in":"query","required":true,"schema":{"type":"string"}},{"name":"code","in":"query","schema":{"type":"string","format":"password"}},{"name":"error","in":"query","schema":{"type":"string"}},{"name":"error_description","in":"query","schema":{"type":"string"}}],"responses":{"303":{"description":"Return to the dashboard. The browser receives a session cookie on success.","headers":{"Location":{"schema":{"type":"string"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/account/register":{"post":{"operationId":"registerCustomer","summary":"Register a customer account with a pilot invitation","description":"Send the registration-only smr_ invitation to https://api.smolny.tech. Generate and retain a fresh recovery_secret from 32 cryptographically random bytes encoded as unpadded base64url. The same proof can recover a lost response until the invitation expires. Store the account credential privately and use it with GET /v1/permissions to sign in by API. Exchange it for a separate scoped agent key using POST /v1/project/keys.","security":[],"requestBody":{"$ref":"#/components/requestBodies/RegistrationProof"},"responses":{"200":{"$ref":"#/components/responses/CustomerRegistration"},"201":{"$ref":"#/components/responses/CustomerRegistration"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/permissions":{"get":{"operationId":"getProjectPermissions","x-smolny-scopes":[],"summary":"Sign in and inspect the current project credential and enabled features","description":"Returns the project, role, scopes, credential expiry and feature flags for the presented bearer token. Read resource quotas and present usage at /v1/usage with the read scope.","responses":{"200":{"description":"Authenticated permissions","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ProjectAccess"},{"type":"object","required":["scope_catalog","features"],"properties":{"scope_catalog":{"type":"object","additionalProperties":{"type":"string"}},"features":{"type":"object","required":["fast_compute","durable_workspaces","fast_images","custom_images","incus_snapshots","key_management","webhooks"],"properties":{"fast_compute":{"type":"boolean"},"durable_workspaces":{"type":"boolean"},"fast_images":{"type":"boolean"},"custom_images":{"type":"boolean"},"incus_snapshots":{"type":"boolean"},"key_management":{"type":"boolean"},"webhooks":{"type":"boolean","description":"This project is configured for workspace webhooks."}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/storage":{"get":{"operationId":"listProjectStorage","x-smolny-scopes":["read"],"summary":"List project work volumes and their snapshots","description":"Reads background storage observations and associates registered workspaces with their volumes. Partial or unavailable coverage can omit resources. This request does not refresh the broker inventory.","responses":{"200":{"description":"Cached work volume inventory","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectStorageInventory"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/previews":{"get":{"operationId":"listProjectPreviews","x-smolny-scopes":["read"],"summary":"List metadata for active project previews","description":"Includes ID, port, expiration, and customer resource identity. A share URL is returned only by a preview creation operation.","responses":{"200":{"description":"Project preview metadata","content":{"application/json":{"schema":{"type":"object","required":["previews"],"properties":{"previews":{"type":"array","items":{"$ref":"#/components/schemas/ProjectPreview"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/usage":{"get":{"x-smolny-scopes":["read"],"operationId":"getProjectUsage","summary":"Read observed resource usage and admission limits for the authenticated project","description":"Reads a background cache. Coverage timestamps and gaps describe partial history. Direct IP and proxy-payload bytes are independent measurements. Byte-milliseconds are decimal strings.","responses":{"200":{"description":"Project quota and observed usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectUsage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/templates":{"get":{"x-smolny-scopes":["read"],"operationId":"listTemplates","description":"Lists templates and the authenticated project's warm reserve capacity. Ready counts are snapshots for the standard template shape without an idle timeout. Concurrent requests can consume the last reserve before a create arrives.","responses":{"200":{"description":"Available templates","content":{"application/json":{"schema":{"type":"object","required":["templates"],"properties":{"templates":{"type":"array","items":{"$ref":"#/components/schemas/Template"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/images":{"get":{"x-smolny-scopes":["read"],"operationId":"listCustomImages","description":"List raw VM disks imported by the authenticated project. The operator must enable custom images for the project.","responses":{"200":{"description":"Imported project images","content":{"application/json":{"schema":{"type":"object","required":["images"],"properties":{"images":{"type":"array","items":{"$ref":"#/components/schemas/CustomImage"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/images/{image}":{"parameters":[{"name":"image","in":"path","required":true,"schema":{"type":"string","maxLength":56,"pattern":"^[a-z](?:[a-z0-9-]{0,54}[a-z0-9])?$"}}],"get":{"x-smolny-scopes":["read"],"operationId":"getCustomImage","responses":{"200":{"description":"Imported image","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomImage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"x-smolny-scopes":["storage"],"operationId":"importCustomImage","description":"Import a raw, bootable Ubuntu VM disk with the Incus VM agent installed. Use the host architecture and a UEFI Secure Boot-compatible image. Include a fixed Content-Length that is a positive multiple of 512 bytes. The maximum size is 10 GiB or the project disk cap, whichever is lower. Use the returned template to create a VM with a root disk large enough for the imported image. The image identifier is immutable while present. If an upload ends without a response, retrieve the image and compare its SHA-256 and byte size before attempting another upload. An import pending response means Incus is still reconciling an earlier upload.","parameters":[{"name":"X-Image-SHA256","in":"header","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"Imported image","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomImage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"x-smolny-scopes":["storage","destroy"],"operationId":"deleteCustomImage","description":"Remove the project image from the launch catalog. Existing VM disks remain available.","responses":{"204":{"description":"Image deleted"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invitations/redeem":{"post":{"operationId":"redeemPilotInvitation","description":"Accepts a private invitation for an operator-provisioned project. Generate a fresh recovery_secret from 32 cryptographically random bytes encoded as unpadded base64url. If the response is lost, retry with the same payload while the invitation and issued key are valid. A different recovery secret cannot recover an issued key. Request and response secrets must stay out of URLs and logs.","security":[],"requestBody":{"$ref":"#/components/requestBodies/InvitationProof"},"responses":{"200":{"description":"Recovered the same active project credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PilotInvitationReceipt"}}}},"201":{"description":"Issued the single project credential for this invitation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PilotInvitationReceipt"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"description":"Invitation unknown, expired, revoked, or already redeemed with a different recovery secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/project/keys":{"get":{"operationId":"listProjectKeys","description":"A customer account sees active agent keys that it issued. A configured project owner sees all active keys for the project. The response contains metadata only.","responses":{"200":{"description":"Active access keys","content":{"application/json":{"schema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/ProjectKey"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createProjectKey","description":"Issues a separate bearer credential for this project. Customer accounts must supply scopes. Configured project owners may omit scopes to create a legacy delegated key. The project can have up to 16 active keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"$ref":"#/components/schemas/Name"},"scopes":{"$ref":"#/components/schemas/KeyScopes"},"ttl_seconds":{"type":"integer","minimum":1,"maximum":2592000,"default":86400}}}}}},"responses":{"201":{"$ref":"#/components/responses/IssuedProjectKey"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/project/keys/{key}":{"parameters":[{"name":"key","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProjectKeyId"}}],"delete":{"operationId":"revokeProjectKey","description":"Revokes a key issued by the authenticated customer account, or any key in the project when using the configured owner credential. Subsequent requests using the revoked key receive HTTP 401.","responses":{"204":{"description":"Access key revoked"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/project/keys/{key}/rotate":{"parameters":[{"name":"key","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProjectKeyId"}}],"post":{"operationId":"rotateProjectKey","description":"Atomically replaces an active scoped agent key with a new key, keeping its name and scopes. The old token immediately stops authenticating. The customer can rotate keys it issued. A project owner can rotate any scoped key in the project.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"ttl_seconds":{"type":"integer","minimum":1,"maximum":2592000,"default":86400}}}}}},"responses":{"201":{"$ref":"#/components/responses/IssuedProjectKey"},"401":{"$ref":"#/components/responses/Unauthorized"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvm-images":{"get":{"x-smolny-scopes":["read"],"operationId":"listMicroVMImages","description":"List prepared and pending Firecracker images in the authenticated project.","responses":{"200":{"description":"Project image catalog","content":{"application/json":{"schema":{"type":"object","required":["images"],"properties":{"images":{"type":"array","items":{"$ref":"#/components/schemas/MicroVMImage"}}}}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/v1/microvm-images/{digest}":{"parameters":[{"name":"digest","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ImageDigest"}}],"get":{"x-smolny-scopes":["read"],"operationId":"getMicroVMImage","responses":{"200":{"$ref":"#/components/responses/MicroVMImage"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"delete":{"x-smolny-scopes":["storage","destroy"],"operationId":"deleteMicroVMImage","responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"}}}},"/v1/microvm-images/{format}/{digest}":{"put":{"x-smolny-scopes":["storage"],"operationId":"uploadMicroVMImage","description":"Upload a Linux amd64 OCI archive or raw ext4 root disk of up to 2 GiB under its source SHA-256 digest. A single-host project can explicitly reprepare an existing ready image by resubmitting the original bytes with If-Match. During repreparation the current disk stays ready and the reprepare field reports progress.","parameters":[{"name":"format","in":"path","required":true,"schema":{"type":"string","enum":["oci","ext4"]}},{"name":"digest","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ImageDigest"}},{"name":"If-Match","in":"header","description":"One quoted prepared_digest from the current ready image. Omit for an initial upload.","schema":{"type":"string","pattern":"^\"sha256:[0-9a-f]{64}\"$"}}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"202":{"$ref":"#/components/responses/MicroVMImage"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"412":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"415":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"},"507":{"$ref":"#/components/responses/Error"}}}},"/v1/project/webhooks":{"get":{"operationId":"listWebhooks","summary":"List project webhook endpoints and supported event types","x-smolny-scopes":["webhooks:read"],"responses":{"200":{"description":"List project webhook endpoints and supported event types","content":{"application/json":{"schema":{"type":"object","required":["webhooks","event_types","limit","dropped_deliveries"],"properties":{"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"event_types":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceWebhookEvent"}},"limit":{"type":"integer","const":5},"dropped_deliveries":{"type":"integer","minimum":0}}}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createWebhook","summary":"Register an operator-approved HTTPS URL and return the signing secret once","x-smolny-scopes":["webhooks:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri","maxLength":512},"events":{"$ref":"#/components/schemas/WebhookSubscriptions"}},"additionalProperties":false}}}},"responses":{"201":{"description":"Register an operator-approved HTTPS URL and return the signing secret once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedWebhook"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/project/webhooks/{hook}":{"parameters":[{"name":"hook","in":"path","required":true,"schema":{"type":"string","pattern":"^wh_[a-f0-9]{32}$"}}],"get":{"operationId":"inspectWebhook","summary":"Get webhook endpoint metadata","x-smolny-scopes":["webhooks:read"],"responses":{"200":{"description":"Get webhook endpoint metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"updateWebhook","summary":"Replace subscriptions on a webhook endpoint","x-smolny-scopes":["webhooks:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["events"],"properties":{"events":{"$ref":"#/components/schemas/WebhookSubscriptions"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Replace subscriptions on a webhook endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"revokeWebhook","summary":"Revoke a webhook endpoint and cancel queued deliveries","x-smolny-scopes":["webhooks:write"],"responses":{"204":{"description":"Revoke a webhook endpoint and cancel queued deliveries"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/project/webhooks/{hook}/rotate":{"parameters":[{"name":"hook","in":"path","required":true,"schema":{"type":"string","pattern":"^wh_[a-f0-9]{32}$"}}],"post":{"operationId":"rotateWebhookSecret","summary":"Replace the signing secret and return it once","x-smolny-scopes":["webhooks:write"],"responses":{"200":{"description":"Replace the signing secret and return it once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedWebhook"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/project/webhooks/{hook}/test":{"parameters":[{"name":"hook","in":"path","required":true,"schema":{"type":"string","pattern":"^wh_[a-f0-9]{32}$"}}],"post":{"operationId":"testWebhook","summary":"Queue a signed test delivery to this endpoint","x-smolny-scopes":["webhooks:write"],"responses":{"202":{"description":"Queue a signed test delivery to this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/project/webhooks/{hook}/deliveries":{"parameters":[{"name":"hook","in":"path","required":true,"schema":{"type":"string","pattern":"^wh_[a-f0-9]{32}$"}}],"get":{"operationId":"listWebhookDeliveries","summary":"List metadata for the 50 most recent deliveries","x-smolny-scopes":["webhooks:read"],"responses":{"200":{"description":"List metadata for the 50 most recent deliveries","content":{"application/json":{"schema":{"type":"object","required":["deliveries"],"properties":{"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"},"maxItems":50}}}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/project/webhooks/{hook}/deliveries/{delivery}":{"parameters":[{"name":"hook","in":"path","required":true,"schema":{"type":"string","pattern":"^wh_[a-f0-9]{32}$"}},{"name":"delivery","in":"path","required":true,"schema":{"type":"string","pattern":"^wd_[a-f0-9]{32}$"}}],"get":{"operationId":"inspectWebhookDelivery","summary":"Get delivery and attempt metadata","x-smolny-scopes":["webhooks:read"],"responses":{"200":{"description":"Get delivery and attempt metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/project/webhooks/{hook}/deliveries/{delivery}/replay":{"parameters":[{"name":"hook","in":"path","required":true,"schema":{"type":"string","pattern":"^wh_[a-f0-9]{32}$"}},{"name":"delivery","in":"path","required":true,"schema":{"type":"string","pattern":"^wd_[a-f0-9]{32}$"}}],"post":{"operationId":"replayWebhookDelivery","summary":"Queue one more attempt with the same event ID","x-smolny-scopes":["webhooks:write"],"responses":{"202":{"description":"Queue one more attempt with the same event ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/project/egress-proxy":{"get":{"operationId":"getProjectEgressProxy","description":"Reports whether credentials are stored for the authenticated proxy-enabled project. Requires the owner bearer token on a non-clustered project.","responses":{"200":{"description":"Credential configuration status","content":{"application/json":{"schema":{"type":"object","required":["configured"],"additionalProperties":false,"properties":{"configured":{"type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Error"},"409":{"description":"Clustered project credentials must be configured by the operator on each node.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"setProjectEgressProxy","description":"Replaces the upstream Basic credentials for the authenticated proxy-enabled project and closes its open tunnels. Requires the owner bearer token on a non-clustered project.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["username","password"],"additionalProperties":false,"properties":{"username":{"type":"string","minLength":1,"maxLength":512,"writeOnly":true},"password":{"type":"string","minLength":1,"maxLength":512,"writeOnly":true}}}}}},"responses":{"204":{"description":"Credentials stored"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Error"},"409":{"description":"Clustered project credentials must be configured by the operator on each node.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"deleteProjectEgressProxy","description":"Removes upstream credentials and closes the authenticated project's open proxy tunnels. Requires the owner bearer token on a non-clustered project.","responses":{"204":{"description":"Credentials removed"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Error"},"409":{"description":"Clustered project credentials must be configured by the operator on each node.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms":{"get":{"x-smolny-scopes":["read"],"operationId":"listMicroVMs","description":"Lists active Firecracker VMs in the authenticated project. The MicroVM routes require a project with the feature enabled.","responses":{"200":{"description":"Active MicroVMs","content":{"application/json":{"schema":{"type":"object","required":["machines"],"properties":{"machines":{"type":"array","items":{"$ref":"#/components/schemas/MicroVM"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"x-smolny-scopes":["compute"],"x-smolny-conditional-scopes":{"command":["exec"],"desktop":["exec"],"volume":["storage"]},"operationId":"createMicroVM","description":"Boots Ubuntu from a clean disk with a fresh kernel when template=ubuntu-microvm, or restores a minimal BusyBox environment from a snapshot when template=microvm. With command, executes the command once in that new guest before returning 201. A completed command with a nonzero exit code is returned normally and the MicroVM remains allocated. A dispatch, guest transport, or command timeout error discards the new allocation. After a lost HTTP response, inspect the requested name before retrying. Clustered projects require an Idempotency-Key. A successful retry returns the stored response for 24 hours without dispatching another create or command.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Required for clustered microVMs and scoped to the project.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._~-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicroVMCreate"}}}},"responses":{"201":{"description":"Guest ready and, if supplied, the command has completed","headers":{"Server-Timing":{"$ref":"#/components/headers/MicroVMCreateTiming"},"Idempotency-Replayed":{"description":"Present only when returning a stored clustered create response.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicroVMCreateResult"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/snapshots":{"get":{"x-smolny-scopes":["read"],"operationId":"listMicroVMSnapshots","description":"List saved Firecracker memory and disk snapshots for this project.","responses":{"200":{"description":"Saved microVM snapshots"},"401":{"$ref":"#/components/responses/Unauthorized"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/snapshots/{snapshot_id}":{"delete":{"x-smolny-scopes":["destroy"],"operationId":"deleteMicroVMSnapshot","description":"Delete a saved Firecracker memory and disk snapshot.","responses":{"204":{"description":"Snapshot deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"get":{"x-smolny-scopes":["read"],"operationId":"getMicroVM","responses":{"200":{"$ref":"#/components/responses/MicroVM"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"x-smolny-scopes":["compute","destroy"],"operationId":"deleteMicroVM","responses":{"204":{"description":"MicroVM deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/stop":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["compute"],"x-smolny-conditional-scopes":{"force=true":["destroy"]},"operationId":"stopMicroVMWithWorkVolume","description":"Unmounts the work disk, retires the MicroVM and its boot-bound links, and releases the disk. Subsequent reads of that MicroVM return 404. A forced stop kills the guest without unmounting, so the guest filesystem recovers on reattach.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"force":{"type":"boolean","default":false}}}}}},"responses":{"204":{"description":"Compute stopped and work volume detached"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces":{"get":{"x-smolny-scopes":["read"],"operationId":"listWorkspaces","description":"List the authenticated project's registered workspaces and their last recorded lifecycle states. Use getWorkspace to check availability of the active guest.","responses":{"200":{"description":"Project workspaces","content":{"application/json":{"schema":{"type":"object","required":["workspaces"],"properties":{"workspaces":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"}}}}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces/{workspace}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"put":{"x-smolny-scopes":["storage"],"operationId":"createWorkspace","description":"Register the caller-selected ID and an existing project work volume without starting compute. Retrying the same configuration returns the existing workspace. An ID is never reused after deletion. Only one workspace can claim a volume.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreate"}}}},"responses":{"200":{"$ref":"#/components/responses/Workspace"},"201":{"$ref":"#/components/responses/Workspace"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}},"get":{"x-smolny-scopes":["read"],"operationId":"getWorkspace","description":"Read a workspace even when it is parked. A running workspace identifies the current guest when that guest answers.","responses":{"200":{"$ref":"#/components/responses/Workspace"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"x-smolny-scopes":["compute","storage","destroy"],"operationId":"deleteWorkspace","description":"Stop workspace compute gracefully and retire the logical ID. The work volume and its snapshots remain in the project. A successful repeat returns 204.","responses":{"204":{"description":"Workspace retired and work volume retained"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces/{workspace}/start":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"x-smolny-scopes":["compute"],"operationId":"startWorkspace","description":"Start a fresh Ubuntu guest with the registered image, shape, network setting and volume mounted at /work. A retry returns or completes the same running lease. Start after a successful stop opens a fresh boot under the same workspace ID.","responses":{"200":{"$ref":"#/components/responses/Workspace"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces/{workspace}/stop":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"x-smolny-scopes":["compute"],"x-smolny-conditional-scopes":{"force=true":["destroy"]},"operationId":"stopWorkspace","description":"Stop compute, retire its preview links and retain the volume. A normal stop rejects a busy mount. A forced stop can discard uncommitted writes. Repeating stop on a parked workspace succeeds.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"force":{"type":"boolean","default":false}}}}}},"responses":{"200":{"$ref":"#/components/responses/Workspace"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces/{workspace}/ssh":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"createWorkspaceSshSession","x-smolny-scopes":["exec"],"description":"Authorize one SSH connection to this running guest generation. Connect with the same bearer credential and verify the returned guest host key.","requestBody":{"$ref":"#/components/requestBodies/SshPublicKey"},"responses":{"201":{"$ref":"#/components/responses/SshSession"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces/{workspace}/ssh/{session}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/SshSessionId"}],"get":{"operationId":"openWorkspaceSshSession","x-smolny-scopes":["exec"],"description":"Upgrade an empty HTTP/1.1 request to a native OpenSSH stream. A session can be used once. It expires after 30 minutes, 120 seconds without traffic or 64 MiB in either direction.","parameters":[{"name":"Connection","in":"header","required":true,"schema":{"type":"string","const":"Upgrade"}},{"name":"Upgrade","in":"header","required":true,"schema":{"type":"string","const":"smolny-ssh"}}],"responses":{"101":{"description":"Switched to the Smolny SSH tunnel"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"revokeWorkspaceSshSession","x-smolny-scopes":["exec"],"description":"Revoke the SSH session and close its connection.","responses":{"204":{"description":"SSH session revoked"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces/{workspace}/exec":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"x-smolny-scopes":["exec"],"operationId":"executeWorkspaceCommand","description":"Execute in the running workspace's current guest generation. Start parked compute explicitly before executing.","requestBody":{"$ref":"#/components/requestBodies/Exec"},"responses":{"200":{"description":"Guest command result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecResult"}}}},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces/{workspace}/git-checkouts":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"createWorkspaceGitCheckout","description":"Project owner only. Grant read-only Git smart HTTP access to one canonical HTTPS repository from the current boot of an enabled workspace. The returned handle is sent as X-Smolny-Checkout to the returned private guest gateway URL.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitCheckoutCreate"}}}},"responses":{"201":{"description":"Ephemeral checkout grant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitCheckout"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces/{workspace}/git-checkouts/{checkout}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"in":"path","name":"checkout","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}}],"delete":{"operationId":"revokeWorkspaceGitCheckout","description":"Project owner only. Revoke a checkout on the current running boot and interrupt active transfers. Revoking a missing or already expired grant on that boot succeeds.","responses":{"204":{"description":"Git checkout revoked"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces/{workspace}/preview-links":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"x-smolny-scopes":["preview"],"operationId":"createWorkspacePreviewLink","description":"Issue an expiring GET-only link to the running guest. The link is bound to its boot and is retired on stop.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["port"],"properties":{"port":{"type":"integer","minimum":1,"maximum":65535},"path":{"type":"string","default":"/"},"ttl_seconds":{"type":"integer","minimum":1,"maximum":900,"default":300}}}}}},"responses":{"201":{"description":"Expiring browser link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewLinkResponse"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces/{workspace}/preview-links/{link}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"link","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PreviewLinkId"}}],"delete":{"x-smolny-scopes":["preview"],"operationId":"revokeWorkspacePreviewLink","responses":{"204":{"description":"Workspace browser link revoked"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvolumes/{volume}":{"parameters":[{"$ref":"#/components/parameters/WorkVolumeName"}],"post":{"x-smolny-scopes":["storage"],"operationId":"createMicroVMWorkVolume","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"size_gib":{"type":"integer","minimum":20,"maximum":40,"default":20}}}}}},"responses":{"201":{"$ref":"#/components/responses/WorkVolume"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"x-smolny-scopes":["storage","destroy"],"operationId":"deleteMicroVMWorkVolume","responses":{"204":{"description":"Detached work volume with no remaining snapshots deleted"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvolumes/{volume}/snapshots":{"parameters":[{"$ref":"#/components/parameters/WorkVolumeName"}],"post":{"x-smolny-scopes":["storage"],"operationId":"createMicroVMWorkVolumeSnapshot","requestBody":{"$ref":"#/components/requestBodies/WorkVolumeName"},"responses":{"201":{"description":"Named snapshot of the detached work disk","content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"$ref":"#/components/schemas/Name"}}}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvolumes/{volume}/snapshots/{snapshot}":{"parameters":[{"$ref":"#/components/parameters/WorkVolumeName"},{"$ref":"#/components/parameters/WorkSnapshotName"}],"delete":{"x-smolny-scopes":["storage","destroy"],"operationId":"deleteMicroVMWorkVolumeSnapshot","responses":{"204":{"description":"Snapshot deleted"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvolumes/{volume}/snapshots/{snapshot}/clone":{"parameters":[{"$ref":"#/components/parameters/WorkVolumeName"},{"$ref":"#/components/parameters/WorkSnapshotName"}],"post":{"x-smolny-scopes":["storage"],"operationId":"cloneMicroVMWorkVolumeSnapshot","requestBody":{"$ref":"#/components/requestBodies/WorkVolumeName"},"responses":{"201":{"$ref":"#/components/responses/WorkVolume"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvolumes/{volume}/snapshots/{snapshot}/restore":{"parameters":[{"$ref":"#/components/parameters/WorkVolumeName"},{"$ref":"#/components/parameters/WorkSnapshotName"}],"post":{"x-smolny-scopes":["storage","destroy"],"operationId":"restoreMicroVMWorkVolumeSnapshot","description":"Atomically replaces the detached work volume data with a copy of the named snapshot.","responses":{"204":{"description":"Snapshot restored"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/ssh":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"operationId":"createMicroVMSandboxSshSession","x-smolny-scopes":["exec"],"description":"Authorize one SSH connection to this running guest generation. Connect with the same bearer credential and verify the returned guest host key.","requestBody":{"$ref":"#/components/requestBodies/SshPublicKey"},"responses":{"201":{"$ref":"#/components/responses/SshSession"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/ssh/{session}":{"parameters":[{"$ref":"#/components/parameters/MachineName"},{"$ref":"#/components/parameters/SshSessionId"}],"get":{"operationId":"openMicroVMSandboxSshSession","x-smolny-scopes":["exec"],"description":"Upgrade an empty HTTP/1.1 request to a native OpenSSH stream. A session can be used once. It expires after 30 minutes, 120 seconds without traffic or 64 MiB in either direction.","parameters":[{"name":"Connection","in":"header","required":true,"schema":{"type":"string","const":"Upgrade"}},{"name":"Upgrade","in":"header","required":true,"schema":{"type":"string","const":"smolny-ssh"}}],"responses":{"101":{"description":"Switched to the Smolny SSH tunnel"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"revokeMicroVMSandboxSshSession","x-smolny-scopes":["exec"],"description":"Revoke the SSH session and close its connection.","responses":{"204":{"description":"SSH session revoked"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/exec":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["exec"],"operationId":"executeMicroVMCommand","requestBody":{"$ref":"#/components/requestBodies/Exec"},"responses":{"200":{"description":"Guest command result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecResult"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/preview-links":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["preview"],"operationId":"createMicroVMPreviewLink","description":"Issue an expiring, revocable grant for one Ubuntu microVM boot and one guest loopback port. Preview mode serves bounded read-only GET. App mode accepts bounded JSON POST or a WebSocket upgrade on the preview origin. Explicit public visibility puts the capability in the URL. Private visibility returns an access_token for the Authorization header and a URL containing the grant ID only. Stop, deletion and revocation close active app WebSockets.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["port"],"properties":{"port":{"type":"integer","minimum":1,"maximum":65535},"path":{"type":"string","default":"/"},"ttl_seconds":{"type":"integer","minimum":1,"maximum":900,"default":300},"mode":{"type":"string","enum":["preview","app"],"default":"preview"},"visibility":{"type":"string","enum":["public","private"]}},"if":{"required":["mode"],"properties":{"mode":{"const":"app"}}},"then":{"required":["visibility"]},"else":{"properties":{"visibility":{"const":"public"}}}}}}},"responses":{"201":{"description":"Expiring preview or app grant. Store a private access_token separately from its URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewLinkResponse"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/preview-links/{link}":{"parameters":[{"$ref":"#/components/parameters/MachineName"},{"name":"link","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PreviewLinkId"}}],"delete":{"x-smolny-scopes":["preview"],"operationId":"revokeMicroVMPreviewLink","responses":{"204":{"description":"Browser link revoked"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/desktop":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["exec"],"operationId":"captureMicroVMDesktop","description":"Apply up to 32 desktop input events and return a fresh 800 \u00d7 600 JPEG from the same running desktop-enabled Ubuntu microVM. Use an empty array to capture without input. The body limit is 16 KiB.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicroVMDesktopEvents"}}}},"responses":{"200":{"description":"JPEG desktop frame","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/desktop-links":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["exec","preview"],"operationId":"createMicroVMDesktopLink","description":"Issue a temporary HTTPS browser link to the current boot of a desktop-enabled Ubuntu microVM. Desktop gives keyboard and mouse control. Desktop-view shares the screen. The link expires on schedule and cannot access a later VM with the same name.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"mode":{"enum":["desktop","desktop-view"],"default":"desktop"},"ttl_seconds":{"type":"integer","minimum":1,"maximum":900,"default":300}}}}}},"responses":{"201":{"description":"Expiring desktop link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewLinkResponse"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/desktop-links/{link}":{"parameters":[{"$ref":"#/components/parameters/MachineName"},{"name":"link","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PreviewLinkId"}}],"delete":{"x-smolny-scopes":["exec","preview"],"operationId":"revokeMicroVMDesktopLink","responses":{"204":{"description":"Desktop link revoked"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/files":{"parameters":[{"$ref":"#/components/parameters/MachineName"},{"$ref":"#/components/parameters/GuestFilePath"}],"get":{"x-smolny-scopes":["files:read"],"operationId":"downloadMicroVMFile","description":"Downloads up to 1048576 bytes.","responses":{"200":{"description":"Raw file contents","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}},"put":{"x-smolny-scopes":["files:write"],"operationId":"uploadMicroVMFile","description":"Uploads up to 1048576 bytes with Content-Length.","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"204":{"description":"File written"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines":{"get":{"x-smolny-scopes":["read"],"operationId":"listMachines","responses":{"200":{"description":"Machines in the authenticated project","content":{"application/json":{"schema":{"type":"object","required":["machines"],"properties":{"machines":{"type":"array","items":{"$ref":"#/components/schemas/Machine"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"x-smolny-scopes":["compute"],"x-smolny-conditional-scopes":{"command":["exec"]},"operationId":"createMachine","description":"Creates a VM using warm or cold allocation. An optional first command is validated before allocation and runs on the created VM. A 201 response confirms creation. A confirmed command exit, including a nonzero exit, returns command_result. If no command result can be confirmed, command_error describes the outcome and the VM remains available for inspection. With an Idempotency-Key, retry the same JSON in the same project for up to 24 hours after completion to retrieve the original 201 response without allocating a VM or running its command again. A retry can return idempotency_in_progress while the first request runs. If the provider cannot establish the original outcome after an interruption, the key stays reserved and a retry returns idempotency_outcome_unknown. Inspect the requested machine by name in that case.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Supply one key per create attempt. The key is scoped to the authenticated project. Each project can hold up to 32 keys.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._~-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MachineCreate"}}}},"responses":{"201":{"description":"Guest created with the outcome of the optional first command","headers":{"Server-Timing":{"$ref":"#/components/headers/VMReady"},"Idempotency-Replayed":{"description":"Present only when returning a stored create response.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MachineCreateResult"}}}},"400":{"description":"Invalid request, including invalid_idempotency_key for a malformed or repeated header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"description":"Create conflict. Idempotency errors include idempotency_conflict for different JSON, idempotency_in_progress for an active original request, idempotency_outcome_unknown for an unresolved original outcome, and idempotency_quota when a new key would exceed project or provider storage capacity. A project can retain up to 256 live keys, including at most 32 unresolved attempts. Byte limits can reduce capacity for large responses. Limits on new keys do not evict existing keys.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"$ref":"#/components/responses/Error"},"415":{"$ref":"#/components/responses/Error"},"503":{"description":"Provider busy or unavailable, including idempotency_store_unavailable when a keyed request cannot access the store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"get":{"x-smolny-scopes":["read"],"operationId":"getMachine","responses":{"200":{"$ref":"#/components/responses/Machine"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"x-smolny-scopes":["compute","destroy"],"operationId":"deleteMachine","responses":{"204":{"description":"Machine deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/exec":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["exec"],"operationId":"executeCommand","description":"Runs an argv command in the guest and wakes a VM automatically paused by idle policy. An explicit pause requires explicit resume. A guest exit code is part of the result.","requestBody":{"$ref":"#/components/requestBodies/Exec"},"responses":{"200":{"description":"Guest command result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecResult"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"415":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/jobs":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["exec"],"operationId":"startJob","description":"Starts a background argv command and returns without waiting for it to finish. Retry with the same machine, ID and command options to recover a submission after disconnecting. Changing command options for an existing ID returns job_conflict.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","argv"],"additionalProperties":false,"properties":{"id":{"$ref":"#/components/schemas/Name"},"argv":{"type":"array","minItems":1,"maxItems":128,"prefixItems":[{"type":"string","minLength":1}],"items":{"type":"string"},"description":"Nonempty executable followed by its arguments. The UTF-8 bytes across all arguments are limited to 32768. NUL characters are rejected."},"timeout":{"type":"integer","minimum":1,"maximum":86400,"default":3600,"description":"Guest command time limit in seconds."},"cwd":{"type":"string","pattern":"^/","description":"Absolute guest directory with no NUL, up to 4096 UTF-8 bytes."},"env":{"type":"object","maxProperties":64,"propertyNames":{"pattern":"^[A-Za-z_][A-Za-z0-9_]{0,127}$"},"additionalProperties":{"type":"string"},"description":"Process-only environment overrides up to 8192 UTF-8 bytes total."}}}}}},"responses":{"202":{"$ref":"#/components/responses/Job"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"415":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/jobs/{job}":{"parameters":[{"$ref":"#/components/parameters/MachineName"},{"$ref":"#/components/parameters/JobId"}],"get":{"x-smolny-scopes":["exec"],"operationId":"getJob","description":"Read the current job state. Poll to observe completion after reconnecting.","responses":{"200":{"$ref":"#/components/responses/Job"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"x-smolny-scopes":["exec"],"operationId":"cancelJob","description":"Request cancellation and return the resulting job state.","responses":{"200":{"$ref":"#/components/responses/Job"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/jobs/{job}/logs":{"parameters":[{"$ref":"#/components/parameters/MachineName"},{"$ref":"#/components/parameters/JobId"}],"get":{"x-smolny-scopes":["exec"],"operationId":"getJobLogs","description":"Read a snapshot of the retained output. Each stream is limited to 256 KiB.","responses":{"200":{"description":"Retained output","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobLogs"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/ssh":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"get":{"x-smolny-scopes":["exec"],"operationId":"openSshTunnel","description":"Upgrades an authenticated HTTP/1.1 connection to a bidirectional SSH byte stream to IPv4 loopback port 22 in the selected VM. The guest SSH server authenticates the user independently. Requests must have an empty body. Sessions are limited to 30 minutes, 120 seconds of inactivity, and 64 MiB in each direction.","parameters":[{"name":"Connection","in":"header","required":true,"schema":{"type":"string","const":"Upgrade"}},{"name":"Upgrade","in":"header","required":true,"schema":{"type":"string","const":"smolny-ssh"}}],"responses":{"101":{"description":"Switched to the Smolny SSH tunnel","headers":{"Connection":{"schema":{"type":"string","const":"Upgrade"}},"Upgrade":{"schema":{"type":"string","const":"smolny-ssh"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/preview":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["preview"],"operationId":"previewService","description":"Makes an HTTP GET request to the selected port on the guest's IPv4 loopback. Returns the guest response status and up to 256 KiB of body data. Guest redirects are returned without being followed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewRequest"}}}},"responses":{"200":{"description":"Guest HTTP response","content":{"application/json":{"schema":{"type":"object","required":["status","body_base64"],"properties":{"status":{"type":"integer","minimum":200,"maximum":599},"body_base64":{"type":"string","contentEncoding":"base64"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"502":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/preview-links":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["preview"],"x-smolny-conditional-scopes":{"mode=desktop or desktop-view":["exec"]},"operationId":"createPreviewLink","description":"Issues a bearer link to a fixed guest loopback HTTP port. Preview mode allows read-only browsing. Explicit app mode allows scoped JSON POST and WebSocket upgrades on the public preview origin, with a 64 KiB JSON request limit. Desktop and desktop-view require a desktop VM, port 6080, path /, and a temporary lifetime. Desktop mode returns an interactive HTTPS viewer. Desktop-view delivers 800 \u00d7 600 JPEG frames through a dedicated read-only endpoint. The default link is temporary. Opt in to lifetime=machine for a URL that survives API restarts and VM stop/start and is invalidated by revocation, deletion, or an in-place snapshot restore. Each project may have up to 64 active links, with up to 1024 across the service.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewLinkRequest"}}}},"responses":{"201":{"description":"Preview link issued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewLinkResponse"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/preview-links/{link}":{"parameters":[{"$ref":"#/components/parameters/MachineName"},{"name":"link","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PreviewLinkId"}}],"delete":{"x-smolny-scopes":["preview"],"operationId":"deletePreviewLink","description":"Revoke a previously issued temporary or machine-lifetime preview link scoped to this project and VM.","responses":{"204":{"description":"Preview link revoked"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/files":{"parameters":[{"$ref":"#/components/parameters/MachineName"},{"$ref":"#/components/parameters/GuestFilePath"}],"get":{"x-smolny-scopes":["files:read"],"operationId":"downloadFile","description":"Downloads up to 1048576 bytes. Wakes an automatically paused VM.","responses":{"200":{"description":"Raw file contents","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}},"put":{"x-smolny-scopes":["files:write"],"operationId":"uploadFile","description":"Uploads up to 1048576 bytes with Content-Length. Wakes an automatically paused VM.","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"204":{"description":"File written"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/pause":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["compute"],"operationId":"pauseMachine","description":"Explicitly freezes a VM. If already automatically frozen, switches it to explicit pause.","requestBody":{"$ref":"#/components/requestBodies/OptionalEmptyObject"},"responses":{"200":{"$ref":"#/components/responses/Machine"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/resume":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["compute"],"operationId":"resumeMachine","description":"Resumes a frozen VM and restarts its idle clock if enabled.","requestBody":{"$ref":"#/components/requestBodies/OptionalEmptyObject"},"responses":{"200":{"$ref":"#/components/responses/Machine"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/stop":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["compute"],"operationId":"stopMachine","description":"Gracefully shuts down a running Linux VM and retains its disk, snapshots, and project slot. An already stopped VM is returned unchanged. Frozen VMs require explicit resume before shutdown. Active jobs block shutdown with active_jobs. After a timed-out request, read the machine's state before retrying.","requestBody":{"$ref":"#/components/requestBodies/OptionalEmptyObject"},"responses":{"200":{"$ref":"#/components/responses/Machine","description":"VM is stopped"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/start":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["compute"],"operationId":"startMachine","description":"Boots a stopped Linux VM from its existing disk and waits for guest readiness. For an already running VM, waits for readiness without rebooting. Frozen VMs require explicit resume. After a timed-out request, read the machine's state before retrying.","requestBody":{"$ref":"#/components/requestBodies/OptionalEmptyObject"},"responses":{"200":{"$ref":"#/components/responses/Machine","description":"VM is running and the guest is ready"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/restart":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["compute"],"operationId":"restartMachine","description":"Gracefully shuts down a running Linux VM, then boots it from the same disk and waits for guest readiness. Active jobs block restart with active_jobs. Stopped VMs require start and frozen VMs require resume. If the operation fails after shutdown, the VM can remain stopped. After a timed-out request, read its state before retrying.","requestBody":{"$ref":"#/components/requestBodies/OptionalEmptyObject"},"responses":{"200":{"$ref":"#/components/responses/Machine","description":"VM is running on a fresh boot and the guest is ready"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/fork":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["compute","storage"],"operationId":"forkMachine","description":"Creates and starts a new machine from the source VM or a named snapshot.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"$ref":"#/components/schemas/Name"},"snapshot":{"$ref":"#/components/schemas/Name"}}}}}},"responses":{"201":{"$ref":"#/components/responses/Machine"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/snapshots":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"get":{"x-smolny-scopes":["read"],"operationId":"listSnapshots","responses":{"200":{"description":"Snapshots of this machine","content":{"application/json":{"schema":{"type":"object","required":["snapshots"],"properties":{"snapshots":{"type":"array","items":{"$ref":"#/components/schemas/Snapshot"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"x-smolny-scopes":["storage"],"operationId":"createSnapshot","requestBody":{"$ref":"#/components/requestBodies/Name"},"responses":{"201":{"description":"Snapshot created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Snapshot"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/snapshots/{snapshot}":{"parameters":[{"$ref":"#/components/parameters/MachineName"},{"$ref":"#/components/parameters/SnapshotName"}],"delete":{"x-smolny-scopes":["storage","destroy"],"operationId":"deleteSnapshot","responses":{"204":{"description":"Snapshot deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/snapshots/{snapshot}/restore":{"parameters":[{"$ref":"#/components/parameters/MachineName"},{"$ref":"#/components/parameters/SnapshotName"}],"post":{"x-smolny-scopes":["compute","storage"],"operationId":"restoreSnapshot","description":"Creates and starts a new machine from the snapshot using the supplied destination name.","requestBody":{"$ref":"#/components/requestBodies/Name"},"responses":{"201":{"$ref":"#/components/responses/Machine"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/snapshots/{snapshot}/restore-in-place":{"parameters":[{"$ref":"#/components/parameters/MachineName"},{"$ref":"#/components/parameters/SnapshotName"}],"post":{"x-smolny-scopes":["storage","destroy"],"operationId":"restoreSnapshotInPlace","summary":"Replace a machine's disk with one of its snapshots","description":"Stops the machine, discards disk changes made after the named disk snapshot, and starts the same machine with the restored disk. The machine name and project stay the same. RAM state is discarded. Active jobs, SSH tunnels, and frozen machines block the restore. Preview links and job IDs issued before the restore become invalid. If the restore fails after stopping, the machine can remain stopped. The restore-to-new endpoint keeps the original disk unchanged.","responses":{"200":{"$ref":"#/components/responses/Machine"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{name}/jobs":{"get":{"summary":"List retained jobs in this microVM boot","operationId":"listMicroVMBootJobs","parameters":[{"name":"name","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Name"}},{"name":"generation","in":"query","required":true,"schema":{"$ref":"#/components/schemas/BootGeneration"}}],"responses":{"200":{"description":"List retained jobs in this microVM boot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootJobIndex"}}}},"400":{"description":"Invalid generation, command or byte offset."},"404":{"description":"The project resource or job was not found."},"409":{"description":"The boot changed, is unavailable, or has reached a limit."}}},"post":{"summary":"Start a detached job in this microVM boot","operationId":"startMicroVMBootJob","parameters":[{"name":"name","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Name"}},{"name":"generation","in":"query","required":true,"schema":{"$ref":"#/components/schemas/BootGeneration"}}],"responses":{"202":{"description":"Start a detached job in this microVM boot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootJob"}}}},"400":{"description":"Invalid generation, command or byte offset."},"404":{"description":"The project resource or job was not found."},"409":{"description":"The boot changed, is unavailable, or has reached a limit."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootJobCreate"}}}}}},"/v1/microvms/{name}/jobs/{job_id}":{"get":{"summary":"Get a detached job result","operationId":"getMicroVMBootJob","parameters":[{"name":"name","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Name"}},{"name":"generation","in":"query","required":true,"schema":{"$ref":"#/components/schemas/BootGeneration"}},{"name":"job_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$"}}],"responses":{"200":{"description":"Get a detached job result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootJob"}}}},"400":{"description":"Invalid generation, command or byte offset."},"404":{"description":"The project resource or job was not found."},"409":{"description":"The boot changed, is unavailable, or has reached a limit."}}},"delete":{"summary":"Request cancellation of the job and its descendants","operationId":"cancelMicroVMBootJob","parameters":[{"name":"name","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Name"}},{"name":"generation","in":"query","required":true,"schema":{"$ref":"#/components/schemas/BootGeneration"}},{"name":"job_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$"}}],"responses":{"200":{"description":"Request cancellation of the job and its descendants","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootJob"}}}},"400":{"description":"Invalid generation, command or byte offset."},"404":{"description":"The project resource or job was not found."},"409":{"description":"The boot changed, is unavailable, or has reached a limit."}}}},"/v1/microvms/{name}/jobs/{job_id}/logs":{"get":{"summary":"Read separate retained output streams from byte offsets","operationId":"readMicroVMBootJob","parameters":[{"name":"name","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Name"}},{"name":"generation","in":"query","required":true,"schema":{"$ref":"#/components/schemas/BootGeneration"}},{"name":"job_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$"}},{"name":"stdout_offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":65536,"default":0}},{"name":"stderr_offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":65536,"default":0}}],"responses":{"200":{"description":"Read separate retained output streams from byte offsets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootJobLogs"}}}},"400":{"description":"Invalid generation, command or byte offset."},"404":{"description":"The project resource or job was not found."},"409":{"description":"The boot changed, is unavailable, or has reached a limit."}}}},"/v1/microvms/{machine}/pause":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["compute"],"operationId":"pauseMicroVM","description":"Pause a running Firecracker microVM, save its memory and disk snapshot, and release host RAM/CPU.","responses":{"200":{"description":"MicroVM paused and snapshot saved"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/resume":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["compute"],"operationId":"resumeMicroVM","description":"Resume a paused Firecracker microVM from its saved memory and disk snapshot.","responses":{"200":{"description":"MicroVM resumed"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/snapshot":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["storage"],"operationId":"snapshotMicroVM","description":"Create a Firecracker memory and disk snapshot of a running microVM.","responses":{"201":{"description":"Snapshot created"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/clone":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["compute"],"operationId":"cloneMicroVM","description":"Fork a new independent Firecracker microVM from a live microVM or saved snapshot.","responses":{"201":{"description":"Cloned microVM running"},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/microvms/{machine}/exec/stream":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["exec"],"operationId":"streamMicroVMCommand","description":"Execute a command inside a Firecracker microVM and stream stdout/stderr/exit events over Server-Sent Events.","requestBody":{"$ref":"#/components/requestBodies/Exec"},"responses":{"200":{"description":"SSE stream of stdout, stderr, and exit events","content":{"text/event-stream":{"schema":{"type":"string"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/machines/{machine}/exec/stream":{"parameters":[{"$ref":"#/components/parameters/MachineName"}],"post":{"x-smolny-scopes":["exec"],"operationId":"streamMachineCommand","description":"Execute a command inside an Incus VM and stream stdout/stderr/exit events over Server-Sent Events.","requestBody":{"$ref":"#/components/requestBodies/Exec"},"responses":{"200":{"description":"SSE stream of stdout, stderr, and exit events","content":{"text/event-stream":{"schema":{"type":"string"}}}},"default":{"$ref":"#/components/responses/Error"}}}}},"components":{"headers":{"VMReady":{"description":"Durations in milliseconds. vm-ready measures API processing through guest readiness. When a first command is requested, guest-command measures the guest operation through its result or error, and create-to-command measures total API processing.","schema":{"type":"string"},"example":"vm-ready;dur=34.280, guest-command;dur=5.340, create-to-command;dur=41.027"},"MicroVMCreateTiming":{"description":"Durations in milliseconds. Without a first command, vm-ready measures API processing through guest readiness. With a first command, microvm-alloc measures broker allocation through readiness, guest-command measures the guest exchange through the command result, and create-to-command measures API processing through receipt of that result.","schema":{"type":"string"},"example":"microvm-alloc;dur=34.280, guest-command;dur=5.340, create-to-command;dur=41.027"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Project bearer credential. Use a scoped sak_ agent key for an integration, or an sma_ customer credential on the trusted api.smolny.tech origin to manage your credentials."}},"parameters":{"SshSessionId":{"name":"session","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}$"}},"WorkspaceId":{"name":"workspace","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Name"}},"WorkVolumeName":{"in":"path","name":"volume","required":true,"schema":{"$ref":"#/components/schemas/Name"}},"WorkSnapshotName":{"in":"path","name":"snapshot","required":true,"schema":{"$ref":"#/components/schemas/Name"}},"MachineName":{"name":"machine","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Name"}},"SnapshotName":{"name":"snapshot","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Name"}},"JobId":{"name":"job","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Name"}},"GuestFilePath":{"name":"path","in":"query","required":true,"description":"Absolute guest file path with no empty, dot, or dot-dot segments or control characters.","schema":{"type":"string","minLength":2,"maxLength":4096,"pattern":"^/"}}},"requestBodies":{"InvitationProof":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["invitation","recovery_secret"],"additionalProperties":false,"properties":{"invitation":{"type":"string","format":"password","pattern":"^smi_[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"},"recovery_secret":{"type":"string","format":"password","pattern":"^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"}}}}}},"RegistrationProof":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["invitation","recovery_secret"],"additionalProperties":false,"properties":{"invitation":{"type":"string","format":"password","pattern":"^smr_[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"},"recovery_secret":{"type":"string","format":"password","pattern":"^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"}}}}}},"WorkVolumeName":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"$ref":"#/components/schemas/Name"}}}}}},"Name":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"$ref":"#/components/schemas/Name"}}}}}},"Exec":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecCommand"}}}},"SshPublicKey":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["public_key"],"additionalProperties":false,"properties":{"public_key":{"type":"string","pattern":"^ssh-ed25519 [A-Za-z0-9+/]{68}$"}}}}}},"OptionalEmptyObject":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}}},"responses":{"CustomerRegistration":{"description":"Customer sign-in credential. Store it privately.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ProjectAccess"},{"type":"object","required":["credential"],"properties":{"credential":{"type":"string","format":"password","pattern":"^sma_[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"}}}]}}}},"IssuedProjectKey":{"description":"The token is returned only when created or rotated.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ProjectKey"},{"type":"object","required":["token"],"properties":{"token":{"type":"string","format":"password","pattern":"^(smk|sak)_[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"}}}]}}}},"SshSession":{"description":"One SSH connection to the current guest generation","content":{"application/json":{"schema":{"type":"object","required":["id","user","host_key","connect_within_seconds"],"properties":{"id":{"type":"string","pattern":"^[0-9a-f]{32}$"},"user":{"const":"smolny-ssh"},"host_key":{"type":"string","pattern":"^ssh-ed25519 [A-Za-z0-9+/]{68}$"},"connect_within_seconds":{"const":30}}}}}},"Workspace":{"description":"Registered workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"Machine":{"description":"Machine state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Machine"}}}},"WorkVolume":{"description":"New detached work volume","content":{"application/json":{"schema":{"type":"object","required":["name","size_gib"],"properties":{"name":{"$ref":"#/components/schemas/Name"},"size_gib":{"type":"integer"}}}}}},"MicroVMImage":{"description":"Fast image status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicroVMImage"}}}},"MicroVM":{"description":"MicroVM state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicroVM"}}}},"Job":{"description":"Background job state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"Unauthorized":{"description":"A valid project bearer token is required","headers":{"WWW-Authenticate":{"schema":{"type":"string","const":"Bearer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error":{"description":"Request or worker error. HTTP 409 covers state conflicts, quotas, and overlapping lifecycle operations. HTTP 503 can indicate request capacity or worker availability. JSON request bodies are limited to 65536 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"PilotInvitationReceipt":{"type":"object","required":["project","profile","credential","quickstart","limits"],"properties":{"project":{"$ref":"#/components/schemas/Name"},"profile":{"enum":["small","builder"]},"credential":{"allOf":[{"$ref":"#/components/schemas/ProjectKey"},{"type":"object","required":["token"],"properties":{"token":{"type":"string","format":"password","pattern":"^smk_[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"}}}]},"quickstart":{"enum":["/docs#pilot-workspace","/docs#pilot-builder"]},"limits":{"type":"object","required":["max_incus_machines","max_cpu_per_vm","max_memory_mib_per_vm","fast","images","work_volume_size_gib","work_volume_mount"],"properties":{"max_incus_machines":{"type":"integer","minimum":1},"max_cpu_per_vm":{"type":"integer","minimum":1,"description":"Maximum Fast VM vCPU shape."},"max_memory_mib_per_vm":{"type":"integer","minimum":512,"description":"Maximum Fast VM memory shape."},"images":{"anyOf":[{"type":"null"},{"$ref":"#/components/schemas/PilotFastImages"}]},"fast":{"type":"object","required":["machines","volume_disks","volume_gib"],"properties":{"machines":{"type":"integer"},"volume_disks":{"type":"integer"},"volume_gib":{"type":"integer"}}},"work_volume_size_gib":{"const":20},"work_volume_mount":{"const":"/work"}}}}},"ProjectStorageInventory":{"type":"object","required":["volumes","snapshots","coverage","observed_through_ms"],"properties":{"volumes":{"type":"array","items":{"type":"object","required":["name","size_bytes","workspace","attached"],"properties":{"name":{"$ref":"#/components/schemas/Name"},"size_bytes":{"type":"integer","minimum":0},"workspace":{"oneOf":[{"$ref":"#/components/schemas/Name"},{"type":"null"}]},"attached":{"type":["boolean","null"],"description":"Null when attachment state was not observed."}}}},"snapshots":{"type":"array","items":{"type":"object","required":["volume","name","size_bytes"],"properties":{"volume":{"$ref":"#/components/schemas/Name"},"name":{"$ref":"#/components/schemas/Name"},"size_bytes":{"type":"integer","minimum":0}}}},"coverage":{"enum":["current","partial","unavailable"]},"observed_through_ms":{"type":["integer","null"],"description":"Oldest observation of the included sources, in Unix milliseconds."}}},"ProjectPreview":{"type":"object","required":["id","machine","port","mode","expires_at","resource"],"properties":{"id":{"type":"string","pattern":"^[0-9a-f]{32}$"},"machine":{"$ref":"#/components/schemas/Name"},"port":{"type":"integer","minimum":1,"maximum":65535},"mode":{"enum":["app","preview","desktop","desktop-view"]},"expires_at":{"type":["integer","null"],"description":"Unix seconds. Null indicates a machine-lifetime link."},"resource":{"enum":["machines","microvms","workspaces"]}}},"ProjectUsage":{"type":"object","required":["limits","observed","sources","sampling_interval_ms","maximum_accounted_interval_ms"],"properties":{"limits":{"type":"object","required":["incus","per_machine","fast"],"properties":{"incus":{"type":"object","required":["machine_slots","snapshots_per_machine"],"properties":{"machine_slots":{"type":"integer"},"snapshots_per_machine":{"type":"integer"}}},"per_machine":{"type":"object","required":["vcpu","memory_mib","disk_gib"],"properties":{"vcpu":{"type":"integer"},"memory_mib":{"type":"integer"},"disk_gib":{"type":"integer"}}},"pilot_profile":{"enum":["small","builder"]},"fast":{"type":["object","null"],"required":["machine_slots","per_node","project_storage","new_work_volume_gib","shapes"],"properties":{"machine_slots":{"type":"integer"},"per_node":{"type":"object","required":["machines","volume_disks","volume_gib"],"properties":{"machines":{"type":"integer"},"volume_disks":{"type":"integer"},"volume_gib":{"type":"integer"}}},"project_storage":{"anyOf":[{"type":"null"},{"$ref":"#/components/schemas/UsageStorageLimits"}]},"new_work_volume_gib":{"type":["array","null"],"minItems":2,"maxItems":2,"items":{"type":"integer"}},"images":{"anyOf":[{"type":"null"},{"$ref":"#/components/schemas/PilotFastImages"}]},"shapes":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","required":["vcpu","memory_mib"],"properties":{"vcpu":{"type":"integer"},"memory_mib":{"type":"integer"}}}}}}}}},"observed":{"$ref":"#/components/schemas/ObservedUsage"},"sources":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/UsageSource"}},"sampling_interval_ms":{"type":"integer"},"maximum_accounted_interval_ms":{"type":"integer"}}},"PilotFastImages":{"type":"object","required":["versions","prepared_gib","upload_bytes"],"properties":{"versions":{"type":"integer","minimum":1},"prepared_gib":{"type":"integer","minimum":1,"description":"Logical limit including prepared copies."},"upload_bytes":{"type":"integer","minimum":1}}},"UsageStorageLimits":{"type":"object","required":["volume_disks","volume_gib"],"properties":{"volume_disks":{"type":"integer"},"volume_gib":{"type":"integer"}}},"ObservedUsage":{"type":"object","properties":{"compute_ms":{"type":["integer","null"],"minimum":0},"vcpu_ms":{"type":["integer","null"],"minimum":0},"memory_byte_ms":{"type":["string","null"],"pattern":"^[0-9]+$"},"work_disk_byte_ms":{"type":["string","null"],"pattern":"^[0-9]+$"},"direct_outbound_ip_bytes":{"type":["integer","null"],"minimum":0},"proxy_outbound_payload_bytes":{"type":["integer","null"],"minimum":0}}},"UsageSource":{"type":"object","required":["status","coverage_start_ms","observed_through_ms","current","observed","gaps","outbound_coverage","broker_compute_coverage"],"properties":{"status":{"enum":["current","unavailable","retired"]},"coverage_start_ms":{"type":["integer","null"]},"observed_through_ms":{"type":["integer","null"]},"current":{"type":["object","null"],"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"object","required":["limit","used"],"properties":{"limit":{"type":["integer","null"]},"used":{"type":["integer","null"]}}}]}},"observed":{"$ref":"#/components/schemas/ObservedUsage"},"gaps":{"type":"object","additionalProperties":{"type":"object","required":["intervals","span_ms","last_end_ms"],"properties":{"intervals":{"type":"integer"},"span_ms":{"type":"integer"},"last_end_ms":{"type":"integer"}}}},"outbound_coverage":{"type":["object","null"],"additionalProperties":{"enum":["current","not_configured","unavailable"]}},"broker_compute_coverage":{"type":["object","null"],"required":["started_ms","interrupted_leases","storage_errors","status"],"properties":{"started_ms":{"type":"integer"},"interrupted_leases":{"type":"integer"},"storage_errors":{"type":"integer"},"status":{"enum":["current","unavailable"]}}}}},"Name":{"type":"string","pattern":"^[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$"},"GitCheckoutCreate":{"type":"object","required":["repository","username","token"],"additionalProperties":false,"properties":{"repository":{"type":"string","format":"uri","maxLength":2048,"description":"Exact HTTPS Git path on a public DNS name, optional port 443. Use the canonical URL with no userinfo, query, fragment, percent encoding, or trailing slash."},"username":{"type":"string","minLength":1,"maxLength":512,"description":"Basic authentication user, printable ASCII without spaces or colon."},"token":{"type":"string","minLength":1,"maxLength":512,"writeOnly":true,"description":"Repository read token, printable ASCII without spaces."},"ttl_seconds":{"type":"integer","minimum":1,"maximum":900,"default":300}}},"GitCheckout":{"type":"object","required":["id","url","handle","ttl_seconds"],"additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[0-9a-f]{32}$"},"url":{"type":"string","format":"uri","description":"Git remote URL reachable from the bound workspace boot."},"handle":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$","description":"Boot-bound capability returned once. Send in X-Smolny-Checkout."},"ttl_seconds":{"type":"integer","minimum":1,"maximum":900}}},"WorkspaceCreate":{"type":"object","required":["volume"],"additionalProperties":false,"properties":{"volume":{"$ref":"#/components/schemas/Name"},"cpu":{"type":"integer","enum":[1,4],"default":1},"memory_mib":{"type":"integer","enum":[1024,8192],"default":1024},"network":{"type":"boolean","default":false},"image_digest":{"$ref":"#/components/schemas/ImageDigest"}}},"Workspace":{"type":"object","required":["id","volume","status","cpu","memory_mib","network"],"properties":{"id":{"$ref":"#/components/schemas/Name"},"volume":{"$ref":"#/components/schemas/Name"},"status":{"type":"string","enum":["parked","starting","running","parking","recovering","unavailable"]},"cpu":{"type":"integer","enum":[1,4]},"memory_mib":{"type":"integer","enum":[1024,8192]},"network":{"type":"boolean"},"image_digest":{"$ref":"#/components/schemas/ImageDigest"},"machine":{"$ref":"#/components/schemas/MicroVM"}}},"WorkspaceWebhookEvent":{"enum":["workspace.created","workspace.started","workspace.parked","workspace.deleted"]},"WebhookSubscriptions":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceWebhookEvent"},"minItems":1,"maxItems":4,"uniqueItems":true},"WebhookEndpoint":{"type":"object","required":["id","url","events","created_at","revoked_at"],"properties":{"id":{"type":"string","pattern":"^wh_[a-f0-9]{32}$"},"url":{"type":"string","format":"uri"},"events":{"$ref":"#/components/schemas/WebhookSubscriptions"},"created_at":{"type":"integer","minimum":0},"revoked_at":{"type":["integer","null"],"minimum":0}}},"IssuedWebhook":{"allOf":[{"$ref":"#/components/schemas/WebhookEndpoint"},{"type":"object","required":["secret"],"properties":{"secret":{"type":"string","pattern":"^whsec_[A-Za-z0-9+/]{43}=$","description":"Save the signing secret now. It is returned only by creation and rotation."}}}]},"WebhookDelivery":{"type":"object","required":["id","event_id","event_type","created_at","next_attempt_at","replays","state","attempts"],"properties":{"id":{"type":"string","pattern":"^wd_[a-f0-9]{32}$"},"event_id":{"type":"string","pattern":"^evt_[a-f0-9]{32}$"},"event_type":{"oneOf":[{"$ref":"#/components/schemas/WorkspaceWebhookEvent"},{"const":"webhook.test"}]},"created_at":{"type":"integer","minimum":0},"next_attempt_at":{"type":["integer","null"],"minimum":0},"replays":{"type":"integer","minimum":0,"maximum":3},"state":{"enum":["queued","delivering","delivered","failed","revoked"]},"attempts":{"type":"array","items":{"$ref":"#/components/schemas/WebhookAttempt"},"maxItems":8}}},"WebhookAttempt":{"type":"object","required":["attempt","started_at","finished_at","http_status","outcome"],"properties":{"attempt":{"type":"integer","minimum":1,"maximum":8},"started_at":{"type":"integer","minimum":0},"finished_at":{"type":["integer","null"],"minimum":0},"http_status":{"type":["integer","null"],"minimum":100,"maximum":599},"outcome":{"enum":["sending","delivered","http_error","redirect","target_denied","tls_error","network_error","timeout","egress_unavailable","interrupted"]}}},"KeyScopes":{"type":"array","minItems":1,"maxItems":10,"uniqueItems":true,"items":{"enum":["read","compute","exec","files:read","files:write","preview","storage","destroy","webhooks:read","webhooks:write"]}},"ProjectAccess":{"type":"object","required":["project","role","scopes","expires_at","invitation_pilot"],"properties":{"project":{"$ref":"#/components/schemas/Name"},"role":{"enum":["owner","customer","delegate","agent"]},"scopes":{"oneOf":[{"$ref":"#/components/schemas/KeyScopes"},{"type":"null"}]},"expires_at":{"type":["integer","null"],"description":"Unix time in seconds or null for an account or owner bearer."},"invitation_pilot":{"type":"boolean"}}},"ProjectKeyId":{"type":"string","pattern":"^[0-9a-f]{32}$"},"ProjectKey":{"type":"object","required":["id","name","created_at","expires_at"],"properties":{"id":{"$ref":"#/components/schemas/ProjectKeyId"},"name":{"$ref":"#/components/schemas/Name"},"scopes":{"$ref":"#/components/schemas/KeyScopes"},"created_at":{"type":"integer","description":"Unix timestamp in seconds."},"expires_at":{"type":"integer","description":"Unix timestamp in seconds."}}},"CustomImage":{"type":"object","required":["id","template","fingerprint","sha256","size_bytes"],"properties":{"id":{"type":"string"},"template":{"$ref":"#/components/schemas/Name"},"fingerprint":{"type":"string","pattern":"^[0-9a-f]{64}$"},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"size_bytes":{"type":"integer","minimum":512,"maximum":10737418240}}},"Template":{"type":"object","required":["id","description"],"properties":{"id":{"type":"string","pattern":"^(ubuntu|dev|browser|desktop|custom-[a-z]([a-z0-9-]{0,54}[a-z0-9])?)$"},"description":{"type":"string"},"warm":{"type":"object","required":["ready","target"],"properties":{"ready":{"type":"integer","minimum":0,"description":"Unclaimed ready reserves currently visible to this project."},"target":{"type":"integer","minimum":0,"description":"Configured reserve count, subject to project quota and host resources."}}}}},"MachineCreate":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"$ref":"#/components/schemas/Name"},"template":{"type":"string","pattern":"^(ubuntu|dev|browser|desktop|custom-[a-z]([a-z0-9-]{0,54}[a-z0-9])?)$","default":"ubuntu","description":"Select a template advertised by this project's GET /v1/templates response."},"cpu":{"type":"integer","minimum":1,"maximum":16,"default":1,"description":"Maximum may be lower under project configuration."},"memory_mib":{"type":"integer","minimum":512,"maximum":65536,"description":"Defaults to 1024 MiB or the configured project maximum, whichever is lower."},"disk_gib":{"type":"integer","minimum":5,"maximum":1000,"description":"Defaults to 10 GiB or the configured project maximum, whichever is lower."},"idle_timeout_seconds":{"type":["integer","null"],"minimum":10,"maximum":86400,"default":null,"description":"Idle auto-pause threshold in seconds. Omit or use null to disable."},"allocation":{"type":"string","enum":["auto","warm","cold"],"default":"auto","description":"Auto uses a compatible warm VM when available. Warm requires one and returns warm_unavailable with HTTP 409 otherwise. Cold provisions a new VM."},"command":{"$ref":"#/components/schemas/ExecCommand"}}},"MachineCreateResult":{"allOf":[{"$ref":"#/components/schemas/Machine"},{"type":"object","required":["allocation"],"properties":{"command_result":{"$ref":"#/components/schemas/ExecResult","description":"Confirmed result of the requested first command, including nonzero exit codes."},"command_error":{"type":"object","required":["code","message","outcome"],"description":"The created VM remains available. Guest command side effects may have occurred.","properties":{"code":{"type":"string"},"message":{"type":"string"},"outcome":{"type":"string","enum":["timeout","unconfirmed"]}}}},"not":{"required":["command_result","command_error"]}}]},"Machine":{"type":"object","required":["id","name","status","template"],"dependentRequired":{"idle_timeout_seconds":["auto_paused"],"auto_paused":["idle_timeout_seconds"]},"properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","description":"Lowercase Incus state, such as running, frozen, or stopped."},"template":{"type":"string"},"idle_timeout_seconds":{"type":"integer","minimum":1,"description":"Present on machines with idle policy metadata."},"auto_paused":{"type":"boolean","description":"Persistent automatic pause marker. Present on machines with idle policy metadata."},"allocation":{"type":"string","enum":["warm","cold"],"description":"Allocation method on the machine creation response."}}},"ImageDigest":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"MicroVMImage":{"type":"object","required":["digest","format","size_bytes","status","compatible"],"properties":{"digest":{"$ref":"#/components/schemas/ImageDigest"},"format":{"type":"string","enum":["oci","ext4"]},"size_bytes":{"type":"integer","minimum":1},"status":{"type":"string","enum":["uploading","building","probing","staging","ready","incompatible","failed"]},"compatible":{"type":["boolean","null"]},"reason":{"type":"string"},"message":{"type":"string"},"manifest_digest":{"anyOf":[{"$ref":"#/components/schemas/ImageDigest"},{"type":"null"}]},"prepared_digest":{"$ref":"#/components/schemas/ImageDigest","description":"SHA-256 of the active prepared ext4 disk before boot."},"agent_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256 of the guest agent embedded at preparation time. Earlier ready records can omit it."},"disk_bytes":{"type":"integer"},"preparation_ms":{"type":"number"},"reprepare":{"type":"object","required":["status","from_prepared_digest"],"description":"Progress and outcome of the most recent explicit repreparation. A failure leaves the current ready revision available.","properties":{"status":{"type":"string","enum":["uploading","building","probing","staging","ready","incompatible","failed"]},"from_prepared_digest":{"$ref":"#/components/schemas/ImageDigest"},"compatible":{"type":["boolean","null"]},"reason":{"type":"string"},"message":{"type":"string"},"preparation_ms":{"type":"number"}}}}},"MicroVM":{"type":"object","required":["id","name","status","template"],"properties":{"id":{"type":"string"},"name":{"$ref":"#/components/schemas/Name"},"status":{"type":"string","enum":["running","unavailable"]},"generation":{"$ref":"#/components/schemas/BootGeneration"},"jobs_supported":{"type":"boolean","description":"The guest agent can run detached jobs in this boot."},"exec_options_supported":{"type":"boolean","description":"The guest agent supports cwd and env for exec."},"node":{"$ref":"#/components/schemas/Name","description":"Placement node for a clustered microVM."},"template":{"type":"string","enum":["microvm","ubuntu-microvm"]},"boot_method":{"type":"string","const":"fresh_kernel"},"network":{"type":"boolean","description":"The project egress profile is configured before the first command when true."},"https_proxy":{"type":"string","format":"uri","description":"Guest-local CONNECT endpoint for the project proxy profile. Present only for proxy-enabled leases."},"volume":{"$ref":"#/components/schemas/Name"},"workdir":{"type":"string","const":"/work"},"image_digest":{"$ref":"#/components/schemas/ImageDigest"},"desktop":{"type":"boolean","description":"An interactive guest X11 desktop is ready when true."},"cpu":{"type":"integer"},"memory_mib":{"type":"integer"},"disk_gib":{"type":"number"},"allocation":{"type":"string","enum":["snapshot","cold"],"description":"The Ubuntu profile boots a fresh kernel. The minimal BusyBox template restores a prepared snapshot."}}},"MicroVMCreate":{"type":"object","required":["name"],"additionalProperties":false,"allOf":[{"if":{"required":["image_digest"]},"then":{"properties":{"template":{"const":"ubuntu-microvm"},"desktop":{"const":false}}}},{"if":{"required":["network"],"properties":{"network":{"const":true}}},"then":{"anyOf":[{"required":["template"]},{"required":["image_digest"]}],"properties":{"template":{"const":"ubuntu-microvm"},"desktop":{"const":false}}}},{"if":{"required":["volume"]},"then":{"anyOf":[{"required":["template"]},{"required":["image_digest"]}],"properties":{"template":{"const":"ubuntu-microvm"}}}},{"if":{"required":["include_frame"]},"then":{"required":["desktop"],"properties":{"desktop":{"const":true}}}},{"if":{"required":["desktop"],"properties":{"desktop":{"const":true}}},"then":{"required":["template"],"properties":{"template":{"const":"ubuntu-microvm"}}}}],"properties":{"name":{"$ref":"#/components/schemas/Name"},"template":{"type":"string","enum":["microvm","ubuntu-microvm"],"description":"Defaults to microvm unless image_digest is present, which requires ubuntu-microvm."},"image_digest":{"$ref":"#/components/schemas/ImageDigest"},"cpu":{"type":"integer","enum":[1,4],"description":"Ubuntu shapes are 1 CPU/1024 MiB or 4 CPUs/8192 MiB, subject to project and host capacity."},"memory_mib":{"type":"integer","enum":[1024,8192]},"network":{"type":"boolean","default":false,"description":"Request configured project egress for ubuntu-microvm. The host must allow this project."},"desktop":{"type":"boolean","default":false,"description":"Boot the graphical Ubuntu image and wait for its first real X11 frame."},"include_frame":{"type":"boolean","description":"With desktop enabled, include the first JPEG in this create response. The frame is taken before the optional command."},"volume":{"$ref":"#/components/schemas/Name","description":"Project work volume attached at /work before the first command."},"command":{"$ref":"#/components/schemas/ExecCommand"}}},"MicroVMCreateResult":{"allOf":[{"$ref":"#/components/schemas/MicroVM"},{"type":"object","required":["allocation"],"properties":{"initial_frame":{"type":"object","required":["content_type","encoding","data"],"properties":{"content_type":{"const":"image/jpeg"},"encoding":{"const":"base64"},"data":{"type":"string","contentEncoding":"base64","contentMediaType":"image/jpeg","maxLength":65536}}},"command_result":{"$ref":"#/components/schemas/ExecResult","description":"Present only when the create request supplied a command."}}}]},"ExecCommand":{"type":"object","required":["argv"],"additionalProperties":false,"properties":{"argv":{"type":"array","minItems":1,"maxItems":128,"prefixItems":[{"type":"string","minLength":1}],"items":{"type":"string"},"description":"Nonempty executable followed by its arguments. The UTF-8 bytes across all arguments are limited to 32768. NUL characters are rejected."},"timeout":{"type":"integer","minimum":1,"maximum":120,"default":30,"description":"Guest command time limit in seconds."},"cwd":{"type":"string","pattern":"^/","description":"Absolute guest directory with no NUL, up to 4096 UTF-8 bytes."},"env":{"type":"object","maxProperties":64,"propertyNames":{"pattern":"^[A-Za-z_][A-Za-z0-9_]{0,127}$"},"additionalProperties":{"type":"string"},"description":"Process-only environment overrides up to 8192 UTF-8 bytes total."}}},"ExecResult":{"type":"object","required":["stdout","stderr","exit_code","truncated"],"properties":{"stdout":{"type":"string"},"stderr":{"type":"string"},"exit_code":{"type":"integer"},"truncated":{"type":"boolean"}}},"BootGeneration":{"type":"string","pattern":"^[0-9a-f]{20}$","description":"Opaque ID of the current Firecracker guest boot."},"BootJobCreate":{"type":"object","additionalProperties":false,"required":["id","argv"],"properties":{"id":{"type":"string","pattern":"^[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$"},"argv":{"type":"array","minItems":1,"maxItems":128,"prefixItems":[{"type":"string","minLength":1}],"items":{"type":"string"},"description":"Nonempty executable followed by its arguments. The UTF-8 bytes across all arguments are limited to 32768. NUL characters are rejected."},"cwd":{"type":"string","pattern":"^/","description":"Absolute guest directory with no NUL, up to 4096 UTF-8 bytes."},"env":{"type":"object","maxProperties":64,"propertyNames":{"pattern":"^[A-Za-z_][A-Za-z0-9_]{0,127}$"},"additionalProperties":{"type":"string"},"description":"Process-only environment overrides up to 8192 UTF-8 bytes total."},"timeout":{"type":"integer","minimum":1,"maximum":86400,"default":3600}}},"BootJob":{"allOf":[{"$ref":"#/components/schemas/Job"},{"type":"object","required":["generation","signal"],"properties":{"generation":{"$ref":"#/components/schemas/BootGeneration"},"signal":{"type":["integer","null"],"description":"Number of the signal that terminated the command, if applicable."}}}]},"BootJobIndex":{"type":"object","required":["generation","jobs"],"properties":{"generation":{"$ref":"#/components/schemas/BootGeneration"},"jobs":{"type":"array","maxItems":128,"items":{"$ref":"#/components/schemas/BootJob"}}}},"BootJobLogs":{"type":"object","required":["generation","encoding","stdout","stderr","stdout_offset","stderr_offset","truncated"],"properties":{"generation":{"$ref":"#/components/schemas/BootGeneration"},"encoding":{"const":"base64"},"stdout":{"type":"string","contentEncoding":"base64"},"stderr":{"type":"string","contentEncoding":"base64"},"stdout_offset":{"type":"integer","minimum":0,"maximum":65536,"description":"Next unread byte offset."},"stderr_offset":{"type":"integer","minimum":0,"maximum":65536,"description":"Next unread byte offset."},"truncated":{"type":"boolean"}}},"Job":{"type":"object","required":["id","status","exit_code","created_at","started_at","finished_at"],"properties":{"id":{"$ref":"#/components/schemas/Name"},"status":{"type":"string","enum":["queued","running","succeeded","failed","timed_out","cancelled","interrupted"]},"exit_code":{"type":["integer","null"]},"created_at":{"type":"integer","description":"Unix timestamp in seconds."},"started_at":{"type":["integer","null"],"description":"Unix timestamp in seconds."},"finished_at":{"type":["integer","null"],"description":"Unix timestamp in seconds."}}},"JobLogs":{"type":"object","required":["stdout","stderr","truncated"],"properties":{"stdout":{"type":"string"},"stderr":{"type":"string"},"truncated":{"type":"boolean"}}},"PreviewRequest":{"type":"object","required":["port"],"additionalProperties":false,"properties":{"port":{"$ref":"#/components/schemas/PreviewPort"},"path":{"$ref":"#/components/schemas/PreviewPath"}}},"MicroVMDesktopEvents":{"type":"object","required":["events"],"additionalProperties":false,"properties":{"events":{"type":"array","maxItems":32,"items":{"type":"object","required":["type"],"additionalProperties":false,"properties":{"type":{"enum":["move","down","up","scroll","key","text","release"]},"x":{"type":"integer","minimum":0,"maximum":799},"y":{"type":"integer","minimum":0,"maximum":599},"button":{"type":"integer","minimum":1,"maximum":5},"text":{"type":"string","minLength":1,"maxLength":1024},"key":{"type":"string"},"ctrl":{"type":"boolean"},"alt":{"type":"boolean"},"shift":{"type":"boolean"}}}}}},"PreviewLinkRequest":{"type":"object","required":["port"],"additionalProperties":false,"properties":{"port":{"$ref":"#/components/schemas/PreviewPort"},"path":{"$ref":"#/components/schemas/PreviewPath"},"ttl_seconds":{"type":"integer","minimum":1,"maximum":900,"description":"Temporary links only. Defaults to 300 seconds when omitted."},"mode":{"type":"string","enum":["preview","app","desktop","desktop-view"],"default":"preview"},"lifetime":{"type":"string","const":"machine","description":"Omit for a temporary link. Machine-lifetime links cannot specify ttl_seconds."}},"not":{"required":["lifetime","ttl_seconds"]},"if":{"required":["mode"],"properties":{"mode":{"enum":["desktop","desktop-view"]}}},"then":{"properties":{"port":{"const":6080},"path":{"const":"/"}},"not":{"required":["lifetime"]}}},"PreviewLinkResponse":{"type":"object","required":["id","url","expires_at"],"properties":{"id":{"$ref":"#/components/schemas/PreviewLinkId"},"url":{"type":"string","format":"uri"},"expires_at":{"type":["integer","null"],"description":"Unix timestamp in seconds for a temporary link or null for a machine-lifetime link."},"lifetime":{"type":"string","const":"machine"},"visibility":{"type":"string","enum":["public","private"],"description":"Returned for MicroVM app grants."},"access_token":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"Returned once for a private MicroVM app grant. Use as a bearer token on the issued URL."}},"if":{"required":["lifetime"]},"then":{"properties":{"expires_at":{"type":"null"}}},"else":{"properties":{"expires_at":{"type":"integer"}}}},"PreviewPort":{"type":"integer","minimum":1,"maximum":65535},"PreviewPath":{"type":"string","minLength":1,"maxLength":2048,"default":"/","description":"Absolute HTTP path with optional query and no authority or fragment. Use percent-encoding for characters outside the HTTP request-target character set."},"PreviewLinkId":{"type":"string","pattern":"^[0-9a-f]{32}$"},"Snapshot":{"type":"object","required":["name","created_at","stateful"],"properties":{"name":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"stateful":{"type":"boolean"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Machine-readable error code such as unauthorized, not_found, machine_quota, snapshot_quota, project_busy, machine_busy, or busy."},"message":{"type":"string"}}}}}}}}