OpenMeter Customers
Create a new credit grant
Changed onPre-release Endpoint This endpoint is currently in beta and is subject to change.
Create a new credit grant. A credit grant represents an allocation of prepaid credits to a customer.
post/v3/openmeter/customers/{customerId}/credits/grants
Request
- Base URL: https://global.api.konghq.com
- URL: https://global.api.konghq.com/v3/openmeter/customers/{customerId}/credits/grants
- Auth: one of:
- HTTP bearer
- HTTP bearer
- HTTP bearer
- HTTP bearer
Path parameters
customerIdstring required
ULID (Universally Unique Lexicographically Sortable Identifier).
Example:01G65Z755AFWAKHE12NY0CQ9FH
Request body
Example request
{
"labels": {
"env": "test"
},
"currency": "USD",
"purchase": {
"currency": "USD",
"cost_basis": {
"fiat_currency": "USD"
}
},
"tax_config": {
"code": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH"
}
},
"filters": {
"features": [
"input_tokens",
"output_tokens"
],
"plans": [
{
"key": "resource_key"
}
]
},
"effective_at": "2023-01-01T01:01:01.001Z",
"expires_after": "P1Y",
"key": "019ae40f-4258-7f15-9491-842f42a7d6ac"
}Response
CreditGrant created response.
Example response
{
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"labels": {
"env": "test"
},
"created_at": "2023-01-01T01:01:01.001Z",
"updated_at": "2023-01-01T01:01:01.001Z",
"deleted_at": "2023-01-01T01:01:01.001Z",
"currency": "USD",
"purchase": {
"currency": "USD",
"resolved_cost_basis": {
"fiat_currency": "USD",
"cost_basis_id": "01G65Z755AFWAKHE12NY0CQ9FH",
"resolved_at": "2023-01-01T01:01:01.001Z"
}
},
"tax_config": {
"code": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH"
}
},
"invoice": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"line": {
"id": "01G65Z755AFWAKHE12NY0CQ9FH"
}
},
"filters": {
"features": [
"input_tokens",
"output_tokens"
],
"plans": [
{
"key": "resource_key"
}
]
},
"effective_at": "2023-01-01T01:01:01.001Z",
"key": "019ae40f-4258-7f15-9491-842f42a7d6ac",
"expires_at": "2023-01-01T01:01:01.001Z",
"voided_at": "2023-01-01T01:01:01.001Z"
}Changes
- breaking
added to the
/response propertyoneOflist for the response status - warning
added the new
key_invalidenum value to the//////response property for the response status - warning
added the new
uniqueenum value to the//////response property for the response status
- breaking
- info
added the new optional request property
/ - info
added the optional property
/to the response with the status
- info