curl --request POST \
--url https://api.sfcompute.com/preview/v2/order_preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requirements": {
"accelerator": [
"H100"
]
},
"start_at": 1738972800,
"duration_seconds": 1,
"node_count": 123,
"pool": "pool_k3R-nX9vLm7Qp2Yw5Jd8F"
}
'import requests
url = "https://api.sfcompute.com/preview/v2/order_preview"
payload = {
"requirements": { "accelerator": ["H100"] },
"start_at": 1738972800,
"duration_seconds": 1,
"node_count": 123,
"pool": "pool_k3R-nX9vLm7Qp2Yw5Jd8F"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requirements: {accelerator: ['H100']},
start_at: 1738972800,
duration_seconds: 1,
node_count: 123,
pool: 'pool_k3R-nX9vLm7Qp2Yw5Jd8F'
})
};
fetch('https://api.sfcompute.com/preview/v2/order_preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sfcompute.com/preview/v2/order_preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'requirements' => [
'accelerator' => [
'H100'
]
],
'start_at' => 1738972800,
'duration_seconds' => 1,
'node_count' => 123,
'pool' => 'pool_k3R-nX9vLm7Qp2Yw5Jd8F'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sfcompute.com/preview/v2/order_preview"
payload := strings.NewReader("{\n \"requirements\": {\n \"accelerator\": [\n \"H100\"\n ]\n },\n \"start_at\": 1738972800,\n \"duration_seconds\": 1,\n \"node_count\": 123,\n \"pool\": \"pool_k3R-nX9vLm7Qp2Yw5Jd8F\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sfcompute.com/preview/v2/order_preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"requirements\": {\n \"accelerator\": [\n \"H100\"\n ]\n },\n \"start_at\": 1738972800,\n \"duration_seconds\": 1,\n \"node_count\": 123,\n \"pool\": \"pool_k3R-nX9vLm7Qp2Yw5Jd8F\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sfcompute.com/preview/v2/order_preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"requirements\": {\n \"accelerator\": [\n \"H100\"\n ]\n },\n \"start_at\": 1738972800,\n \"duration_seconds\": 1,\n \"node_count\": 123,\n \"pool\": \"pool_k3R-nX9vLm7Qp2Yw5Jd8F\"\n}"
response = http.request(request)
puts response.read_body{
"post_order_body": {
"pool": "<string>",
"instance_sku": "isku_k3R-nX9vLm7Qp2Yw5Jd8F",
"allocation_schedule_delta": [
{
"start_at": 1738972800,
"node_count": 123,
"end_at": 1738972800
}
],
"limit_price_dollars_per_node_hour": "<string>",
"allow_standing": true,
"allow_partial": true
},
"fee": {
"flat_dollars_per_node_hour": "<string>",
"percentage_bps": 123
},
"type": "quoted",
"notices": [
{
"start_at": 1738972800,
"end_at": 1738972800,
"title": "<string>",
"description": "<string>",
"type": "maintenance_window",
"action_message": "<string>"
}
]
}{
"error": {
"type": "authentication_error",
"message": "<string>"
}
}{
"error": {
"type": "unprocessable_entity",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"type": "api_error",
"message": "<string>"
}
}Estimate an order
Estimate a buy or sell order before placing it.
curl --request POST \
--url https://api.sfcompute.com/preview/v2/order_preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requirements": {
"accelerator": [
"H100"
]
},
"start_at": 1738972800,
"duration_seconds": 1,
"node_count": 123,
"pool": "pool_k3R-nX9vLm7Qp2Yw5Jd8F"
}
'import requests
url = "https://api.sfcompute.com/preview/v2/order_preview"
payload = {
"requirements": { "accelerator": ["H100"] },
"start_at": 1738972800,
"duration_seconds": 1,
"node_count": 123,
"pool": "pool_k3R-nX9vLm7Qp2Yw5Jd8F"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requirements: {accelerator: ['H100']},
start_at: 1738972800,
duration_seconds: 1,
node_count: 123,
pool: 'pool_k3R-nX9vLm7Qp2Yw5Jd8F'
})
};
fetch('https://api.sfcompute.com/preview/v2/order_preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sfcompute.com/preview/v2/order_preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'requirements' => [
'accelerator' => [
'H100'
]
],
'start_at' => 1738972800,
'duration_seconds' => 1,
'node_count' => 123,
'pool' => 'pool_k3R-nX9vLm7Qp2Yw5Jd8F'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sfcompute.com/preview/v2/order_preview"
payload := strings.NewReader("{\n \"requirements\": {\n \"accelerator\": [\n \"H100\"\n ]\n },\n \"start_at\": 1738972800,\n \"duration_seconds\": 1,\n \"node_count\": 123,\n \"pool\": \"pool_k3R-nX9vLm7Qp2Yw5Jd8F\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sfcompute.com/preview/v2/order_preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"requirements\": {\n \"accelerator\": [\n \"H100\"\n ]\n },\n \"start_at\": 1738972800,\n \"duration_seconds\": 1,\n \"node_count\": 123,\n \"pool\": \"pool_k3R-nX9vLm7Qp2Yw5Jd8F\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sfcompute.com/preview/v2/order_preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"requirements\": {\n \"accelerator\": [\n \"H100\"\n ]\n },\n \"start_at\": 1738972800,\n \"duration_seconds\": 1,\n \"node_count\": 123,\n \"pool\": \"pool_k3R-nX9vLm7Qp2Yw5Jd8F\"\n}"
response = http.request(request)
puts response.read_body{
"post_order_body": {
"pool": "<string>",
"instance_sku": "isku_k3R-nX9vLm7Qp2Yw5Jd8F",
"allocation_schedule_delta": [
{
"start_at": 1738972800,
"node_count": 123,
"end_at": 1738972800
}
],
"limit_price_dollars_per_node_hour": "<string>",
"allow_standing": true,
"allow_partial": true
},
"fee": {
"flat_dollars_per_node_hour": "<string>",
"percentage_bps": 123
},
"type": "quoted",
"notices": [
{
"start_at": 1738972800,
"end_at": 1738972800,
"title": "<string>",
"description": "<string>",
"type": "maintenance_window",
"action_message": "<string>"
}
]
}{
"error": {
"type": "authentication_error",
"message": "<string>"
}
}{
"error": {
"type": "unprocessable_entity",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"type": "api_error",
"message": "<string>"
}
}Authorizations
Create an API token using sf tokens create or at https://sfcompute.com/account/api-keys.
Body
- Option 1
- Option 2
Key/value filters on instance SKU properties.
Valid keys and values are published at GET /v2/instance_sku_property_catalog.
Empty map = no constraints.
Show child attributes
Show child attributes
{ "accelerator": ["H100"] }Order start. Must align to a 60-second boundary.
1738972800
Order duration in seconds. Must be a positive multiple of 60.
x >= 0Number of nodes. Must be positive.
Pool that receives compute when the order fills. Omit to get an estimate without pinning to a pool. The response body then returns a placeholder you must replace before submitting to /v2/orders.
(pool_[0-9a-zA-Z_-]{1,21})|(sfc:pool:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){2,2})"pool_k3R-nX9vLm7Qp2Yw5Jd8F"
Response
Estimate result.
- Option 1
- Option 2
Ready-to-submit body for POST /v2/orders. Posting this body verbatim will fill at the estimated price.
Show child attributes
Show child attributes
Fee policy for the matched instance SKU.
Show child attributes
Show child attributes
"quoted"Maintenance windows for the matched instance SKU overlapping the order's delivery window.
Show child attributes
Show child attributes