Skip to main content
POST
/
v0
/
orders
Create a new order
curl --request POST \
  --url https://api.sfcompute.com/v0/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "quantity": 123,
  "start_at": "<string>",
  "end_at": "<string>",
  "price": 123,
  "instance_type": "h100i",
  "flags": {
    "ioc": true,
    "post_only": true,
    "market": true,
    "prorate": true
  },
  "colocate_with": [
    "<string>"
  ],
  "cluster": "richmond"
}
'
{
  "object": "order",
  "status": "pending",
  "id": "order_xyz789",
  "idempotency_key": "key_123"
}

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

Optional key to ensure idempotent order creation

Body

application/json
side
enum<string>
required

Order side: "buy" or "sell"

Available options:
sell,
buy
quantity
integer<int32>
required
Example:

10

start_at
string
required

A date/time value that can be either "NOW" or an ISO 8601 datetime string

Examples:

"NOW"

"2025-07-11T20:41:37.423Z"

end_at
string
required

A date/time value that can be either "NOW" or an ISO 8601 datetime string

Examples:

"NOW"

"2025-07-11T20:41:37.423Z"

price
integer<int64>
required

Price in cents

Example:

1600

instance_type
null | string
Example:

"h100i"

flags
object

Configure more fine grained order behavior.

colocate_with
string[]

A contract to colocate with. This overrides the instance_type if specified.

Pattern: cont_[0-9a-zA-Z_-]{1,21}
cluster
null | string

Specify what cluster to land on. This overrides the instance_type if specified.

Example:

"richmond"

Response

Order created successfully

object
enum<string>
required
Available options:
order
Example:

"order"

status
enum<string>
required
Available options:
pending,
filled,
cancelled
id
string
required
Pattern: ordr_[0-9a-zA-Z_-]{1,21}
Example:

"ordr_k3R-nX9vLm7Qp2Yw5Jd8F"

idempotency_key
string | null
Example:

"key_123"