Skip to main content
POST
/
preview
/
v2
/
capacities
Create capacity
curl --request POST \
  --url https://api.sfcompute.com/preview/v2/capacities \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "workspace": "<string>",
  "name": "my-resource-name",
  "tags": {
    "env": "prod",
    "team": "infra"
  }
}
'
{
  "id": "<string>",
  "resource_path": "<string>",
  "owner": "<string>",
  "workspace": "<string>",
  "workspace_id": "<string>",
  "name": "<string>",
  "object": "capacity",
  "allocation_schedule": {
    "total": [
      {
        "start_at": 1738972800,
        "node_count": 123,
        "end_at": 1738972800
      }
    ],
    "by_instance_sku": {}
  },
  "created_at": 1738972800,
  "procurements": [
    {
      "id": "<string>",
      "name": "<string>"
    }
  ],
  "deployments": [
    {
      "id": "<string>",
      "name": "<string>"
    }
  ],
  "tags": {
    "env": "prod",
    "team": "infra"
  }
}

Authorizations

Authorization
string
header
required

Create an API token using sf tokens create or at https://sfcompute.com/account/api-keys.

Body

application/json
workspace
string
required

Workspace to create this capacity in.

Pattern: (wksp_[0-9a-zA-Z_-]{1,21})|(sfc:workspace:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,1})
Example:

"wksp_k3R-nX9vLm7Qp2Yw5Jd8F"

name
null | string

Unique name for this capacity.

Required string length: 1 - 255
Pattern: [a-zA-Z0-9][a-zA-Z0-9._-]{0,254}
Example:

"my-resource-name"

tags
object

Optional metadata tags for this capacity.

Example:
{ "env": "prod", "team": "infra" }

Response

Capacity created.

id
string
required
Pattern: cap_[0-9a-zA-Z_-]{1,21}
Example:

"cap_k3R-nX9vLm7Qp2Yw5Jd8F"

resource_path
string
required

A resource path for a capacity resource. Format: sfc:capacity:::.

Pattern: sfc:capacity:([a-zA-Z0-9._-]+:){2}[a-zA-Z0-9._-]+
Example:

"sfc:capacity:<account_id>:<workspace>:<name>"

owner
string
required
Required string length: 1 - 255
Pattern: [a-zA-Z0-9][a-zA-Z0-9._-]{0,254}
Example:

"my-resource-name"

workspace
string
required
Required string length: 1 - 255
Pattern: [a-zA-Z0-9][a-zA-Z0-9._-]{0,254}
Example:

"my-resource-name"

workspace_id
string
required
Pattern: wksp_[0-9a-zA-Z_-]{1,21}
Example:

"wksp_k3R-nX9vLm7Qp2Yw5Jd8F"

name
string
required
Required string length: 1 - 255
Pattern: [a-zA-Z0-9][a-zA-Z0-9._-]{0,254}
Example:

"my-resource-name"

kind
enum<string>
required

Capacity kind determines what operations are allowed on a capacity.

  • Market: User-created capacities. - Originating: Provider capacities for selling compute. Cannot add compute (buy orders/procurements). - ReadOnly: System-managed capacities used for legacy compute, bare metal contracts, and other. Cannot be modified through the API.
Available options:
market,
originating,
read_only
object
string
default:capacity
required
read-only
Allowed value: "capacity"
allocation_schedule
object
required

Allocation schedule of this capacity. Add to the schedule by placing buy orders into this capacity.

created_at
integer<int64>
required

Unix timestamp.

Example:

1738972800

procurements
object[]

Active procurements targeting this capacity.

deployments
object[]

Active deployments targeting this capacity.

tags
object

Metadata tags attached to this capacity.

Example:
{ "env": "prod", "team": "infra" }