Reservations
Get instance types available for reservation.
Returns the subset of public instance types that are currently eligible for reservation. Instance types can be disabled for reservation via the Unleash reservation-disabled-instance-types feature flag.
Successful Response
it_abc123456h100.80gb.sxm192Intel18008H10080SXM57800InfiniBand840.12GET /v2/reservation/instance-types HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Successful Response
[
{
"fid": "it_abc123456",
"name": "h100.80gb.sxm",
"num_cpus": 192,
"cpu_type": "Intel",
"ram_gb": 1800,
"num_gpus": 8,
"gpu_type": "H100",
"gpu_memory_gb": 80,
"gpu_socket": "SXM5",
"local_storage_gb": 7800,
"network_type": "InfiniBand",
"ib_count": 8,
"bridge_count": 4,
"hourly_price": 0.12
}
]Get pricing offers for a reservation.
Reservation offers are dynamic and the price may change slightly since the time it was generated. You can include an optional "max_unit_price" (which you can set at the quoted price or slightly above it) to ensure your reservation request fails if the new price is above that max.
proj_abc123456it_abc123456us-central1-a2024-01-01T00:00:00Z2024-01-01T00:00:00ZSuccessful Response
Response with all pricing offers available when creating a new reservation.
Validation Error
GET /v2/reservation/quote?project=proj_abc123456&instance_type=it_abc123456®ion=us-central1-a&start_time=2024-01-01T00%3A00%3A00Z&end_time=2024-01-01T00%3A00%3A00Z&quantity=1 HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"offers": [
{
"key": "text",
"display_name": "text",
"unit_price": "text",
"return_buyback_price": "text",
"pause_buyback_price": "text",
"total_price": "text",
"total_etbp_value": "text",
"total_fubp_value": "text",
"option_premium": "text"
}
]
}Get availability information for reservations.
This endpoint supports three different modes for querying availability:
Mode: latest_end_time (default)
Get the latest possible end time for a reservation given a start time and quantity.
Required parameters:
start_time: Desired start time for the reservationquantity: Number of instances neededproject: Project FIDinstance_type: Instance type FIDregion: Region name
Returns: Latest possible end time and availability status
Example:
GET /reservation/availability?
start_time=2024-01-01T00:00:00Z&
quantity=4&
project=proj_01h8x2k9m3n4p5q6r7s8t9u0v&
instance_type=it_01h8x2k9m3n4p5q6r7s8t9u0v&
region=us-central1-aMode: slots
Get all available slots in a time range.
Required parameters:
earliest_start_time: Start of the time range to searchlatest_end_time: End of the time range to searchproject: Project FIDinstance_type: Instance type FIDregion: Region name
Returns: List of available time slots with quantities
Example:
Mode: check
Check if a specific time slot is available for reservation.
Required parameters:
start_time: Start of the desired time slotend_time: End of the desired time slotquantity: Number of instances neededproject: Project FIDinstance_type: Instance type FIDregion: Region name
Returns: Boolean indicating if the slot is available
Example:
Common Parameters
All modes require these parameters:
project: Project FIDinstance_type: Instance type FIDregion: Region name
Authentication
Requires authentication and user must be a member of the specified project.
latest_end_timePossible values: 2024-01-01T00:00:00Z2024-01-01T00:00:00Z2024-01-01T00:00:00Z2024-01-01T00:00:00ZSuccessful Response
2024-01-01T00:00:00Z2024-01-01T00:00:00ZValidation Error
GET /v2/reservation/availability?project=text&instance_type=text®ion=text HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
{
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"quantity": 1
}
]Get all reservations for a project
it_abc123456us-central1-aSuccessful Response
Validation Error
GET /v2/reservation?project=text HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"data": [
{
"fid": "res_abc123456",
"name": "text",
"project": "proj_abc123456",
"created_by": "user_abc123456",
"created_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"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": "Pending",
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"total_price": "$47.76",
"unit_price": "$1.99"
}
],
"next_cursor": "text"
}Create a new reservation.
proj_abc123456it_abc123456us-central1-a2024-01-01T00:00:00Z2024-01-01T00:00:00Z4Successful Response
res_abc123456proj_abc123456user_abc1234562024-01-01T00:00:00Z2024-01-01T00:00:00Z4it_abc123456us-central1-aPendingPossible values: 2024-01-01T00:00:00Z2024-01-01T00:00:00Z$47.76$1.99Validation Error
POST /v2/reservation HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 494
{
"project": "proj_abc123456",
"instance_type": "it_abc123456",
"region": "us-central1-a",
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"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
},
"price_specification": {
"offer_key": "standard",
"max_unit_price": 500
}
}{
"fid": "res_abc123456",
"name": "text",
"project": "proj_abc123456",
"created_by": "user_abc123456",
"created_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"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": "Pending",
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"total_price": "$47.76",
"unit_price": "$1.99"
}Get extension availability for a reservation
res_abc123456Successful Response
2024-01-01T00:00:00ZValidation Error
GET /v2/reservation/{reservation_fid}/extension-availability HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"latest_extension_time": "2024-01-01T00:00:00Z",
"available": true
}Extend a reservation to the requested time.
res_abc1234562024-01-01T00:00:00ZSuccessful Response
res_abc123456proj_abc123456user_abc1234562024-01-01T00:00:00Z2024-01-01T00:00:00Z4it_abc123456us-central1-aPendingPossible values: 2024-01-01T00:00:00Z2024-01-01T00:00:00Z$47.76$1.99Validation Error
POST /v2/reservation/{reservation_fid}/extend HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 103
{
"end_time": "2024-01-01T00:00:00Z",
"price_specification": {
"offer_key": "standard",
"max_unit_price": 500
}
}{
"fid": "res_abc123456",
"name": "text",
"project": "proj_abc123456",
"created_by": "user_abc123456",
"created_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"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": "Pending",
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"total_price": "$47.76",
"unit_price": "$1.99"
}Update a reservation's pause/resume status and/or volumes
res_abc123456Successful Response
res_abc123456proj_abc123456user_abc1234562024-01-01T00:00:00Z2024-01-01T00:00:00Z4it_abc123456us-central1-aPendingPossible values: 2024-01-01T00:00:00Z2024-01-01T00:00:00Z$47.76$1.99Validation Error
PATCH /v2/reservation/{reservation_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 43
{
"paused": true,
"volumes": [
"vol_abc123456"
]
}{
"fid": "res_abc123456",
"name": "text",
"project": "proj_abc123456",
"created_by": "user_abc123456",
"created_at": "2024-01-01T00:00:00Z",
"deactivated_at": "2024-01-01T00:00:00Z",
"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": "Pending",
"start_time": "2024-01-01T00:00:00Z",
"end_time": "2024-01-01T00:00:00Z",
"total_price": "$47.76",
"unit_price": "$1.99"
}Remove and permanently delete instances from this reservation.
You will receive a credit based on your early termination buyback price associated with this reservation and the time remaining in the reservation.
This endpoint does a best effort to termiante all instances, but it can fail to do so for some instances. If you receive a 207, then please see the response for details.
res_abc123456Successfully terminated all instances.
Failed to terminate some instances. See response for details.
The reservation was already ended.
Either the reservation or one of the instances could not be found.
Validation Error
No instance was able to be stopped due to an internal error.
POST /v2/reservation/{reservation_fid}/terminate-instances HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 55
{
"instances": [
"inst_abc123456"
],
"reduce_capacity": true
}No content
Get the activity history for a reservation.
Returns chronological order-level status changes and pricing terms events.
res_abc123456Successful Response
Response model for reservation history.
res_abc123456Validation Error
GET /v2/reservation/{reservation_fid}/history HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"reservation_fid": "res_abc123456",
"events": [
{
"timestamp": "2024-01-01T00:00:00Z",
"event_type": "Placed",
"user_id": "text",
"unit_price_cents": 1,
"pause_credit_cents": 1,
"return_credit_cents": 1
}
]
}Get usage breakdown for a flex reservation.
res_abc123456Successful Response
Validation Error
GET /v2/reservation/{reservation_fid}/usage HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"reservation": {
"fid": "res_abc123456",
"order_name": "text",
"start_date": "2024-01-01T00:00:00Z",
"end_date": "2024-01-01T00:00:00Z",
"status": "Open",
"committed_cost_cents": 1
},
"summary": {
"committed_cost_cents": 1,
"flex_use_credits_cents": 1,
"early_termination_credits_cents": 1,
"net_cost_cents": 1,
"reserved_instance_hours": "text",
"active_instance_hours": "text",
"idle_instance_hours": "text",
"as_of": "2024-01-01T00:00:00Z"
},
"grants": [
{
"fid": "text",
"starts_at": "2024-01-01T00:00:00Z",
"ends_at": "2024-01-01T00:00:00Z",
"quantity": 1,
"unit_price": 1,
"price_credit": 1,
"return_credit": 1
}
],
"pricing_events": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"occurred_at": "2024-01-01T00:00:00Z",
"instance_fid": "inst_abc123456",
"instance_name": "text",
"instance_status": "STATUS_NEW"
}
],
"reservation_events": [
{
"occurred_at": "2024-01-01T00:00:00Z",
"event_type": "Started",
"reservation_name": "text"
}
]
}Last updated