Skip to main content
POST
/
v2
/
capacities
Create capacity
curl --request POST \
  --url https://api.sfcompute.com/v2/capacities \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "workspace": "<string>",
  "zones": [
    "richmond"
  ],
  "name": "my-resource-name",
  "tags": {
    "env": "prod",
    "team": "infra"
  }
}
'
{
  "id": "<string>",
  "resource_path": "<string>",
  "owner": "<string>",
  "workspace": "<string>",
  "name": "<string>",
  "kind": "market",
  "object": "capacity",
  "zones": [
    "richmond"
  ],
  "allocation_schedule": {
    "total": [
      {
        "effective_at": 1738972800,
        "node_allocation": 123
      }
    ],
    "by_zone": {}
  },
  "created_at": 1738972800,
  "procurements": [
    "<string>"
  ],
  "deployments": [
    "<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,3})
Example:

"wksp_k3R-nX9vLm7Qp2Yw5Jd8F"

zones
string[]
required

Datacenter locations orders into this capacity can acquire compute from.

Minimum array length: 1
Example:
["richmond"]
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"

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"
zones
string[]
required

Datacenter locations orders into this capacity can acquire compute from.

Minimum array length: 1
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

Active procurements targeting this capacity. Returns IDs by default, or summaries when expand=procurements is set.

Pattern: proc_[0-9a-zA-Z_-]{1,21}
deployments

Active deployments targeting this capacity. Returns IDs by default, or summaries when expand=deployments is set.

Pattern: depl_[0-9a-zA-Z_-]{1,21}
tags
object

Metadata tags attached to this capacity.

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