Spot
Get all Spot bids for a project, or all user's projects if not specified
proj_abc123456it_abc123456us-central1-aSuccessful Response
Validation Error
GET /v2/spot/bids HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"data": [
{
"fid": "bid_abc123456",
"name": "text",
"project": "proj_abc123456",
"created_by": "user_abc123456",
"created_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"limit_price": "$15.60",
"instance_quantity": 4,
"instance_type": "it_abc123456",
"region": "us-central1-a",
"instances": [
"inst_abc123456"
],
"launch_specification": {
"volumes": [
"vol_1234567890",
"vol_1234567891"
],
"ssh_keys": [
"sshkey_1234567890",
"sshkey_1234567891"
],
"startup_script": "text",
"kubernetes_cluster": "clust_abc123456",
"image_version": "imgver_abc123456",
"memory_gb": 1
},
"status": "Open"
}
],
"next_cursor": "text"
}Place a new Spot bid
proj_abc123456us-central1-ait_abc123456$25.604Successful Response
bid_abc123456proj_abc123456user_abc1234562024-01-01T00:00:00Z2024-01-01T00:00:00Z$15.604it_abc123456us-central1-aOpenPossible values: Validation Error
POST /v2/spot/bids HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 407
{
"project": "proj_abc123456",
"region": "us-central1-a",
"instance_type": "it_abc123456",
"limit_price": "$25.60",
"instance_quantity": 4,
"name": "text",
"launch_specification": {
"volumes": [
"vol_1234567890",
"vol_1234567891"
],
"ssh_keys": [
"sshkey_1234567890",
"sshkey_1234567891"
],
"startup_script": "text",
"kubernetes_cluster": "clust_abc123456",
"image_version": "imgver_abc123456",
"memory_gb": 1
},
"notification_email": "text"
}{
"fid": "bid_abc123456",
"name": "text",
"project": "proj_abc123456",
"created_by": "user_abc123456",
"created_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"limit_price": "$15.60",
"instance_quantity": 4,
"instance_type": "it_abc123456",
"region": "us-central1-a",
"instances": [
"inst_abc123456"
],
"launch_specification": {
"volumes": [
"vol_1234567890",
"vol_1234567891"
],
"ssh_keys": [
"sshkey_1234567890",
"sshkey_1234567891"
],
"startup_script": "text",
"kubernetes_cluster": "clust_abc123456",
"image_version": "imgver_abc123456",
"memory_gb": 1
},
"status": "Open"
}Get a single Spot bid by FID
Successful Response
bid_abc123456proj_abc123456user_abc1234562024-01-01T00:00:00Z2024-01-01T00:00:00Z$15.604it_abc123456us-central1-aOpenPossible values: Validation Error
GET /v2/spot/bids/{bid_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"fid": "bid_abc123456",
"name": "text",
"project": "proj_abc123456",
"created_by": "user_abc123456",
"created_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"limit_price": "$15.60",
"instance_quantity": 4,
"instance_type": "it_abc123456",
"region": "us-central1-a",
"instances": [
"inst_abc123456"
],
"launch_specification": {
"volumes": [
"vol_1234567890",
"vol_1234567891"
],
"ssh_keys": [
"sshkey_1234567890",
"sshkey_1234567891"
],
"startup_script": "text",
"kubernetes_cluster": "clust_abc123456",
"image_version": "imgver_abc123456",
"memory_gb": 1
},
"status": "Open"
}Cancel a Spot bid
Successful Response
No content
Validation Error
DELETE /v2/spot/bids/{bid_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Update the limit price of a Spot bid
Successful Response
bid_abc123456proj_abc123456user_abc1234562024-01-01T00:00:00Z2024-01-01T00:00:00Z$15.604it_abc123456us-central1-aOpenPossible values: Validation Error
PATCH /v2/spot/bids/{bid_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 78
{
"limit_price": "text",
"paused": true,
"volumes": [
"vol_abc123456"
],
"memory_gb": 1
}{
"fid": "bid_abc123456",
"name": "text",
"project": "proj_abc123456",
"created_by": "user_abc123456",
"created_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"limit_price": "$15.60",
"instance_quantity": 4,
"instance_type": "it_abc123456",
"region": "us-central1-a",
"instances": [
"inst_abc123456"
],
"launch_specification": {
"volumes": [
"vol_1234567890",
"vol_1234567891"
],
"ssh_keys": [
"sshkey_1234567890",
"sshkey_1234567891"
],
"startup_script": "text",
"kubernetes_cluster": "clust_abc123456",
"image_version": "imgver_abc123456",
"memory_gb": 1
},
"status": "Open"
}Get detailed status of a Spot bid.
Returns a detailed status that includes instance-level status information. The status can be one of: Open, Allocated, Preempting, Terminated, Paused, Relocating.
"Relocating" indicates that part of the order is being relocated.
Successful Response
Response model for the detailed bid status endpoint.
bid_xxxxOpenPossible values: Validation Error
GET /v2/spot/bids/{bid_fid}/status HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"bid_fid": "bid_xxxx",
"status": "Open"
}Get the history of events for a Spot bid.
Returns a list of historical events including:
placing the bid
pausing the bid
resuming the bid
terminating the bid
changes to the limit price
Successful Response
Response model for bid history.
bid_abc123456Validation Error
GET /v2/spot/bids/{bid_fid}/history HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"bid_fid": "bid_abc123456",
"events": [
{
"timestamp": "2024-01-01T00:00:00Z",
"event_type": "Placed",
"limit_price": "$15.60",
"user_id": "text",
"memory_gb": 1,
"persistent_disk_change": {
"attached": "text",
"removed": "text"
}
}
]
}Get the Spot availability across all regions.
Successful Response
auc_abc123456it_abc123456us-central1-a512$10.00$15.00imgver_abc123456GET /v2/spot/availability HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Successful Response
[
{
"fid": "auc_abc123456",
"instance_type": "it_abc123456",
"region": "us-central1-a",
"capacity": 512,
"last_instance_price": "$10.00",
"lowest_allocated_price": "$15.00",
"adjustable_memory": true,
"default_image_version": "imgver_abc123456"
}
]Last updated