> 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},"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}},"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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
