Complete API reference for the official clore-ai Python SDK — the recommended way to interact with the Clore.ai GPU marketplace from Python and the command line.
Clore.ai API key. If omitted, reads CLORE_API_KEY env var or ~/.clore/config.json
base_url
str | None
https://api.clore.ai/v1
API base URL
timeout
float
30.0
Request timeout (seconds)
max_retries
int
3
Max retries on transient / rate-limit errors
Context manager support:
wallets()
Get all wallet balances for the authenticated account.
Returns:List[Wallet]
Raises:AuthError if no API key is set.
Example:
marketplace()
Browse available GPU servers. This is a public endpoint — no API key required.
Parameter
Type
Default
Description
gpu
str | None
None
Filter by GPU model substring (case-insensitive), e.g. "RTX 4090"
min_gpu_count
int | None
None
Minimum number of GPUs per server
min_ram_gb
float | None
None
Minimum RAM in GB
max_price_usd
float | None
None
Maximum price per hour in USD
available_only
bool
True
Only return servers not currently rented
Returns:List[MarketplaceServer]
Note: Filtering happens client-side. The API returns all servers; the SDK filters the results based on your criteria.
Example:
my_servers()
List servers you host on the Clore.ai marketplace.
Returns:List[MyServer]
Note:my_servers() returns MyServer objects, not MarketplaceServer. MyServer has a .status property that returns "Online", "Offline", "Disconnected", or "Not Working".
Raises:AuthError if no API key is set.
Example:
server_config()
Get the configuration for one of your hosted servers.
Parameter
Type
Description
server_name
str
Name of your server
Returns:ServerConfig
Example:
my_orders()
List your rental orders.
Parameter
Type
Default
Description
include_completed
bool
False
Also return completed/cancelled orders
Returns:List[Order]
Example:
create_order()
Create a new GPU rental order.
Parameter
Type
Description
server_id
int
Server ID from marketplace
image
str
Docker image, e.g. "cloreai/ubuntu22.04-cuda12"
type
"on-demand" | "spot"
Order type
currency
str
Payment currency: "bitcoin", "CLORE-Blockchain", etc.
ssh_password
str | None
SSH password for the instance
ssh_key
str | None
SSH public key (mutually exclusive with ssh_password)
from clore_ai import CloreAI
client = CloreAI(
api_key: str | None = None, # API key (falls back to env/config)
base_url: str | None = None, # Default: "https://api.clore.ai/v1"
timeout: float = 30.0, # HTTP timeout in seconds
max_retries: int = 3, # Retry attempts on rate-limit / network errors
)
with CloreAI(api_key="...") as client:
servers = client.marketplace()
# client.close() called automatically
wallets: List[Wallet] = client.wallets()
from clore_ai import CloreAI
client = CloreAI()
wallets = client.wallets()
for w in wallets:
print(f"{w.name}: {w.balance:.8f} (deposit: {w.deposit})")
market = client.spot_marketplace(server_id=6)
if market.offers:
for offer in market.offers:
print(f"Order {offer.order_id}: price={offer.price}")
if market.currency_rates_in_usd:
print(f"Currency rates: {market.currency_rates_in_usd}")
clore config set api_key YOUR_API_KEY
clore config get api_key
clore config show
clore search [OPTIONS]
Options:
--gpu TEXT Filter by GPU model (e.g. "RTX 4090")
--min-gpu INTEGER Minimum GPU count
--min-ram FLOAT Minimum RAM in GB
--max-price FLOAT Maximum price in USD/hour
--sort [price|gpu|ram] Sort results (default: price)
--limit INTEGER Limit results (default: 20)
clore deploy SERVER_ID [OPTIONS]
Options:
--image TEXT Docker image (required)
--type [on-demand|spot] Order type (required)
--currency TEXT Payment currency (required)
--ssh-password TEXT SSH password
--ssh-key TEXT SSH public key
--port TEXT Port mapping, repeatable (e.g. 22:tcp)
--env TEXT Environment variable, repeatable (KEY=VALUE)
--spot-price FLOAT Spot price (for spot orders)
clore ssh ORDER_ID [OPTIONS]
Options:
--user TEXT SSH user (default: root)