> ## Documentation Index
> Fetch the complete documentation index at: https://docs.costgraph.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> CostGraph Pricing API

The CostGraph Pricing API provides real-time cloud instance pricing and cost optimization recommendations across multiple providers, and lets you publish your own marketplace rates for anything without a public price.

The API is versioned under `/v1`. The unprefixed routes from earlier releases still work unchanged, but they are no longer documented; new callers should use `/v1` throughout.

## Supported Cloud Providers

| Provider     | Service             | Regions     | Pricing Type             |
| ------------ | ------------------- | ----------- | ------------------------ |
| AWS          | EC2 instances       | All regions | On-demand, Reserved      |
| Azure        | Virtual Machines    | All regions | On-demand, Reserved      |
| GCP          | Compute Engine      | All regions | On-demand, Committed Use |
| DigitalOcean | Droplets            | All regions | Standard, Premium        |
| Hetzner      | Cloud instances     | All regions | Standard                 |
| OVH          | Instances           | All regions | On-demand, Reserved      |
| PlanetScale  | Databases           | All regions | On-demand                |
| STACKIT      | Compute and volumes | All regions | On-demand                |
| Linode       | Instances           | All regions | On-demand                |

## Marketplace prices

For machines, volumes, databases or models without a public price, publish
your own rates on the marketplace and pin resources to them with the
`costgraph.ai/pricing-id.compute` and `costgraph.ai/pricing-id.storage`
labels. A rate is upserted on its natural key: re-posting the same key with a
new cost keeps its id and reprices everything already pinned to it.

### Model prices are per token bucket

Model tokens are not one price. Every bucket is priced separately, so one model
carries one price per bucket, each with its own `unit_price_per_mtok` covering
that bucket alone - never a blended input and output rate:

| `token_bucket` | Covers                                                                     |
| -------------- | -------------------------------------------------------------------------- |
| `input`        | Prompt tokens read fresh                                                   |
| `output`       | Tokens the model generates                                                 |
| `cache_read`   | Prompt tokens served from a prompt cache, usually far cheaper than `input` |
| `cache_write`  | Prompt tokens written into the cache, usually dearer than `input`          |

Publish one entry per bucket you charge for. A bucket you leave out has no rate,
and usage in it resolves to no price rather than to zero, so a model priced for
`input` and `output` alone reports nothing for cached prompt tokens.

`token_bucket` identifies the price alongside the model, host and region, so it
cannot be patched: delete the price and publish a new one to move a rate to a
different bucket. Filter reads with the `token_bucket` query parameter to pull
back one bucket at a time.

## Get Started

<CardGroup cols={3}>
  <Card title="SDKs" icon="code" href="/pricing-api/SDKs/install">
    Install the Go or TypeScript client and start querying pricing data.
  </Card>

  <Card title="Authentication" icon="key" href="/api-reference/authentication">
    Get your API key and authenticate requests.
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/endpoint/v1-pricing-compute">
    Browse the raw API endpoints.
  </Card>
</CardGroup>
