For the complete documentation index, see llms.txt. This page is also available as Markdown.

Spot

Get Bids

get

Get all Spot bids for a project, or all user's projects if not specified

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
next_cursorany · nullableOptional
sort_bystring · enum · nullableOptionalPossible values:
sort_dirstring · enum · nullableOptionalPossible values:
projectstring · nullableOptionalExample: proj_abc123456
instance_typestring · nullableOptionalExample: it_abc123456
regionstring · nullableOptionalExample: us-central1-a
statusstring · enum · nullableOptionalPossible values:
namestring · nullableOptional
limitinteger · min: 1 · max: 100 · nullableOptional
Responses
200

Successful Response

application/json
next_cursorstring · nullableOptional
get/v2/spot/bids
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"
}

Create Bid

post

Place a new Spot bid

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
projectstringRequiredExample: proj_abc123456
regionstringRequiredExample: us-central1-a
instance_typestringRequiredExample: it_abc123456
limit_pricestringRequiredExample: $25.60
instance_quantityintegerRequiredExample: 4
namestringRequired
notification_emailstring · nullableOptional
Responses
201

Successful Response

application/json
fidstringRequiredExample: bid_abc123456
namestringRequired
projectstringRequiredExample: proj_abc123456
created_bystringRequiredExample: user_abc123456
created_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
deactivated_atstring · datetime · nullableOptionalExample: 2024-01-01T00:00:00Z
limit_pricestringRequiredExample: $15.60
instance_quantityintegerRequiredExample: 4
instance_typestringRequiredExample: it_abc123456
regionstring · nullableOptionalExample: us-central1-a
instancesstring[]Required
statusstring · enumRequiredExample: OpenPossible values:
post/v2/spot/bids
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 Bid

get

Get a single Spot bid by FID

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
bid_fidstringRequired
Responses
200

Successful Response

application/json
fidstringRequiredExample: bid_abc123456
namestringRequired
projectstringRequiredExample: proj_abc123456
created_bystringRequiredExample: user_abc123456
created_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
deactivated_atstring · datetime · nullableOptionalExample: 2024-01-01T00:00:00Z
limit_pricestringRequiredExample: $15.60
instance_quantityintegerRequiredExample: 4
instance_typestringRequiredExample: it_abc123456
regionstring · nullableOptionalExample: us-central1-a
instancesstring[]Required
statusstring · enumRequiredExample: OpenPossible values:
get/v2/spot/bids/{bid_fid}
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 Bid

delete

Cancel a Spot bid

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
bid_fidstringRequired
Responses
204

Successful Response

No content

delete/v2/spot/bids/{bid_fid}
DELETE /v2/spot/bids/{bid_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Update Bid

patch

Update the limit price of a Spot bid

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
bid_fidstringRequired
Body
limit_pricestring · nullableOptional
pausedboolean · nullableOptional
volumesstring[] · nullableOptional
memory_gbinteger · nullableOptional
Responses
200

Successful Response

application/json
fidstringRequiredExample: bid_abc123456
namestringRequired
projectstringRequiredExample: proj_abc123456
created_bystringRequiredExample: user_abc123456
created_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
deactivated_atstring · datetime · nullableOptionalExample: 2024-01-01T00:00:00Z
limit_pricestringRequiredExample: $15.60
instance_quantityintegerRequiredExample: 4
instance_typestringRequiredExample: it_abc123456
regionstring · nullableOptionalExample: us-central1-a
instancesstring[]Required
statusstring · enumRequiredExample: OpenPossible values:
patch/v2/spot/bids/{bid_fid}
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 Bid Status

get

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.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
bid_fidstringRequired
Responses
200

Successful Response

application/json

Response model for the detailed bid status endpoint.

bid_fidstringRequiredExample: bid_xxxx
statusstring · enumRequiredExample: OpenPossible values:
get/v2/spot/bids/{bid_fid}/status
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 Bid History

get

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

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
bid_fidstringRequired
Responses
200

Successful Response

application/json

Response model for bid history.

bid_fidstringRequiredExample: bid_abc123456
get/v2/spot/bids/{bid_fid}/history
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 Auctions

get

Get the Spot availability across all regions.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200

Successful Response

application/json
fidstringRequiredExample: auc_abc123456
instance_typestringRequiredExample: it_abc123456
regionstringRequiredExample: us-central1-a
capacityintegerRequiredExample: 512
last_instance_pricestringRequiredExample: $10.00
lowest_allocated_pricestring · nullableOptionalExample: $15.00
adjustable_memorybooleanRequired
default_image_versionstring · nullableOptionalExample: imgver_abc123456
get/v2/spot/availability
GET /v2/spot/availability HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

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