Introduction to Clore API
Last updated
Last updated
The Clore API provides developers with powerful tools to manage GPU resources, automate workflows, monitor server status, and handle financial transactions on the Clore platform. This API allows you to interact programmatically with the Clore Marketplace, enabling advanced control over rentals, pricing, server configurations, and more.
In this introductory article, we will cover:
Setting up access to the Clore API
Authentication process
Basic API requests and response formats
Example use cases with code snippets
To begin working with the Clore API, you need an API key, which acts as an authentication token to securely interact with the API. Follow these steps:
Obtain Your API Key
Visit and create an account if you haven’t already.
Navigate to the API section in your account settings.
Generate a new API key, ensuring to save it securely as it will grant access to your resources.
Setting Up the Authorization Header The Clore API requires each request to include an authentication header. Here’s how to structure it:
Let’s start with a simple request to check your wallet balance using the /wallets
endpoint. This endpoint returns a list of wallets associated with your account, including balances and other details.
Example Code: Fetching Wallet Balance
Expected Response:
a) Listing Servers Available for Rent
The /marketplace
endpoint provides details on all available servers in the Clore Marketplace, including specifications, rental prices, and availability status.
Example Code: Retrieving Marketplace Data
Use the /server_config
endpoint to retrieve configuration details of a specific server you own.
Example Code: Fetching Server Configuration
The Clore API returns different status codes to indicate success or failure:
0
- Normal
1
- Database Error
2
- Invalid Input Data
3
- Invalid API Token
4
- Invalid Endpoint
5
- Exceeded request limit (1 request/second)
In your code, it's essential to handle these response codes for robust error management. Here's a basic example:
Suppose you want to automate the process of monitoring wallet balances and receive alerts if the balance drops below a specific threshold.
Example Code: Wallet Balance Alert
This introductory guide has provided a foundational understanding of Clore API, covering basic requests, authentication, and essential endpoints. In the following articles, we will delve deeper into more complex use cases, including automated pricing adjustments, server configuration management, and dynamic resource allocation using Clore’s robust API capabilities.