> For the complete documentation index, see [llms.txt](https://docs.mithril.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mithril.ai/compute-api/compute-api-reference/pricing.md).

# Pricing

## Get Current Prices V2

> Get current pricing information for an instance type.\
> \
> Returns the current spot price, reserved price, and minimum price for a given\
> instance type, optionally filtered by region.

```json
{"openapi":"3.1.0","info":{"title":"Mithril","version":"1.0.0"},"servers":[{"url":"https://api.mithril.ai"}],"security":[{"MithrilAPIKey":[]}],"components":{"securitySchemes":{"MithrilAPIKey":{"type":"http","scheme":"bearer","bearerFormat":"fkey_<key>"}},"schemas":{"CurrentPricesResponse":{"properties":{"spot_price_cents":{"type":"integer","nullable":true},"reserved_price_cents":{"type":"integer","nullable":true},"minimum_price_cents":{"type":"integer","nullable":true},"max_spot_price_cents":{"type":"integer","nullable":true},"max_reserved_price_cents":{"type":"integer","nullable":true},"lowest_allocated_bid_cents":{"type":"integer","nullable":true},"dynamic_win_price_cents":{"type":"integer","nullable":true},"available_capacity":{"type":"integer","nullable":true},"total_capacity":{"type":"integer","nullable":true}},"type":"object","title":"CurrentPricesResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"oneOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/pricing/current":{"get":{"tags":["pricing"],"summary":"Get Current Prices V2","description":"Get current pricing information for an instance type.\n\nReturns the current spot price, reserved price, and minimum price for a given\ninstance type, optionally filtered by region.","operationId":"get_current_prices_v2_v2_pricing_current_get","parameters":[{"name":"instance_type","in":"query","required":true,"schema":{"type":"string","title":"Instance Type"}},{"name":"region","in":"query","required":false,"schema":{"type":"string","nullable":true}},{"name":"instance_quantity","in":"query","required":false,"schema":{"type":"integer","maximum":256,"minimum":1,"default":1,"title":"Instance Quantity"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentPricesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Get Historical Prices V2

> Get historical pricing information for instance types.\
> \
> Returns historical spot and reserved prices over time for instance types,\
> optionally filtered by specific instance type and region.

```json
{"openapi":"3.1.0","info":{"title":"Mithril","version":"1.0.0"},"servers":[{"url":"https://api.mithril.ai"}],"security":[{"MithrilAPIKey":[]}],"components":{"securitySchemes":{"MithrilAPIKey":{"type":"http","scheme":"bearer","bearerFormat":"fkey_<key>"}},"schemas":{"HistoricalPricesResponseModel":{"properties":{"series":{"items":{"$ref":"#/components/schemas/HistoricalPriceSeriesModel"},"type":"array","title":"Series"},"complete":{"type":"boolean","title":"Complete","default":true},"show_disabled_regions":{"type":"boolean","title":"Show Disabled Regions","default":false}},"type":"object","required":["series"],"title":"HistoricalPricesResponseModel","description":"Response model for historical pricing data."},"HistoricalPriceSeriesModel":{"properties":{"instance_type":{"type":"string","title":"Instance Type"},"region":{"type":"string","title":"Region"},"timestamps":{"items":{"type":"string","format":"datetime"},"type":"array","title":"Timestamps"},"spot_prices":{"items":{"type":"string"},"type":"array","title":"Spot Prices"},"reserved_prices":{"items":{"type":"string"},"type":"array","title":"Reserved Prices"},"region_disabled":{"type":"boolean","title":"Region Disabled","default":false}},"type":"object","required":["instance_type","region","timestamps","spot_prices","reserved_prices"],"title":"HistoricalPriceSeriesModel","description":"A single time-series of prices for one instance type in one region."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"oneOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/pricing/history":{"get":{"tags":["pricing"],"summary":"Get Historical Prices V2","description":"Get historical pricing information for instance types.\n\nReturns historical spot and reserved prices over time for instance types,\noptionally filtered by specific instance type and region.","operationId":"get_historical_prices_v2_v2_pricing_history_get","parameters":[{"name":"instance_types","in":"query","required":false,"schema":{"type":"string","nullable":true}},{"name":"region","in":"query","required":false,"schema":{"type":"string","nullable":true}},{"name":"num_samples","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":-1,"default":100,"title":"Num Samples"}},{"name":"start_time","in":"query","required":false,"schema":{"type":"string","format":"datetime","nullable":true}},{"name":"end_time","in":"query","required":false,"schema":{"type":"string","format":"datetime","nullable":true}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoricalPricesResponseModel"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mithril.ai/compute-api/compute-api-reference/pricing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
