---
title: "Create cost basis"
method: POST
path: "/openmeter/currencies/custom/{currencyId}/cost-bases"
tags: ["OpenMeter Currencies"]
---

# Create cost basis

`POST /openmeter/currencies/custom/{currencyId}/cost-bases`

## Request

- Base URL: `http://localhost:8888/api/v3`
- URL: `http://localhost:8888/api/v3/openmeter/currencies/custom/{currencyId}/cost-bases`
- Auth: none declared

Create a cost basis for a currency.

## Path parameters

- `currencyId` string, required: ULID (Universally Unique Lexicographically Sortable Identifier).

## Request body

- CreateCostBasisRequest: CostBasis create request.
  - `fiat_code` string, required: Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. Custom three-letter currency codes are also supported for convenience.
  - `rate` string, required: Numeric represents an arbitrary precision number.
  - `effective_from` string, date-time: [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
  - `effective_to` string, date-time: [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.

## Response `201`

CostBasis created response.

- BillingCostBasis: Describes currency basis supported by billing system.
  - `id` string, required: ULID (Universally Unique Lexicographically Sortable Identifier).
  - `fiat_code` string, required: Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. Custom three-letter currency codes are also supported for convenience.
  - `rate` string, required: Numeric represents an arbitrary precision number.
  - `effective_from` string, date-time: [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
  - `effective_to` string, date-time: [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
  - `created_at` string, date-time, required: [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden

## Changes

- **2026-07-01** (v3) `3ce860a04553`: 2 info
  - added the new optional request property `effective_to`
  - added the optional property `effective_to` to the response with the `201` status
- **2026-06-18** (v3) `8ca194cd4b6f`: 2 info
  - api tag `OpenMeter Currencies` added
  - api tag `OpenMeter Billing` removed
- **2026-05-11** (v3) `9d0042cb3815`: 2 warning, 2 info
  - removed the request property `effective_to`
  - removed the optional property `effective_to` from the response with the `201` status
  - api tag `OpenMeter Billing` added
  - api tag `OpenMeter Currencies` removed

[Operation history](https://skmtc.dev/openmeterio/apis/openmeter-api/changes/openmeter/currencies/custom/:currencyId/cost-bases/post.md)

---

[API](https://skmtc.dev/openmeterio/apis/openmeter-api.md) · [All operations](https://skmtc.dev/openmeterio/apis/openmeter-api/llms.txt) · [OpenAPI document](https://skmtc.dev/openmeterio/apis/openmeter-api/revisions/356d985e7530?raw)
