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 Dashboardarrow-up-right:

  1. Log in to your account

  2. Navigate to API section in settings

  3. Generate and copy your API key

Header format:

auth: YOUR_API_KEY

⚠️ Important: The auth header is auth, not Authorization: Bearer. Using the wrong format will return code 3 (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:


Check Order Status

Active orders include pub_cluster (hostnames) and tcp_ports for SSH access:

SSH into your rented server:


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

Endpoint
Limit

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 calls

  • For create_order, wait at least 5 seconds between requests

  • Use 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

Code
Meaning
Action

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:

Image
Description

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 per http_port field.

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?