For the complete documentation index, see llms.txt. This page is also available as Markdown.

Clore API Client Reference

The CloreClient is the standard Python API client used throughout the Developer Cookbook. Every recipe that interacts with the Clore.ai API uses this class — keep one canonical copy in your project instead of duplicating it.


Installation

pip install requests

Optional extras — install these if you need SSH/SCP helpers or retry logic:

pip install paramiko scp tenacity

Quick Setup

Save the class below as clore_client.py in your project root, then import it wherever you need it:

from clore_client import CloreClient

client = CloreClient(api_key="your-api-key")

Your API key is available at clore.ai/profile. You can also load it from an environment variable:

import os
from clore_client import CloreClient

client = CloreClient(api_key=os.environ["CLORE_API_KEY"])

The CloreClient Class


API Endpoints Reference

Method
Endpoint
Description

GET

/v1/wallets

List all wallet balances

GET

/v1/marketplace

List all marketplace servers

GET

/v1/my_orders

List your orders

POST

/v1/create_order

Create a new rental order

POST

/v1/cancel_order

Cancel a single order

POST

/v1/cancel_orders

Cancel multiple orders

GET

/v1/spot_marketplace

Spot market data for a server

POST

/v1/set_spot_price

Update spot bid price

Authentication: All endpoints require the auth: <your-api-key> HTTP header. Rate limit: ~1 request/second. The client handles this automatically. Base URL: https://api.clore.ai


Error Codes

Code
Meaning

0

Success

1

Database error

2

Invalid input

3

Invalid or missing API key

4

Invalid endpoint

5

Rate limit exceeded

6

See error field in response


Examples

Check balance

Find and rent the cheapest RTX 4090

SSH into the server and run a command

Spot order


Migration to Official SDK

The official clore-ai SDK is now available. It provides:

  • Built-in rate limiting (1 req/sec) with exponential backoff

  • Automatic retries on transient and rate-limit errors

  • Type-safe responses with Pydantic models

  • Both sync and async clients

  • CLI tool for terminal usage

Before (custom client):

After (official SDK):

Full SDK Reference


See Also

Last updated

Was this helpful?