> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/for-hosts/api.md).

# API

> 💡 **Python Developers:** Use the official [clore-ai Python SDK](/developers/python-sdk.md) instead of raw API calls. It handles authentication, rate limiting, retries, and error handling automatically.
>
> **Quick start:** `pip install clore-ai` — See the [Python SDK docs](/developers/python-sdk.md) and [CLI Reference](/developers/cli-guide.md).

> 🧭 Prefer a browsable reference? Open the interactive API docs at [clore.ai/api-docs](https://clore.ai/api-docs). Base URL for all endpoints on this page: `https://api.clore.ai/v1/`.

<div data-full-width="true"><figure><img src="https://2864042869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbyNlC5NV8aIpXnc76G7w%2Fuploads%2FoEhopGeayaKnbuDjgTEs%2FCLORE%20Docs%20API%20Page.png?alt=media&amp;token=a0adf6bb-1fde-4f1b-8236-dff2563ffbfd" alt=""><figcaption></figcaption></figure></div>

### Introduction <a href="#introduction" id="introduction"></a>

[CLORE.AI](http://clore.ai/) api can be used to automate deployments of your workloads onto [CLORE.AI](http://clore.ai/)

Firstly you need to get an API key\
![alt text](https://clore.ai/assets/html/api-export1.png)\
![alt text](https://clore.ai/assets/html/api-export2.png)

***

### API responses <a href="#api-responses" id="api-responses"></a>

Responses are returned in JSON format, may have different fields

Always returned field is code, indicating status

**code field**

| code | Description                      |
| ---- | -------------------------------- |
| `0`  | NORMAL                           |
| `1`  | DATABASE ERROR                   |
| `2`  | INVALID INPUT DATA               |
| `3`  | INVALID API TOKEN                |
| `4`  | INVALID ENDPOINT                 |
| `5`  | EXCEEDED 1 request/second limit  |
| `6`  | Error specified in `error` field |

***

### Endpoints <a href="#endpoints" id="endpoints"></a>

#### 1. `wallets` <a href="#id-1-wallets" id="id-1-wallets"></a>

**About**

Return wallets and balances

**Headers**

| Field  | Type     | Mandatory | Description |
| ------ | -------- | --------- | ----------- |
| `auth` | `string` | Yes       | API token   |

**Output**

| Field     | Type       | Description      |
| --------- | ---------- | ---------------- |
| `code`    | `int`      | Status code      |
| `wallets` | `[]string` | Array of wallets |

**Example**

**Input:**

```
curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' 'https://api.clore.ai/v1/wallets'
```

**Output:**

```
{
  "wallets": [
    {
      "name": "bitcoin",
      "deposit": "tb1q6erw7v02t7hakgmlcl4wfnlykzqj05alndruwr",
      "balance": 0.00153176,
      "withdrawal_fee": 0.0001
    }
  ],
  "code": 0
}
```

#### 2. `my_servers` <a href="#id-2-my_servers" id="id-2-my_servers"></a>

**About**

Returns your servers that you are providing to [clore.ai](http://clore.ai/) marketplace

**Headers**

| Field  | Type     | Mandatory | Description |
| ------ | -------- | --------- | ----------- |
| `auth` | `string` | Yes       | API token   |

**Output**

| Field                                 | Type       | Description                                                                                                                                   |
| ------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `code`                                | `int`      | Status code                                                                                                                                   |
| `limit`                               | `int`      | Maximum number of servers you can own                                                                                                         |
| `servers`                             | `[]string` | Array of servers                                                                                                                              |
| `servers[x].name`                     | `string`   | User selected server name                                                                                                                     |
| `servers[x].connected`                | `string`   | Was the server ever connected to [clore.ai](http://clore.ai/)                                                                                 |
| `servers[x].visibility`               | `string`   | Visibility on marketplace                                                                                                                     |
| `servers[x].pricing`                  | `[]string` | Price/day on-demand                                                                                                                           |
| `servers[x].online`                   | `bool`     | Is server online                                                                                                                              |
| `servers[x].min_spot_pricing`         | `[]string` | Minimal price/day to rent for on spot market                                                                                                  |
| `servers[x].init_token`               | `string`   | Machine-registration token, returned only until the machine is initialized — **treat as a credential**, it registers machines to your account |
| `servers[x].specs`                    | `[]string` | Server specifications                                                                                                                         |
| `servers[x].remaining_time`           | `int`      | Rental end time of the latest active order (ms epoch)                                                                                         |
| `servers[x].rental_state`             | `string`   | Aggregate GPU rental state: `none`, `partial`, or `full`                                                                                      |
| `servers[x].rented_gpus`              | `int`      | GPUs currently rented across active orders                                                                                                    |
| `servers[x].total_gpus`               | `int`      | Total GPUs on the server                                                                                                                      |
| `servers[x].rented_price_by_currency` | `object`   | Sum of active order prices keyed by currency                                                                                                  |
| `servers[x].update_channel`           | `string`   | Hosting-agent update channel: `stable` or `beta`                                                                                              |
| `servers[x].requested_channel`        | `string`   | Channel switch requested from the web UI (present only when requested)                                                                        |
| `servers[x].target_backend_version`   | `int`      | Backend version the current channel targets                                                                                                   |

> The rental-state fields (`remaining_time`, `rental_state`, `rented_gpus`, `total_gpus`, `rented_price_by_currency`) are present only while the server has an active order.

**Example**

**Input:**

```
curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' 'https://api.clore.ai/v1/my_servers'
```

**Output:**

```
{
  "servers": [
    {
      "name": "Michael",
      "connected": false,
      "visibility": "hidden",
      "pricing": { "bitcoin": 0, "usd": 0 },
      "online": false,
      "min_spot_pricing": { "bitcoin": 0, "usd": 0 },
      "init_token": "qnwVIMsZPjUWS7jw6gAbTOeoGQNgTH9XVxJaiCEbG0OlmfjF"
    },
    {
      "name": "Jan Vykydal",
      "connected": true,
      "visibility": "public",
      "pricing": { "bitcoin": 0.00010337, "usd": 0 },
      "online": false,
      "min_spot_pricing": { "bitcoin": 0.00005168, "usd": 0 },
      "specs": {
        "mb": "Z590 GAMING X",
        "cpu": "Intel Core i9-11900",
        "cpus": "8/16",
        "ram": 64,
        "disk": "NVMe 512GB",
        "disk_speed": 2000,
        "gpu": "1x GeForce GTX 1080 Ti",
        "gpuram": 11,
        "net": {
          "down":119.61,
          "up":25.24
        }
      }
    }
  ],
  "limit": 16,
  "code": 0
}
```

USD values in `pricing` objects reflect the USD-based pricing mode where the host enabled it.

#### 3. `server_config` <a href="#id-3-server_config" id="id-3-server_config"></a>

**About**

Get configuration of specific server

**Headers**

| Field          | Type     | Mandatory | Description                |
| -------------- | -------- | --------- | -------------------------- |
| `auth`         | `string` | Yes       | API token                  |
| `Content-type` | `string` | Yes       | Must be `application/json` |

**Body**

| Field         | Type     | Mandatory | Description |
| ------------- | -------- | --------- | ----------- |
| `server_name` | `string` | Yes       | Server name |

**Output**

| Field                   | Type                 | Description                                                                                    |
| ----------------------- | -------------------- | ---------------------------------------------------------------------------------------------- |
| `code`                  | `int`                | Status code                                                                                    |
| `creation_completed`    | `bool`               | Is server creation complete                                                                    |
| `config`                | `[]string`           | Config of server                                                                               |
| `config.name`           | `string`             | User selected server name                                                                      |
| `config.connected`      | `bool`               | Was the server ever connected to [clore.ai](http://clore.ai/)                                  |
| `config.visibility`     | `string`             | Visibility on marketplace                                                                      |
| `config.pricing`        | `[]string`           | Price/day on-demand                                                                            |
| `config.spot_pricing`   | `[]string`           | Minimal price/day to rent for on spot market                                                   |
| `config.mrl`            | `int`                | Maximum rental length in hours                                                                 |
| `config.online`         | `bool`               | Is server online                                                                               |
| `config.initialized`    | `bool`               | Was the server ever connected to [clore.ai](http://clore.ai/)                                  |
| `config.id`             | `int`                | Unique server ID                                                                               |
| `config.rental_status`  | `int`                | 0 - not rented \| 1 - Rented on spot market \| 2 - Rented On Demand \| 3 - Fixed-USD rental    |
| `config.specs`          | `[]string`           | Server specifications                                                                          |
| `config.background_job` | `object`             | Background job when not rented: `image`, `command`, `env`, `times_updated`                     |
| `config.autoprice`      | `object` \| `string` | Per-currency autopricing configuration (legacy string values `"pow"` / `"usd"` also occur)     |
| `config.usd_pricing`    | `object`             | USD price targets — present only when USD autopricing is enabled                               |
| `config.tenants`        | `[]object`           | Active orders on the server: `rental_type`, `currency`, `price`, `remaining_time`, `gpu_count` |

> `server_config` also returns the same rental-state and update-channel fields as `my_servers`: `remaining_time`, `rental_state`, `rented_gpus`, `total_gpus`, `rented_price_by_currency`, `update_channel`, `requested_channel`, `target_backend_version`. In both endpoints the rental-state fields are present only while the server has an active order.

**Example**

**Input:**

```
curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' -H "Content-type: application/json" -d '{
    "server_name":"Jan Vykydal"
}' 'https://api.clore.ai/v1/server_config'
```

**Output:**

```
{
  "config": {
    "name": "Jan Vykydal",
    "connected": true,
    "visibility": "public",
    "pricing": { "bitcoin": 0.00010337, "usd": 0 },
    "spot_pricing": { "bitcoin": 0.00005168, "usd": 0 },
    "mrl": 72,
    "online": false,
    "initialized": true,
    "id": 4,
    "rental_status": 0,
    "specs": {
      "mb": "Z590 GAMING X",
      "cpu": "Intel Core i9-11900",
      "cpus": "8/16",
      "ram": 64,
      "disk": "NVMe 512GB",
      "disk_speed": 2000,
      "gpu": "1x GeForce GTX 1080 Ti",
      "gpuram": 11,
      "net": {
        "down":119.61,
        "up":25.24
      }
    },
    "background_job": {
      "times_updated": 1,
      "image": "cloreai/ubuntu20.04-jupyter",
      "command": "",
      "env": []
    }
  },
  "creation_completed": true,
  "code": 0
}
```

USD values in `pricing` objects reflect the USD-based pricing mode where the host enabled it.

#### 4. `marketplace` <a href="#id-4-marketplace" id="id-4-marketplace"></a>

**About**

Get marketplace

**Headers**

| Field  | Type     | Mandatory | Description |
| ------ | -------- | --------- | ----------- |
| `auth` | `string` | Yes       | API token   |

**Output**

| Field                           | Type               | Description                                                                                          |
| ------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------- |
| `code`                          | `int`              | Status code                                                                                          |
| `my_servers`                    | `[]string`         | Array of server ids you are providing to [clore.ai](http://clore.ai/) (can't be rented)              |
| `servers`                       | `[]string`         | Array of public servers on marketplace                                                               |
| `servers[x].id`                 | `int`              | Unique server ID                                                                                     |
| `servers[x].owner`              | `int`              | Unique owner ID                                                                                      |
| `servers[x].mrl`                | `int`              | Maximum rental length in hours                                                                       |
| `servers[x].price.on_demand`    | `[]string`         | On demand price per day                                                                              |
| `servers[x].price.spot`         | `[]string`         | Minimal spot market price per day                                                                    |
| `servers[x].rented`             | `bool`             | Is server rented on demand                                                                           |
| `servers[x].specs`              | `[]string`         | Server specifications                                                                                |
| `servers[x].partial_gpu_rental` | `object` \| `bool` | `false` when partial rental is unavailable, otherwise `{ total_gpus, available_gpus, free_indices }` |

> `price.on_demand` and `price.spot` only include the currencies each server actually accepts — a server without a price in some currency cannot be rented in it.

**Example**

Get marketplace

**Input:**

```
curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' 'https://api.clore.ai/v1/marketplace'
```

**Output:**

```
{
  "servers": [
    {
      "id": 6,
      "owner": 4,
      "mrl": 73,
      "price": { "on_demand": { "bitcoin": 0.00001 },
      "spot": { "bitcoin": 0.000001 }},
      "rented": false,
      "specs": {
        "mb": "Z590 GAMING X",
        "cpu": "11th Gen Intel(R) Core(TM) i9-11900 @ 2.50GHz",
        "cpus": "8/16",
        "ram": 62.67348861694336,
        "disk": "NVMe disk 247.3623046875GB",
        "disk_speed": 0,
        "gpu": "1x NVIDIA GeForce GTX 1080 Ti",
        "gpuram": 11,
        "net": {
          "up": 26.38,
          "down": 118.42,
          "cc": "CZ"
        }
      }
    }
  ],
  "my_servers": [1, 2, 4],
  "code": 0
}
```

#### 5. `my_orders` <a href="#id-5-my_orders" id="id-5-my_orders"></a>

**About**

Get your orders

**Headers**

| Field  | Type     | Mandatory | Description |
| ------ | -------- | --------- | ----------- |
| `auth` | `string` | Yes       | API token   |

**Query string**

| Field              | Type   | Mandatory | Description                       |
| ------------------ | ------ | --------- | --------------------------------- |
| `return_completed` | `bool` | No        | Return completed (expired) orders |

**Output**

| Field                    | Type       | Description                                                                                                                                                |
| ------------------------ | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `code`                   | `int`      | Status code                                                                                                                                                |
| `limit`                  | `int`      | Maximum count of active orders                                                                                                                             |
| `orders`                 | `[]string` | Array of orders                                                                                                                                            |
| `orders[x].id`           | `int`      | Unique order ID                                                                                                                                            |
| `orders[x].fee`          | `float`    | Fee (%) paid to [clore.ai](http://clore.ai/)                                                                                                               |
| `orders[x].creation_fee` | `float`    | Creation fee paid to [clore.ai](http://clore.ai/)                                                                                                          |
| `orders[x].price`        | `float`    | Order price (cost) per day                                                                                                                                 |
| `orders[x].mrl`          | `int`      | Maximum order rental length in seconds                                                                                                                     |
| `orders[x].image`        | `string`   | Used docker image                                                                                                                                          |
| `orders[x].currency`     | `string`   | Currency used for billing                                                                                                                                  |
| `orders[x].spend`        | `float`    | Actual amount debited so far: accumulated rental value plus the renter base fee (after PoH reduction) and any extra fee; excludes the one-off creation fee |
| `orders[x].gpu_count`    | `int`      | Number of GPUs the order occupies (on-demand orders; equals the rig's total GPUs unless it is a partial rental)                                            |
| `orders[x].ct`           | `int`      | Creation time (UNIX time)                                                                                                                                  |
| `orders[x].p`            | `int`      | Currently used proxy cluster                                                                                                                               |
| `orders[x].specs`        | `[]string` | Server specifications                                                                                                                                      |
| `orders[x].si`           | `int`      | Unique server ID                                                                                                                                           |
| `orders[x].pub_cluster`  | `[]string` | Public endpoints with forwarded ports                                                                                                                      |
| `orders[x].tcp_ports`    | `[]string` | TCP port forwarding                                                                                                                                        |
| `orders[x].http_port`    | `string`   | Container port forwarded through HTTPS proxy                                                                                                               |
| `orders[x].spot`         | `bool`     | Indication that it is spot order                                                                                                                           |
| `orders[x].expired`      | `bool`     | Indication that the order has expired                                                                                                                      |

**Input:**

```
curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' 'https://api.clore.ai/v1/my_orders?return_completed=true'
```

**Output:**

```
{
  "orders": [
    {
      "id": 38,
      "fee": 5,
      "creation_fee": 3e-7,
      "price": 0.00001,
      "mrl": 262800,
      "image": "cloreai/ubuntu20.04-jupyter",
      "currency": "bitcoin",
      "spend": 6.944444444444445e-9,
      "ct": 1667401396,
      "p": 1,
      "specs": {
        "mb": "Z590 GAMING X",
        "cpu": "11th Gen Intel(R) Core(TM) i9-11900 @ 2.50GHz",
        "cpus": "8/16",
        "ram": 62.67348861694336,
        "disk": "NVMe disk 247.3623046875GB",
        "disk_speed": 2000,
        "gpu": "1x NVIDIA GeForce GTX 1080 Ti",
        "gpuram": 11,
        "net": {
          "up": 26.38,
          "down": 118.42,
        }
      },
      "si": 6,
      "pub_cluster": [ "n1.c1.clorecloud.net", "n2.c1.clorecloud.net" ],
      "tcp_ports": [ "22:10000" ],
      "http_port": "8888"
    },{
      "id": 36,
      "fee": 2.5,
      "creation_fee": 1e-7,
      "price": 0.00001,
      "mrl": 262800,
      "image": "cloreai/ubuntu20.04-jupyter",
      "currency": "bitcoin",
      "spend": 1.3888888888888888e-7,
      "ct": 1667248597,
      "specs": {
        "mb": "Z590 GAMING X",
        "cpu": "11th Gen Intel(R) Core(TM) i9-11900 @ 2.50GHz",
        "cpus": "8/16",
        "ram": 62.67348861694336,
        "disk": "NVMe disk 247.3623046875GB",
        "disk_speed": 2000,
        "gpu": "1x NVIDIA GeForce GTX 1080 Ti",
        "gpuram": 11,
        "net": {
          "up": 26.38,
          "down": 118.42,
        }
      },
      "si": 6,
      "spot": true,
      "expired": true,
      "tcp_ports": []
    }
  ],
  "limit": 13,
  "code": 0
}
```

#### 6. `spot_marketplace` <a href="#id-6-spot_marketplace" id="id-6-spot_marketplace"></a>

**About**

Get spot marketplace for specific server

**Headers**

| Field  | Type     | Mandatory | Description |
| ------ | -------- | --------- | ----------- |
| `auth` | `string` | Yes       | API token   |

**Query string**

| Field    | Type  | Mandatory | Description      |
| -------- | ----- | --------- | ---------------- |
| `market` | `int` | Yes       | Unique server ID |

**Output**

| Field                          | Type     | Description                                           |
| ------------------------------ | -------- | ----------------------------------------------------- |
| `code`                         | `int`    | Status code                                           |
| `exists`                       | `bool`   | Verification that the market exists                   |
| `market`                       | `object` | Marketplace                                           |
| `market.offers`                | `array`  | Rental offers for the server                          |
| `market.offers[x].offer_id`    | `int`    | Unique offer ID                                       |
| `market.offers[x].bid`         | `float`  | Offered price per day (in the offer's currency)       |
| `market.offers[x].currency`    | `string` | Currency of the bid                                   |
| `market.offers[x].active`      | `bool`   | This offer is currently used                          |
| `market.offers[x].my`          | `bool`   | This offer is owned by me                             |
| `market.server`                | `object` | Server information                                    |
| `market.server.min_pricing`    | `object` | Minimal offer price per day, per accepted currency    |
| `market.server.mrl`            | `int`    | Maximum rental length in **hours**                    |
| `market.server.visibility`     | `string` | You can create offers only when visibility is public  |
| `market.server.online`         | `bool`   | Server is online                                      |
| `market.currency_rates_in_usd` | `object` | Live USD rates used to compare bids across currencies |

> Offers can be placed in any currency the server accepts; competing bids are compared by their **USD value** (using `currency_rates_in_usd`), not face value.
>
> ⚠️ **Changed in August 2026:** `market.server.mrl` is now returned in **hours** (previously seconds). A value that read `262800` now reads `73`.

**Input:**

```
curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' 'https://api.clore.ai/v1/spot_marketplace?market=6'
```

**Output:**

```
{
  "market": {
    "offers": [
      {
        "offer_id": 39,
        "bid": 0.0000042,
        "active": true,
        "my": true,
        "currency": "bitcoin"
      }
    ],
    "server": {
      "min_pricing": {
        "bitcoin": 0.000001
      },
      "mrl": 73,
      "visibility": "public",
      "online": true
    },
    "currency_rates_in_usd": {
      "bitcoin": 110000,
      "CLORE-Blockchain": 0.0045,
      "USD-Blockchain": 1
    }
  },
  "exists": true,
  "code": 0
}
```

#### 7. `set_server_settings` <a href="#id-7-set_server_settings" id="id-7-set_server_settings"></a>

**About**

Configure settings of server you are providing on [clore.ai](http://clore.ai/) marketplace

**Headers**

| Field          | Type     | Mandatory | Description                |
| -------------- | -------- | --------- | -------------------------- |
| `auth`         | `string` | Yes       | API token                  |
| `Content-type` | `string` | Yes       | Must be `application/json` |

**Body**

| Field                        | Type     | Mandatory | Description                                                                                                                                     |
| ---------------------------- | -------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`                       | `string` | Yes       | User selected server name                                                                                                                       |
| `availability`               | `bool`   | Yes       | Can server be rented                                                                                                                            |
| `mrl`                        | `int`    | Yes       | Maximum server rental length in **hours** (6 to 3000)                                                                                           |
| `bitcoin_on_demand`          | `float`  | Yes       | On-demand price in BTC per day                                                                                                                  |
| `bitcoin_spot`               | `float`  | Yes       | Minimum spot price in BTC per day                                                                                                               |
| `CLORE-Blockchain_on_demand` | `float`  | No        | On-demand price in CLORE per day                                                                                                                |
| `CLORE-Blockchain_spot`      | `float`  | No        | Minimum spot price in CLORE per day                                                                                                             |
| `USD-Blockchain_on_demand`   | `float`  | No        | On-demand price in USD per day                                                                                                                  |
| `USD-Blockchain_spot`        | `float`  | No        | Minimum spot price in USD per day                                                                                                               |
| `enabled-bitcoin`            | `bool`   | No\*      | Accept Bitcoin for this server                                                                                                                  |
| `enabled-CLORE-Blockchain`   | `bool`   | No\*      | Accept CLORE for this server                                                                                                                    |
| `enabled-USD-Blockchain`     | `bool`   | No\*      | Accept USD stablecoins for this server                                                                                                          |
| `autoprice`                  | `object` | No        | Per-currency autopricing: set a currency key (`bitcoin`, `CLORE-Blockchain`) to `"usd"` for USD-based autopricing or `false` for fixed pricing  |
| `usd_pricing`                | `object` | No        | USD price targets per currency, e.g. `{ "bitcoin": { "on_demand": 10, "spot": 5 } }` — used only for currencies with `autoprice` set to `"usd"` |

> \* **The accepted-currency list is rebuilt from the `enabled-*` flags on every call.** A currency without its `enabled-<currency>: true` flag (or without a valid price) is dropped from the server's accepted currencies — omitting all flags leaves the server unrentable in every currency. Always send `enabled-<currency>: true` for each currency you want to keep accepting.
>
> Per-day prices are capped per currency: 0.000001–0.015 BTC, 0.1–600,000 CLORE, 0.1–1,000 USD.
>
> When a currency is autopriced in USD, its listed crypto price is derived from `usd_pricing` at the live exchange rate (re-derived about every 10 minutes) and any `<currency>_on_demand` / `<currency>_spot` value sent for it is ignored. The `usd_pricing` targets are whole-server $/day figures validated against the USD range (0.1–1,000); out-of-range values clamp to the nearest bound.

**Output**

| Field  | Type  | Description |
| ------ | ----- | ----------- |
| `code` | `int` | Status code |

**Example**

Let's create a send proof for a transaction sent from the current wallet.

**Input:**

```
curl -XPOST -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' -H "Content-type: application/json" -d '{
    "name": "Jan Vykydal",
    "availability":true,
    "mrl":96,
    "enabled-bitcoin":true,
    "bitcoin_on_demand":0.0001,
    "bitcoin_spot":0.00000113
}' 'https://api.clore.ai/v1/set_server_settings'
```

**Output:**

```
{
  "code": 0
}
```

#### 8. `set_spot_price` <a href="#id-8-set_spot_price" id="id-8-set_spot_price"></a>

**About**

Set price per day on your SPOT market offer

**Headers**

| Field          | Type     | Mandatory | Description                |
| -------------- | -------- | --------- | -------------------------- |
| `auth`         | `string` | Yes       | API token                  |
| `Content-type` | `string` | Yes       | Must be `application/json` |

**Body**

| Field           | Type    | Mandatory | Description                |
| --------------- | ------- | --------- | -------------------------- |
| `order_id`      | `int`   | Yes       | Unique offer ID            |
| `desired_price` | `float` | Yes       | Your offered price per day |

> **A price below the server's current spot floor** is rejected with the current minimum included:
>
> ```
> { "error": "amount_too_low", "min_price": 0.0000012, "code": 6 }
> ```

**Example**

Let's try to update spot market price

**Input 1 (Step down was too big):**

```
curl -XPOST -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' -H "Content-type: application/json" -d '{
    "order_id":39,
    "desired_price":0.00000200
}' 'https://api.clore.ai/v1/set_spot_price'
```

**Possible output 1 (Step down was too big):**\
You can lower spot market offer price by max of 0.00000100 ₿

| Field      | Type     | Description                                                 |
| ---------- | -------- | ----------------------------------------------------------- |
| `code`     | `int`    | Status code                                                 |
| `error`    | `string` | Error description field                                     |
| `max_step` | `float`  | Lowest possible value to what you can currently lower price |

```
{
    "error":"exceeded_max_step",
    "max_step":0.0000032,
    "code":6
}
```

**Input 2 (Valid price step down):**

```
curl -XPOST -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' -H "Content-type: application/json" -d '{
    "order_id":39,
    "desired_price":0.00000320
}' 'https://api.clore.ai/v1/set_spot_price'
```

**Possible output 2 (Valid price step down):**

```
{
    "code": 0
}
```

**Input 3 (Lower price even more after sending Input 2):**

```
curl -XPOST -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' -H "Content-type: application/json" -d '{
    "order_id":39,
    "desired_price":0.00000220
}' 'https://api.clore.ai/v1/set_spot_price
```

**Possible output 3 (Lower price even more after sending Input 2):**\
You can lower spot price once in 600 seconds

| Field              | Type     | Description                                             |
| ------------------ | -------- | ------------------------------------------------------- |
| `code`             | `int`    | Status code                                             |
| `error`            | `string` | Error description field                                 |
| `time_to_lowering` | `float`  | Remaining time (sec) to next possibility to lower price |

```
{
    "error":"can_lower_every_600_seconds",
    "time_to_lowering":513,
    "code":6
}
```

#### 9. `cancel_order` <a href="#id-9-cancel_order" id="id-9-cancel_order"></a>

**About**

Cancel an active order or spot offer

**Headers**

| Field          | Type     | Mandatory | Description                |
| -------------- | -------- | --------- | -------------------------- |
| `auth`         | `string` | Yes       | API token                  |
| `Content-type` | `string` | Yes       | Must be `application/json` |

**Body**

| Field   | Type     | Mandatory | Description                                                                                                                          |
| ------- | -------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `id`    | `int`    | Yes       | Unique order/offer ID                                                                                                                |
| `issue` | `string` | No        | If you have encountered any issues with the server you can report them to [clore.ai](http://clore.ai/) team, maximum 2048 characters |

**Output**

| Field  | Type  | Description |
| ------ | ----- | ----------- |
| `code` | `int` | Status code |

**Example**

Cancel order/offer

**Input:**\
In this example we are reporting issues with GPU #1, if you don't have issues, don't include issue field.\
You can write any message to text field and we will investigate it

```
curl -XPOST -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' -H "Content-type: application/json" -d '{
    "id":39,
    "issue":"GPU #1 Was overheating and throttling"
}' 'https://api.clore.ai/v1/cancel_order'
```

**Output:**

```
{
  "code": 0
}
```

#### 10. `create_order` <a href="#id-10-create_order" id="id-10-create_order"></a>

**About**

You can create spot offer or on demand order with this endpoint

**Headers**

| Field          | Type     | Mandatory | Description                |
| -------------- | -------- | --------- | -------------------------- |
| `auth`         | `string` | Yes       | API token                  |
| `Content-type` | `string` | Yes       | Must be `application/json` |

**Body**

| Field                | Type     | Mandatory | Description                                                                                                                                                                                                                                                              |
| -------------------- | -------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `currency`           | `string` | Yes       | Currency name                                                                                                                                                                                                                                                            |
| `image`              | `string` | Yes       | Valid image from dockerhub                                                                                                                                                                                                                                               |
| `renting_server`     | `int`    | Yes       | ID of server you want to rent                                                                                                                                                                                                                                            |
| `type`               | `string` | Yes       | `on-demand` OR `spot`                                                                                                                                                                                                                                                    |
| `spotprice`          | `float`  | Depends   | Offering price per day on spot market, required when making spot order                                                                                                                                                                                                   |
| `ports`              | `object` | No        | Port forwarding configuration, max 5 records                                                                                                                                                                                                                             |
| `env`                | `object` | No        | <p>Environment variables, limited to 12288 characters in total when stringified.<br>Variable name - 128 symbols max, must not contain <code>-</code><br>Variable value - 1536 symbols max<br>Only the first 30 valid variables are kept; extras are silently dropped</p> |
| `jupyter_token`      | `string` | No        | Jupyter token for images that has jupyter notebooks, maximum 32 characters \*                                                                                                                                                                                            |
| `ssh_key`            | `string` | No        | SSH key for images with SSH, maximum 3072 characters \*                                                                                                                                                                                                                  |
| `ssh_password`       | `string` | No        | SSH password for images with SSH, maximum 32 characters \*                                                                                                                                                                                                               |
| `command`            | `string` | No        | Command will be run on server after order creation                                                                                                                                                                                                                       |
| `required_price`     | `float`  | No        | Specify price for what you want to start the order, if machine owner changes the price, then order will not start (on demand only)                                                                                                                                       |
| `gpu_count`          | `int`    | No        | Number of GPUs to rent on servers that support [partial rental](/for-renters/partial-gpu-rental.md). Omit to rent the whole rig. On-demand only, homogeneous rigs only                                                                                                   |
| `gpu_indices`        | `[]int`  | No        | 0-based GPU slot indices to rent; length must equal `gpu_count`. Take free slots from `partial_gpu_rental.free_indices`. Omit to let the backend pick free GPUs automatically                                                                                            |
| `autossh_entrypoint` | `bool`   | No        | Use clore.ai entrypoint, that autometically deploy SSH server and custom `/root/onstart.sh` script                                                                                                                                                                       |

\* To fields marked with star you can only input characters from this regexp group `/^[a-zA-Z0-9\s-=.@+/]+$/`

**Output**

| Field  | Type  | Description |
| ------ | ----- | ----------- |
| `code` | `int` | Status code |

> **Spot bids below the server's floor** are rejected with the current minimum included, so you can retry immediately:
>
> ```
> { "error": "too_low_price", "min_price": 0.0000012, "code": 6 }
> ```
>
> The floor is recomputed from live coin rates roughly every 10 minutes, so a price read off the marketplace listing can be slightly stale — always use the returned `min_price` for the retry.

**Example**

**Input 1 (Create spot offer):**

```
curl -XPOST -H 'auth: 6FcuR7ibcwKR1Z32lEFoSotzUUtzKO2H' -H "Content-type: application/json" -d '
{
    "currency":"bitcoin",
    "image":"cloreai/ubuntu20.04-jupyter",
    "renting_server":6,
    "type":"spot",
    "spotprice":0.000001,
    "ports":{
        "22":"tcp",
        "8888":"http"
    },
    "env":{
        "VARIABLE_NAME":"VARIABLE_VALUE",
    },
    "jupyter_token":"hoZluOjbCOQ5D5yH7R",
    "ssh_password":"Hpcj08ZaOpCbTmn1Eu",
    "command":"#!/bin/sh\napt update -y && apt install htop"
}' 'https://api.clore.ai/v1/create_order'
```

**Output 1 (Create spot offer):**

```
{
  "code":0
}
```

**Input 2 (Create on demand order):**

```
curl -XPOST -H 'auth: 6FcuR7ibcwKR1Z32lEFoSotzUUtzKO2H' -H "Content-type: application/json" -d '
{
    "currency":"bitcoin",
    "image":"cloreai/ubuntu20.04-jupyter",
    "renting_server":6,
    "type":"on-demand",
    "ports":{
        "22":"tcp",
        "8888":"http"
    },
    "env":{
        "VARIABLE_NAME":"VARIABLE_VALUE",
    },
    "jupyter_token":"hoZluOjbCOQ5D5yH7R",
    "ssh_password":"Hpcj08ZaOpCbTmn1Eu",
    "command":"#!/bin/sh\napt update -y && apt install htop"
}' 'https://api.clore.ai/v1/create_order'
```

**Output 2 (Create on demand order):**

```
{
  "code":0
}
```

#### 11. `renter_fees` <a href="#id-11-renter_fees" id="id-11-renter_fees"></a>

**About**

Get the current fee configuration: base renter fees, PoH fee reduction settings, order creation fees, and your PoH balance

**Headers**

| Field  | Type     | Mandatory | Description |
| ------ | -------- | --------- | ----------- |
| `auth` | `string` | Yes       | API token   |

**Output**

| Field                              | Type     | Description                                           |
| ---------------------------------- | -------- | ----------------------------------------------------- |
| `code`                             | `int`    | Status code                                           |
| `renter_fees.on_demand`            | `object` | Base fee (%) per currency for on-demand orders        |
| `renter_fees.spot`                 | `object` | Base fee (%) per currency for spot orders             |
| `poh_config.max_reduction_percent` | `int`    | Maximum base-fee reduction through PoH (%)            |
| `poh_config.max_poh_amount`        | `int`    | PoH balance at which the maximum reduction is reached |
| `creation_fees.on_demand`          | `object` | Order creation fee per currency                       |
| `creation_fees.spot`               | `object` | Spot order creation fee per currency                  |
| `poh_balance`                      | `float`  | Your PoH CLORE balance                                |

**Input:**

```
curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' 'https://api.clore.ai/v1/renter_fees'
```

**Output:**

```
{
  "renter_fees": {
    "on_demand": {
      "base": { "bitcoin": 5, "CLORE-Blockchain": 5, "USD-Blockchain": 5 }
    },
    "spot": {
      "base": { "bitcoin": 1.25, "CLORE-Blockchain": 1.25, "USD-Blockchain": 1.25 }
    }
  },
  "poh_config": { "max_reduction_percent": 50, "max_poh_amount": 2000000 },
  "creation_fees": {
    "on_demand": { "bitcoin": 3e-7, "CLORE-Blockchain": 0.5, "USD-Blockchain": 0.1 },
    "spot": { "bitcoin": 1e-7, "CLORE-Blockchain": 0.05, "USD-Blockchain": 0.005 }
  },
  "poh_balance": 5000,
  "code": 0
}
```

#### 12. `cancel_orders` <a href="#id-12-cancel_orders" id="id-12-cancel_orders"></a>

**About**

Cancel multiple orders at once (up to 256 per request)

**Headers**

| Field          | Type     | Mandatory | Description                |
| -------------- | -------- | --------- | -------------------------- |
| `auth`         | `string` | Yes       | API token                  |
| `Content-type` | `string` | Yes       | Must be `application/json` |

**Body**

| Field       | Type    | Mandatory | Description                      |
| ----------- | ------- | --------- | -------------------------------- |
| `order_ids` | `[]int` | Yes       | Order IDs to cancel, maximum 256 |

**Output**

| Field              | Type    | Description                           |
| ------------------ | ------- | ------------------------------------- |
| `code`             | `int`   | Status code                           |
| `failed_to_cancel` | `[]int` | Order IDs that could not be cancelled |

**Input:**

```
curl -XPOST -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' -H "Content-type: application/json" -d '{
    "order_ids": [38, 39]
}' 'https://api.clore.ai/v1/cancel_orders'
```

**Output:**

```
{
  "failed_to_cancel": [],
  "code": 0
}
```

#### 13. `poh_balance` <a href="#id-13-poh_balance" id="id-13-poh_balance"></a>

**About**

Get your Proof of Holding balance: items, totals, and PoH Marketplace offer amounts

**Headers**

| Field  | Type     | Mandatory | Description |
| ------ | -------- | --------- | ----------- |
| `auth` | `string` | Yes       | API token   |

**Output**

| Field                                         | Type       | Description                             |
| --------------------------------------------- | ---------- | --------------------------------------- |
| `code`                                        | `int`      | Status code                             |
| `items`                                       | `[]object` | Your PoH items with individual balances |
| `balance.total`                               | `float`    | Total PoH balance across all items      |
| `balance.free_amount`                         | `float`    | PoH balance not committed to offers     |
| `balance.reward_amount`                       | `float`    | Balance eligible for rewards            |
| `balance.offers.rented_amount`                | `float`    | Amount rented out to other users        |
| `balance.offers.rented_on_marketplace_amount` | `float`    | Amount listed on the PoH Marketplace    |
| `balance.offers.leased_amount`                | `float`    | Amount leased from other users          |

**Input:**

```
curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' 'https://api.clore.ai/v1/poh_balance'
```

**Output:**

```
{
  "items": [ { "balance": 5000 } ],
  "balance": {
    "total": 5000,
    "free_amount": 4000,
    "reward_amount": 5000,
    "offers": {
      "rented_amount": 0,
      "rented_on_marketplace_amount": 1000,
      "rented_finished_amount": 0,
      "leased_amount": 0
    }
  },
  "code": 0
}
```

#### 14. `server-config.json` <a href="#id-14-server-config-json" id="id-14-server-config-json"></a>

**About**

Get static API configuration data. No authentication required

**Input:**

```
curl -XGET 'https://api.clore.ai/v1/server-config.json'
```

#### 15. `get_relay` <a href="#id-15-get_relay" id="id-15-get_relay"></a>

**About**

Get TCP forwarding relay nodes for your detected country. No authentication required

**Output**

| Field     | Type     | Description           |
| --------- | -------- | --------------------- |
| `code`    | `int`    | Status code           |
| `country` | `string` | Detected country code |
| `nodes`   | `object` | Available relay nodes |

**Input:**

```
curl -XGET 'https://api.clore.ai/v1/get_relay'
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clore.ai/for-hosts/api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
