API overview and quickstart
Mithril's Spot API
Mithril currently supports managing Spot Instances, Storage Volumes, and SSH Keys via API. An equivalent API for Reservations is coming soon!
Prerequisites
Create an API key in the Mithril console. Remember to keep this key safe.
Note down your API key - it will look like
fkey_...
Authentication
All API requests require authentication using your API key in the Authorization header:
key = "fkey_your_key_here"
headers = {
"Authorization": f"Bearer {key}"
}Common Operations
1. List Your Projects
First, get a list of projects you have access to:
import requests
response = requests.get(
"https://api.mithril.ai/v2/projects",
headers=headers
)
projects = response.json()2. Creating a Storage Volume
Create a persistent storage volume for your instances:
3. Add or generate SSH key
4. Creating a Spot Bid
Place a bid for Spot instances:
5. Monitor Your Instances
Track the status of your instances:
Tips
Use the
/v2/spot/availabilityendpoint to check current Spot capacity and pricingYou'll need to configure billing on the Mithril Console before you can place bids with the API
For more detailed information about specific endpoints and their parameters, refer to the full API documentation.
Last updated