curl --request POST \
--url https://supply-api.compute-desk.com/procure_offer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"offer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ssh_public_key": "<string>",
"cloud_init": "<string>",
"cluster_name": "<string>"
}
'import requests
url = "https://supply-api.compute-desk.com/procure_offer"
payload = {
"offer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ssh_public_key": "<string>",
"cloud_init": "<string>",
"cluster_name": "<string>"
}
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({
offer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ssh_public_key: '<string>',
cloud_init: '<string>',
cluster_name: '<string>'
})
};
fetch('https://supply-api.compute-desk.com/procure_offer', 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://supply-api.compute-desk.com/procure_offer",
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([
'offer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ssh_public_key' => '<string>',
'cloud_init' => '<string>',
'cluster_name' => '<string>'
]),
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://supply-api.compute-desk.com/procure_offer"
payload := strings.NewReader("{\n \"offer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_public_key\": \"<string>\",\n \"cloud_init\": \"<string>\",\n \"cluster_name\": \"<string>\"\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://supply-api.compute-desk.com/procure_offer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"offer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_public_key\": \"<string>\",\n \"cloud_init\": \"<string>\",\n \"cluster_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://supply-api.compute-desk.com/procure_offer")
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 \"offer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_public_key\": \"<string>\",\n \"cloud_init\": \"<string>\",\n \"cluster_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"offer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"procured_at": "2023-11-07T05:31:56Z",
"resource_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Procure Offer
Procure a GPU offer.
Note: This is a long-running operation (vendor provisioning can take minutes)
curl --request POST \
--url https://supply-api.compute-desk.com/procure_offer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"offer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ssh_public_key": "<string>",
"cloud_init": "<string>",
"cluster_name": "<string>"
}
'import requests
url = "https://supply-api.compute-desk.com/procure_offer"
payload = {
"offer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ssh_public_key": "<string>",
"cloud_init": "<string>",
"cluster_name": "<string>"
}
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({
offer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ssh_public_key: '<string>',
cloud_init: '<string>',
cluster_name: '<string>'
})
};
fetch('https://supply-api.compute-desk.com/procure_offer', 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://supply-api.compute-desk.com/procure_offer",
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([
'offer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ssh_public_key' => '<string>',
'cloud_init' => '<string>',
'cluster_name' => '<string>'
]),
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://supply-api.compute-desk.com/procure_offer"
payload := strings.NewReader("{\n \"offer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_public_key\": \"<string>\",\n \"cloud_init\": \"<string>\",\n \"cluster_name\": \"<string>\"\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://supply-api.compute-desk.com/procure_offer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"offer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_public_key\": \"<string>\",\n \"cloud_init\": \"<string>\",\n \"cluster_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://supply-api.compute-desk.com/procure_offer")
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 \"offer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_public_key\": \"<string>\",\n \"cloud_init\": \"<string>\",\n \"cluster_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"offer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"procured_at": "2023-11-07T05:31:56Z",
"resource_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}410 Gone.Required fields
| Field | Description |
|---|---|
offer_id | UUID from a previous /get_offers response |
ssh_public_key | Your SSH public key for root access |
Optional fields
| Field | Description |
|---|---|
cloud_init | Startup script — #cloud-config YAML or #!/bin/bash shell script |
resource_name | Custom name for the resource |
Cloud-init support
Pass a cloud-init script to configure the instance on first boot:{
"offer_id": "uuid-here",
"ssh_public_key": "ssh-ed25519 AAAA...",
"cloud_init": "#cloud-config\npackages:\n - htop\n - jq\nruncmd:\n - echo 'Ready' > /tmp/ready.txt"
}
#cloud-config YAML and #!/bin/bash scripts are supported. See the Cloud-Init guide for details.
Asynchronous provisioning
Procurement is asynchronous. The response indicates provisioning has started — pollGET /offers/{offer_id}/status to track progress.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request to procure a specific offer.
SSH public key to add to provisioned instances for access
1Cloud-init script to run on instance boot. Must start with '#cloud-config' (YAML) or '#!/' (shell script). Max 64KB.
Name for the cluster (cluster offers only). Auto-generated if not provided.
Response
Successful Response
Procurement response - status determines the outcome.
The offer that was procured
Status: procured, failed, or provisioning_in_progress
Timestamp when the offer was procured (present when status=procured)
IDs of resources created or affected during procurement (present when status=procured)
Error message describing the failure (present when status=failed)