Skip to main content
POST
Create order

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
pool
string
required

Target pool that receives compute when filled.

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

"pool_k3R-nX9vLm7Qp2Yw5Jd8F"

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

If true, the order rests on the order book until it fills, is cancelled, or its end time passes. If false, the order is cancelled immediately if it does not fill.

allow_partial
boolean
required

If true, the order may fill partially — fewer nodes and/or a subset of the requested time window. The filled time may be disjoint.

sku
string
required

SKU this order will fill on. Rejected at submission if the SKU id is not registered. Any id spelling is accepted.

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

"sku_k3R-nX9vLm7Qp2Yw5Jd8F"

allocation_schedule_delta
object[]
required

Change in capacity if the order fills (added on buy, subtracted on sell). Must be a single time range: one node_count held constant from start_at to end_at, with both set. start_at and end_at are Unix timestamps in seconds. Each must be hour-aligned (a multiple of 3600), or any minute (a multiple of 60) up to the end of the next hour. start_at may be at most 5 minutes in the past. end_at must be after start_at (so the window is at least 1 minute), must be in the future, and may be at most 10 years ahead of now. node_count must be between 1 and 10000.

limit_price_dollars_per_node_hour
string
required

Price in dollars per node-hour, encoded as a decimal string. Prices are rounded to the nearest $0.000060/node-hour market tick. This is one microdollar per node-minute. Responses contain the rounded value with six decimal places. Inputs must contain a decimal point, be non-negative, and not exceed $500/node-hour.

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

"18.000000"

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"

pool
object
required

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

workspace
object
required

Workspace that owns the order's pool.

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.

sku
object
required

SKU this order is pinned to. Carries the SKU's human-readable name when one is registered.

allocation_schedule_delta
object[]
required

Change in capacity if the order fills. Must be a single time range with both start_at and end_at.

filled_allocation_schedule_delta
object[]
required

The total portion of the requested schedule that has filled. Once state is cancelled, this is final and remains available on later get and list responses. Empty for orders with no fills; the unfilled remainder is allocation_schedule_delta minus this.

limit_price_dollars_per_node_hour
string
required

Price in dollars per node-hour, encoded as a decimal string. Prices are rounded to the nearest $0.000060/node-hour market tick. This is one microdollar per node-minute. Responses contain the rounded value with six decimal places. Inputs must contain a decimal point, be non-negative, and not exceed $500/node-hour.

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

"18.000000"

state
enum<string>
required

Current state of the order.

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

Unix timestamp.

Example:

1738972800

allow_partial
boolean

If true, the order may fill partially — fewer nodes and/or a subset of the requested time window.

filled_at
null | integer<int64>

Unix timestamp.

Example:

1738972800

fills
object[]

Complete list of contracts produced by this order. Once state is cancelled, this list is final and remains available on later get and list responses. Omitted for orders with no fills.

cancelled_at
null | integer<int64>

Unix timestamp.

Example:

1738972800