curl --request POST \
--url https://api.sfcompute.com/preview/v2/instances \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"capacity": "<string>",
"image": "<string>",
"name": "my-resource-name",
"cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo=",
"tags": {
"env": "prod",
"team": "infra"
}
}
'{
"id": "<string>",
"resource_path": "<string>",
"owner": "<string>",
"workspace": "<string>",
"name": "<string>",
"object": "instance",
"status": "awaiting_allocation",
"capacity": "cap_k3R-nX9vLm7Qp2Yw5Jd8F",
"created_at": 1738972800,
"image": "image_k3R-nX9vLm7Qp2Yw5Jd8F",
"cloud_init_user_data_used": true,
"instance_sku": {
"id": "<string>",
"name": "<string>"
},
"deployment": "depl_k3R-nX9vLm7Qp2Yw5Jd8F",
"cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo=",
"tags": {
"env": "prod",
"team": "infra"
},
"expected_shutdown_at": 1738972800
}Create an instance.
curl --request POST \
--url https://api.sfcompute.com/preview/v2/instances \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"capacity": "<string>",
"image": "<string>",
"name": "my-resource-name",
"cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo=",
"tags": {
"env": "prod",
"team": "infra"
}
}
'{
"id": "<string>",
"resource_path": "<string>",
"owner": "<string>",
"workspace": "<string>",
"name": "<string>",
"object": "instance",
"status": "awaiting_allocation",
"capacity": "cap_k3R-nX9vLm7Qp2Yw5Jd8F",
"created_at": 1738972800,
"image": "image_k3R-nX9vLm7Qp2Yw5Jd8F",
"cloud_init_user_data_used": true,
"instance_sku": {
"id": "<string>",
"name": "<string>"
},
"deployment": "depl_k3R-nX9vLm7Qp2Yw5Jd8F",
"cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo=",
"tags": {
"env": "prod",
"team": "infra"
},
"expected_shutdown_at": 1738972800
}Documentation Index
Fetch the complete documentation index at: https://docs.sfcompute.com/llms.txt
Use this file to discover all available pages before exploring further.
Create an API token using sf tokens create or at https://sfcompute.com/account/api-keys.
A resource path like 'sfc:capacity:acme:prod:my-capacity' or an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
(cap_[0-9a-zA-Z_-]{1,21})|(sfc:capacity:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,3})"cap_k3R-nX9vLm7Qp2Yw5Jd8F"
A resource path like 'sfc:image:acme:prod:my-image' or an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
(image_[0-9a-zA-Z_-]{1,21})|(sfc:image:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,3})"image_k3R-nX9vLm7Qp2Yw5Jd8F"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
Base64-encoded cloud-init user data. Maximum 64KB.
"IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo="
Optional metadata tags for this instance.
Show child attributes
{ "env": "prod", "team": "infra" }Instance created.
inst_[0-9a-zA-Z_-]{1,21}"inst_k3R-nX9vLm7Qp2Yw5Jd8F"
A resource path for a instance resource. Format: sfc:instance:::.
sfc:instance:([a-zA-Z0-9._-]+:){2}[a-zA-Z0-9._-]+"sfc:instance:<account_id>:<workspace>:<name>"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
"instance"awaiting_allocation when waiting for compute allocation on its capacity, running once assigned and the physical machine is running (still takes time for the image to be downloaded and booted), terminated when stopped by the user or after running out of allocation, failed on hardware fault.
awaiting_allocation, running, terminated, failed Capacity this instance is utilizing.
cap_[0-9a-zA-Z_-]{1,21}"cap_k3R-nX9vLm7Qp2Yw5Jd8F"
Unix timestamp.
1738972800
Image this instance was launched from.
image_[0-9a-zA-Z_-]{1,21}"image_k3R-nX9vLm7Qp2Yw5Jd8F"
Whether cloud-init user data is configured for this instance.
Instance SKU this instance is running on. Only present when assigned to a physical machine. Carries the SKU's human-readable name when one is registered.
Show child attributes
Deployment managing this instance, if any.
depl_[0-9a-zA-Z_-]{1,21}"depl_k3R-nX9vLm7Qp2Yw5Jd8F"
Base64-encoded cloud-init user data.
"IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo="
Metadata tags attached to this instance.
Show child attributes
{ "env": "prod", "team": "infra" }Predicted Unix timestamp at which this node will be terminated because its capacity drops below the count of running nodes. null if no shutdown is scheduled in the predictable horizon — either the capacity covers this node indefinitely, or a future capacity increase blocks the prediction. Recomputed on every read.
1738972800