Skip to main content
POST
/
v2
/
orders
Create order
curl --request POST \
  --url https://api.sfcompute.com/v2/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "capacity": "<string>",
  "side": "sell",
  "delta": {
    "node_count": 2,
    "start_at": 1738972800,
    "end_at": 1738972800
  },
  "limit_price_dollars_per_node_hour": "<string>",
  "allow_standing": true
}
'
{
  "object": "order",
  "id": "<string>",
  "capacity": "cap_k3R-nX9vLm7Qp2Yw5Jd8F",
  "side": "sell",
  "allow_standing": true,
  "zones": [
    "richmond"
  ],
  "delta": {
    "node_count": 2,
    "start_at": 1738972800,
    "end_at": 1738972800,
    "type": "rectangle"
  },
  "limit_price_dollars_per_node_hour": "<string>",
  "status": "pending",
  "created_at": 1738972800,
  "filled_at": 1738972800,
  "filled_price_dollars_per_node_hour": "2.500000",
  "cancelled_at": 1738972800
}

Authorizations

Authorization
string
header
required

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

Headers

Idempotency-Key
string | null

Unique key to ensure idempotent order creation. If provided, duplicate requests with the same key will not place a new order and return the original order.

Body

application/json
capacity
string
required

Target capacity that receives compute when filled.

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

"cap_k3R-nX9vLm7Qp2Yw5Jd8F"

side
enum<string>
required
Available options:
sell,
buy
delta
object
required

The desired change in capacity. Will be added if side is buy, subtracted if side is sell if the order fills.

limit_price_dollars_per_node_hour
string
required

Must contain decimal point. Will be rounded to nearest multiple of $0.000060.

Pattern: ^\d+\.\d+$
Example:

"2.500000"

allow_standing
boolean

If true, the order stays in the order book until either fills, is explicitly cancelled, or the order end time is reached resulting in automatic cancellation. If false, the order is cancelled immediately if it doesn't fill.

Response

Order created.

object
string
default:order
required
read-only
Allowed value: "order"
id
string
required
Pattern: ordr_[0-9a-zA-Z_-]{1,21}
Example:

"ordr_k3R-nX9vLm7Qp2Yw5Jd8F"

capacity
required

Target capacity that receives or loses compute if this order fills (depending on order type).

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

"cap_k3R-nX9vLm7Qp2Yw5Jd8F"

side
enum<string>
required
Available options:
sell,
buy
allow_standing
boolean
required

If true, the order stays in the order book until either fills, is explicitly cancelled, or the order end time is reached resulting in automatic cancellation. If false, the order is cancelled immediately if it doesn't fill.

zones
string[]
required

Datacenter locations this order can fill in (derived from target capacity at order creation by default).

Minimum array length: 1
delta
object
required

The desired change in capacity. Will be added if side is buy, subtracted if side is sell if the order fills.

limit_price_dollars_per_node_hour
string
required

Price rate in dollars per node-hour.

Pattern: ^\d+\.\d+$
Example:

"2.500000"

status
enum<string>
required

The status of an order in the system. pending = not resolved/processed yet. filled = order executed. standing = the order is waiting for a match. cancelled = the order was cancelled either automatically (not a standing order and didn't immediately fill, or current time past end_at) or by explicit cancellation. rejected = validation/system error occurred.

Available options:
pending,
filled,
rejected,
cancelled,
standing
created_at
integer<int64>
required

Unix timestamp.

Example:

1738972800

filled_at
null | integer<int64>

Unix timestamp.

Example:

1738972800

filled_price_dollars_per_node_hour
null | string

Price rate in dollars per node-hour.

Pattern: ^\d+\.\d+$
Example:

"2.500000"

cancelled_at
null | integer<int64>

Unix timestamp.

Example:

1738972800