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

# Pricing

Cedana API for instance type pricing

## GET /v1/pricing/instance-types

> List all instance type pricing configurations

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for instance type pricing","name":"Pricing"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"InstanceTypePricing":{"description":"Instance type pricing configuration","properties":{"capacity_type":{"description":"\"spot\" or \"on-demand\"","type":"string"},"created_at":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"instance_type":{"type":"string"},"ondemand_price_per_hour":{"description":"Hourly cost when running as on-demand","format":"double","type":["number","null"]},"spot_price_per_hour":{"description":"Hourly cost when running as spot","format":"double","type":["number","null"]},"updated_at":{"format":"date-time","type":"string"}},"required":["id","instance_type","capacity_type","created_at","updated_at"],"type":"object"},"HttpError":{"description":"Standard JSON error body for all 4xx/5xx responses.\n\nHandlers return plain-text errors internally; [`normalize_error_response`]\nconverts anything the stack produces (handlers, extractors, the auth layer)\nto this shape, so generated SDK clients can rely on a single error schema.","properties":{"message":{"description":"Human-readable description of what went wrong","type":"string"}},"required":["message"],"type":"object"}}},"paths":{"/v1/pricing/instance-types":{"get":{"operationId":"list_instance_type_pricing","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/InstanceTypePricing"},"type":"array"}}},"description":"Returns all instance type pricing configs"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Database error"},"4XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Client error"},"5XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Server error"}},"summary":"List all instance type pricing configurations","tags":["Pricing"]}}}}
```

## PUT /v1/pricing/instance-types

> Create or update instance type pricing

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for instance type pricing","name":"Pricing"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"UpsertInstanceTypePricingRequest":{"description":"Request to create or update instance type pricing","properties":{"capacity_type":{"description":"\"spot\" or \"on-demand\"","type":"string"},"instance_type":{"type":"string"},"ondemand_price_per_hour":{"description":"Hourly cost when running as on-demand","format":"double","type":["number","null"]},"spot_price_per_hour":{"description":"Hourly cost when running as spot","format":"double","type":["number","null"]}},"required":["instance_type","capacity_type"],"type":"object"},"InstanceTypePricing":{"description":"Instance type pricing configuration","properties":{"capacity_type":{"description":"\"spot\" or \"on-demand\"","type":"string"},"created_at":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"instance_type":{"type":"string"},"ondemand_price_per_hour":{"description":"Hourly cost when running as on-demand","format":"double","type":["number","null"]},"spot_price_per_hour":{"description":"Hourly cost when running as spot","format":"double","type":["number","null"]},"updated_at":{"format":"date-time","type":"string"}},"required":["id","instance_type","capacity_type","created_at","updated_at"],"type":"object"},"HttpError":{"description":"Standard JSON error body for all 4xx/5xx responses.\n\nHandlers return plain-text errors internally; [`normalize_error_response`]\nconverts anything the stack produces (handlers, extractors, the auth layer)\nto this shape, so generated SDK clients can rely on a single error schema.","properties":{"message":{"description":"Human-readable description of what went wrong","type":"string"}},"required":["message"],"type":"object"}}},"paths":{"/v1/pricing/instance-types":{"put":{"operationId":"upsert_instance_type_pricing","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertInstanceTypePricingRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceTypePricing"}}},"description":"Returns the created/updated pricing config"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Invalid request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Database error"},"4XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Client error"},"5XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Server error"}},"summary":"Create or update instance type pricing","tags":["Pricing"]}}}}
```

## GET /v1/pricing/instance-types/available

> Get distinct instance types from nodes (for auto-populating the UI)

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for instance type pricing","name":"Pricing"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"HttpError":{"description":"Standard JSON error body for all 4xx/5xx responses.\n\nHandlers return plain-text errors internally; [`normalize_error_response`]\nconverts anything the stack produces (handlers, extractors, the auth layer)\nto this shape, so generated SDK clients can rely on a single error schema.","properties":{"message":{"description":"Human-readable description of what went wrong","type":"string"}},"required":["message"],"type":"object"}}},"paths":{"/v1/pricing/instance-types/available":{"get":{"operationId":"list_available_instance_types","responses":{"200":{"content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array"}}},"description":"Returns distinct instance types from nodes"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Database error"},"4XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Client error"},"5XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Server error"}},"summary":"Get distinct instance types from nodes (for auto-populating the UI)","tags":["Pricing"]}}}}
```

## DELETE /v1/pricing/instance-types/{instance\_type}

> Delete instance type pricing by instance type

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for instance type pricing","name":"Pricing"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"HttpError":{"description":"Standard JSON error body for all 4xx/5xx responses.\n\nHandlers return plain-text errors internally; [`normalize_error_response`]\nconverts anything the stack produces (handlers, extractors, the auth layer)\nto this shape, so generated SDK clients can rely on a single error schema.","properties":{"message":{"description":"Human-readable description of what went wrong","type":"string"}},"required":["message"],"type":"object"}}},"paths":{"/v1/pricing/instance-types/{instance_type}":{"delete":{"operationId":"delete_instance_type_pricing","parameters":[{"description":"Instance type to delete pricing for","in":"path","name":"instance_type","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Pricing deleted successfully"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Pricing not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Database error"},"4XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Client error"},"5XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Server error"}},"summary":"Delete instance type pricing by instance type","tags":["Pricing"]}}}}
```
