CLI & SDK Guide
Overview
Clore.ai provides a REST API that enables full programmatic access to the GPU marketplace — listing servers, creating orders, monitoring deployments, and canceling rentals.
Note: There is no official CLI binary at this time. All automation is done directly via the REST API using tools like
curl, Python, or Node.js.
Base URL: https://api.clore.ai/v1
Response format: JSON. Every response includes a code field indicating the status.
Authentication
Generate your API key from the Clore.ai Dashboard:
Log in to your account
Navigate to API section in settings
Generate and copy your API key
Header format:
auth: YOUR_API_KEY⚠️ Important: The auth header is
auth, notAuthorization: Bearer. Using the wrong format will return code3(Invalid API Token).
Example:
curl -H 'auth: YOUR_API_KEY' 'https://api.clore.ai/v1/marketplace'Quick Start
List Marketplace Servers
Browse all available GPU servers:
Response:
Get Your Orders
Include completed/expired orders:
Create an Order (On-Demand)
Response:
Create a Spot Order
Spot orders are cheaper but can be outbid. You set your price per day:
Rent for 48 Hours with Auto-Renewal
On a server whose maximum rental length (mrl) is shorter than 48 hours, the order renews at the end of each term at the host's price at that moment, as long as it is at or under your auto_renew_max_price per day, and ends when the 48 hours are used. Omit rental_hours to keep renewing until you cancel. Without auto_renew, hours above the server's mrl are refused with rental_hours_exceeds_mrl.
Response:
Check Order Status
Active orders include pub_cluster (hostnames) and tcp_ports for SSH access:
SSH into your rented server:
Change Auto-Renewal
Turn renewals on, change the price limit or change the total hours of a running on-demand order. Omitted fields keep their value, and "rental_hours": null removes the hours limit. This request keeps the order renewing until you cancel it:
Send { "order_id": 38, "auto_renew": false } to stop renewing; the order then ends with its current term. In the last 60 seconds of a term the request is refused with renewal_in_progress; retry once the order has renewed or ended. my_orders shows the result in auto_renew, auto_renew_max_price, rental_hours, rental_end and term_end.
Read the Renewal History
Response (newest first, one row per renewal decision, renewed or declined):
Cancel an Order
Optionally report an issue with the server:
Python SDK
A lightweight wrapper using the requests library. Install it with:
CloreClient Class
Full Working Example
Node.js Example
Using the native fetch API (Node.js 18+):
Common Workflows
Find Cheapest RTX 4090 and Rent It
Monitor My Orders
Auto-Rent When Price Drops Below X
WebSocket
The Clore.ai REST API does not currently expose a WebSocket endpoint. For real-time monitoring, use polling with a reasonable interval (see rate limits below).
Rate Limits
Most endpoints
1 request/second
create_order
1 request/5 seconds
set_spot_price (price reduction)
Once per 600 seconds
Rate limit response (code 5):
Best practices:
Add
time.sleep(1)between consecutive API callsFor
create_order, wait at least 5 seconds between requestsUse polling intervals of 60+ seconds for monitoring loops
Cache marketplace data locally if you need to query it frequently
Python helper:
Error Handling
Every API response includes a code field. A value of 0 means success.
Error Codes
0
Success
—
1
Database error
Retry after a delay
2
Invalid input data
Check your request body/parameters
3
Invalid API token
Verify your API key in the dashboard
4
Invalid endpoint
Check the endpoint URL
5
Rate limit exceeded (1 req/sec)
Add delays between requests
6
Application error (see error field)
Read the error field for details
Code 6 Sub-errors
error value
Meaning
exceeded_max_step
Spot price reduction too large; check max_step field
can_lower_every_600_seconds
Must wait before lowering spot price again; check time_to_lowering
Python Error Handling Example
JavaScript Error Handling Example
Available Docker Images
Clore.ai provides pre-built images optimized for GPU workloads:
cloreai/ubuntu20.04-jupyter
Ubuntu 20.04 + JupyterLab
cloreai/ubuntu22.04-jupyter
Ubuntu 22.04 + JupyterLab
You can also use any public Docker Hub image. For GPU access, use CUDA-enabled images, e.g.:
Port Forwarding
When creating an order, specify ports to expose:
"tcp"— Direct TCP port forwarding (for SSH, custom servers)"http"— HTTPS proxy (for Jupyter, web UIs). Only one HTTP port allowed perhttp_portfield.
After order creation, connection details appear in my_orders:
Connect via SSH:
Access Jupyter via browser: https://n1.c1.clorecloud.net (uses the http_port)
Last updated
Was this helpful?