Introduction
CLORE.AI api can be used to automate deployments of your workloads onto CLORE.AI
API responses
Responses are returned in JSON format, may have different fields
Always returned field is code, indicating status
code field
Endpoints
1. wallets
About
Return wallets and balances
Headers
Output
Example
Input:
Copy curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' 'https://api.clore.ai/v1/wallets'
Output:
Copy {
"wallets": [
{
"name": "bitcoin",
"deposit": "tb1q6erw7v02t7hakgmlcl4wfnlykzqj05alndruwr",
"balance": 0.00153176,
"withdrawal_fee": 0.0001
}
],
"code": 0
}
2. my_servers
About
Returns your servers that you are providing to clore.ai marketplace
Headers
Output
Example
Input:
Copy curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' 'https://api.clore.ai/v1/my_servers'
Output:
Copy {
"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 not implemented yet
3. server_config
About
Get configuration of specific server
Headers
Body
Output
Example
Input:
Copy curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' -H "Content-type: application/json" -d '{
"server_name":"Jan Vykydal"
}' 'https://api.clore.ai/v1/server_config'
Output:
Copy {
"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 not implemented yet
4. marketplace
About
Get marketplace
Headers
Output
Example
Get marketplace
Input:
Copy curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' 'https://api.clore.ai/v1/marketplace'
Output:
Copy {
"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
About
Get your orders
Headers
Query string
Output
Input:
Copy curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' 'https://api.clore.ai/v1/my_orders?return_completed=true'
Output:
Copy {
"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
About
Get spot marketplace for specific server
Headers
Query string
Output
Input:
Copy curl -XGET -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' 'https://api.clore.ai/v1/spot_marketplace?market=6'
Output:
Copy {
"market": {
"offers": [
{
"offer_id": 39,
"bid": 0.0000042,
"active": true,
"my": true
}
],
"server": {
"min_pricing": {
"bitcoin": 0.000001
},
"mrl": 262800,
"visibility": "public",
"online": true
}
},
"exists": true,
"code": 0
}
7. set_server_settings
About
Configure settings of server you are providing on clore.ai marketplace
Headers
Body
Output
Example
Let's create a send proof for a transaction sent from the current wallet.
Input:
Copy curl -XPOST -H 'auth: b8qwqRAL5W7YDyDJeB4XANVvKndbrrPk' -H "Content-type: application/json" -d '{
"name": "Jan Vykydal",
"availability":true,
"mrl":96,
"on_demand":0.0001,
"spot":0.00000113
}' 'https://api.clore.ai/v1/set_server_settings'
Output:
8. set_spot_price
About
Set price per day on your SPOT market offer
Headers
Body
Example
Let's try to update spot market price
Input 1 (Step down was too big):
Copy 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 ₿
Copy {
"error":"exceeded_max_step",
"max_step":0.0000032,
"code":6
}
Input 2 (Valid price step down):
Copy 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):
Input 3 (Lower price even more after sending Input 2):
Copy 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
Copy {
"error":"can_lower_every_600_seconds",
"time_to_lowering":513,
"code":6
}
9. cancel_order
About
Set price per day on your SPOT market offer
Headers
Body
Output
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
Copy 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:
10. create_order
About
You can create spot offer or on demand order with this endpoint
This endpoint also allows only 1 request in 5 seconds
Headers
Body
* To fields marked with star you can only input characters from this regexp group /^[a-zA-Z0-9\s-=.@+/]+$/
Output
Example
Input 1 (Create spot offer):
Copy 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):
Input 2 (Create on demand order):
Copy 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):