Ownkube Billing API
The Billing API from Ownkube — 7 operation(s) for billing.
The Billing API from Ownkube — 7 operation(s) for billing.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/ownkube-io:ownkube-io-billing-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Ownkube CLI Billing API
version: 1.15.0
description: API for the Ownkube CLI tool. Authenticate via browser-based flow, then use x-api-key header for subsequent requests.
servers:
- url: /api/cli
security:
- apiKey: []
tags:
- name: Billing
paths:
/v1/wallet:
get:
tags:
- Billing
summary: Get the prepaid wallet balance
description: Returns the live wallet balance (granted, consumed, remaining) plus how much credit was loaded by inflow reason. Check this before deploying on Ownkube Compute — a deploy needs a positive balance.
security:
- apiKey: []
responses:
'200':
description: Wallet balance
content:
application/json:
schema:
$ref: '#/components/schemas/WalletSummaryResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: getV1Wallet
x-operation-id-source: derived
/v1/spend-controls:
get:
tags:
- Billing
summary: Get spend controls (budget cap + alerts)
description: Returns the org's optional monthly budget cap, what happens at the cap, and the spend-alert thresholds.
security:
- apiKey: []
responses:
'200':
description: Spend controls
content:
application/json:
schema:
$ref: '#/components/schemas/SpendControlsResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: getV1SpendControls
x-operation-id-source: derived
put:
tags:
- Billing
summary: Set spend controls (budget cap + alerts)
description: 'Creates or updates the monthly budget cap and spend alerts. Set `budgetAction: pause` to actually cap the bill (suspends compute, data retained, at the cap); `notify` only alerts. Only the fields you pass are changed.'
security:
- apiKey: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateSpendControlsBody'
responses:
'200':
description: Updated spend controls
content:
application/json:
schema:
$ref: '#/components/schemas/SpendControls'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: putV1SpendControls
x-operation-id-source: derived
/v1/credit:
get:
tags:
- Billing
summary: Get account credit status
description: Returns whether Ownkube Compute is available, the live wallet balance, and the wallet top-up minimum.
security:
- apiKey: []
responses:
'200':
description: Credit status
content:
application/json:
schema:
$ref: '#/components/schemas/CreditStatusResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: getV1Credit
x-operation-id-source: derived
/v1/promo/redeem:
post:
tags:
- Billing
summary: Redeem a promo code
description: 'Adds a promo campaign''s credit to the wallet. Each organization and each user can redeem a campaign once. Claiming needs a card on file (added in the dashboard, never charged), and a card claims credit for one organization only. A refusal (unknown code, offer full or ended, already claimed, existing account, no card on file, card already used) returns `200` with `ok: false`, a `reason`, and a user-facing `message`.'
security:
- apiKey: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RedeemPromoBody'
responses:
'200':
description: Redeem result
content:
application/json:
schema:
$ref: '#/components/schemas/RedeemPromoResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: postV1PromoRedeem
x-operation-id-source: derived
/v1/portal:
post:
tags:
- Billing
summary: Open the billing customer portal
description: Creates a customer-portal session and returns a browser `url` to manage payment method, invoices, and subscription. A `412` means the org has no billing account yet (start a plan first).
security:
- apiKey: []
responses:
'200':
description: Portal URL
content:
application/json:
schema:
$ref: '#/components/schemas/CheckoutUrlResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: postV1Portal
x-operation-id-source: derived
/v1/checkout/subscription:
post:
tags:
- Billing
summary: Start a plan subscription checkout
description: Creates a checkout for a monthly plan (Personal or Team). Returns a browser `url` to complete payment; the subscription loads wallet credit each cycle once active.
security:
- apiKey: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionCheckoutBody'
responses:
'200':
description: Checkout URL
content:
application/json:
schema:
$ref: '#/components/schemas/CheckoutUrlResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: postV1CheckoutSubscription
x-operation-id-source: derived
/v1/checkout/top-up:
post:
tags:
- Billing
summary: Top up the prepaid wallet
description: Creates a checkout to add a custom amount of credit to the organization's prepaid wallet. Returns a browser `url` to complete payment; the balance updates once the payment settles. A `400` means the amount is below the top-up minimum.
security:
- apiKey: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TopUpCheckoutBody'
responses:
'200':
description: Checkout URL
content:
application/json:
schema:
$ref: '#/components/schemas/CheckoutUrlResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'412':
description: Precondition failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limited; retry after the Retry-After header's seconds
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
operationId: postV1CheckoutTopUp
x-operation-id-source: derived
components:
schemas:
UpdateSpendControlsBody:
type: object
properties:
monthlyBudgetUsd:
type: number
nullable: true
minimum: 0
exclusiveMinimum: true
maximum: 1000000
description: Monthly spend cap in USD, or null to clear it.
budgetAction:
type: string
enum:
- notify
- pause
description: 'At the cap: ''notify'' alerts only; ''pause'' suspends compute.'
alertsEnabled:
type: boolean
description: Turn spend alerts at the thresholds on or off.
alertThresholdsPct:
type: array
items:
type: integer
minimum: 1
maximum: 100
maxItems: 10
description: Percent-of-budget thresholds that fire a spend alert.
SpendControlsResponse:
type: object
properties:
enabled:
type: boolean
description: Whether Ownkube Compute is available here.
controls:
$ref: '#/components/schemas/SpendControls'
required:
- enabled
- controls
ErrorResponse:
type: object
properties:
error:
type: string
description: Human-readable error message
code:
type: string
description: Machine-readable error code
required:
- error
- code
CreditBalance:
type: object
nullable: true
properties:
grantedUsd:
type: number
consumedUsd:
type: number
remainingUsd:
type: number
overdraftUsd:
type: number
description: How far below zero the balance may run before workloads pause; the overdrawn amount is billed on the next plan invoice. 0 when the plan carries no overage.
exhausted:
type: boolean
required:
- grantedUsd
- consumedUsd
- remainingUsd
- overdraftUsd
- exhausted
description: Live wallet balance, or null if the org has none yet.
CheckoutUrlResponse:
type: object
properties:
url:
type: string
description: Browser checkout URL. Open it to complete payment; the account updates once the payment settles.
required:
- url
SubscriptionCheckoutBody:
type: object
properties:
tier:
type: string
enum:
- personal
- team
description: 'The plan to subscribe to: `personal` ($5/mo) or `team` ($20/mo). Each loads that much wallet credit every cycle.'
required:
- tier
RedeemPromoResponse:
type: object
properties:
ok:
type: boolean
description: 'True when the credit was added. False is a refusal, not an error: see `reason` and `message`.'
amountUsd:
type: number
description: Credit added, in USD (when `ok`).
balance:
allOf:
- $ref: '#/components/schemas/CreditBalance'
- description: Wallet balance after the credit landed (when `ok`).
expiresAt:
anyOf:
- type: string
- type: string
format: date-time
- nullable: true
description: When the unspent part of this credit expires (when `ok`); null when it never does. Usage spends promo credit first.
reason:
type: string
enum:
- not_found
- full
- ended
- not_started
- claimed
- existing_account
- unverified_email
- other_offer
- card_required
- card_used
description: Why the code was refused (when not `ok`).
message:
type: string
description: A user-facing sentence for the refusal (when not `ok`).
required:
- ok
CreditStatusResponse:
type: object
properties:
enabled:
type: boolean
description: Whether Ownkube Compute (and its wallet) is available here.
balance:
$ref: '#/components/schemas/CreditBalance'
topUpMinUsd:
type: number
description: Minimum custom wallet top-up amount, in USD.
topUpMaxUsd:
type: number
nullable: true
description: Largest top-up the plan allows right now, in USD (Pay as you go caps the credit added per rolling 30 days). Null means no cap.
required:
- enabled
- balance
- topUpMinUsd
- topUpMaxUsd
SpendControls:
type: object
nullable: true
properties:
monthlyBudgetUsd:
type: number
nullable: true
description: Optional monthly spend cap, in USD. Null means no budget cap is set.
budgetAction:
type: string
enum:
- notify
- pause
description: 'What happens at the budget cap: `notify` only alerts; `pause` suspends compute (data retained) like wallet exhaustion.'
alertsEnabled:
type: boolean
description: Whether spend alerts fire at the thresholds.
alertThresholdsPct:
type: array
items:
type: number
description: Percent-of-budget thresholds that fire a spend alert.
required:
- monthlyBudgetUsd
- budgetAction
- alertsEnabled
- alertThresholdsPct
description: The org's spend controls, or null when compute is off.
TopUpCheckoutBody:
type: object
properties:
amountUsd:
type: number
minimum: 0
exclusiveMinimum: true
description: Amount to add to the wallet, in USD. Must be at least the top-up minimum (see `topUpMinUsd` on GET /v1/credit).
required:
- amountUsd
WalletSummaryResponse:
type: object
properties:
enabled:
type: boolean
description: Whether Ownkube Compute (and its wallet) is available here.
balance:
$ref: '#/components/schemas/CreditBalance'
loadedInByReason:
type: object
additionalProperties:
type: number
description: Total credit loaded into the wallet, in USD, keyed by inflow reason (e.g. plan load, top-up, promo credit).
topUpMinUsd:
type: number
description: Minimum custom wallet top-up amount, in USD.
required:
- enabled
- balance
- loadedInByReason
- topUpMinUsd
RedeemPromoBody:
type: object
properties:
code:
type: string
minLength: 1
maxLength: 64
description: The promo code, e.g. from a `/login?ref=<code>` link.
required:
- code
securitySchemes:
apiKey:
type: apiKey
in: header
name: x-api-key
description: API key issued by the browser-based CLI authorization flow.