The Compute Clear API follows a discover → procure → use → destroy lifecycle.
1. Discover
Use the discovery endpoints to understand what’s available:
2. Get offers
Call POST /get_offers with your requirements:
compute:
gpu_type: H100
gpu_count: 1
max_price_per_gpu_hour: 5
contract_type: ondemand
region: EU
The API queries all vendors in real-time and returns matching offers sorted by price.
Offers expire after 30 minutes. Save the offer_id and procure promptly.
3. Procure
Call POST /procure_offer with the offer ID and your SSH key:
{
"offer_id": "abc-123",
"ssh_public_key": "ssh-ed25519 AAAA..."
}
Provisioning is asynchronous and typically takes 1-5 minutes depending on the vendor.
4. Poll until ready
Call GET /offers/{offer_id}/status every 15 seconds:
procurement_status: "provisioning_started"
→ "provisioning_in_progress"
→ "ready"
When ready, the instances array contains your external_ip and ssh_command.
5. Use
SSH into your instance using the private key that corresponds to the public key you provided during procurement:
ssh -i ~/.ssh/your_private_key root@INSTANCE_IP
The SSH user is root for all vendors.
6. Destroy
When done, list your resources and delete:
# Find the resource ID
curl "https://supply-api.compute-index.com/resources?offer_id=abc-123" \
-H "Authorization: Bearer $TOKEN"
# Delete it
curl -X DELETE "https://supply-api.compute-index.com/resources/RESOURCE_ID?force=true" \
-H "Authorization: Bearer $TOKEN"
Deletion is asynchronous — the resource transitions through deleting to deleted.
Lifecycle diagram
┌───────────┐ ┌───────────┐ ┌───────────────┐ ┌─────────┐
│ Discover │ ──▶ │ Get Offers │ ──▶ │ Procure Offer │ ──▶ │ Poll │
└───────────┘ └───────────┘ └───────────────┘ └────┬────┘
│
┌───────────┐ ┌───────────────┐ ┌────▼────┐
│ Destroy │ ◀── │ Use (SSH) │ ◀── │ Ready │
└───────────┘ └───────────────┘ └─────────┘