Create order
Place a buy or sell order. Orders fill on a single instance SKU matching the order’s requirements. By default orders fill completely or not at all; set allow_partial to permit a partial fill. Order filling is asynchronous; poll GET /v2/orders/{id} to check the order’s state.
Authorizations
Create an API token using sf tokens create or at https://sfcompute.com/account/api-keys.
Headers
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
Target pool that receives compute when filled.
(pool_[0-9a-zA-Z_-]{1,21})|(sfc:pool:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){2,2})"pool_k3R-nX9vLm7Qp2Yw5Jd8F"
sell, buy 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.
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 this order will fill on. Rejected at submission if the SKU id is not registered. Any id spelling is accepted.
sku_[0-9a-zA-Z_-]{1,21}"sku_k3R-nX9vLm7Qp2Yw5Jd8F"
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.
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.
^\d+\.\d+$"18.000000"
Response
Order created.
"order"ordr_[0-9a-zA-Z_-]{1,21}"ordr_k3R-nX9vLm7Qp2Yw5Jd8F"
Target pool that receives or loses compute if this order fills (depending on order type).
Workspace that owns the order's pool.
sell, buy 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 this order is pinned to. Carries the SKU's human-readable name when one is registered.
Change in capacity if the order fills. Must be a single time range with both start_at and end_at.
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.
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.
^\d+\.\d+$"18.000000"
Current state of the order.
pending, filled, partially_filled, rejected, cancelled, standing Unix timestamp.
1738972800
If true, the order may fill partially — fewer nodes and/or a subset of the requested time window.
Unix timestamp.
1738972800
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.
Unix timestamp.
1738972800