Miosa.Credits (Miosa v1.0.1)

Copy Markdown View Source

Query credit balance, transaction history, and usage for the authenticated tenant.

Credits are consumed by compute time and AI agent calls. The balance is shared across all computers and sessions for your account.

Example

{:ok, balance} = Miosa.Credits.balance(client)
IO.puts("Credits remaining: #{balance.balance}")

{:ok, txns} = Miosa.Credits.transactions(client, limit: 20)
{:ok, usage} = Miosa.Credits.usage(client)

Summary

Functions

Returns the current credit balance for the authenticated tenant.

Lists credit transactions (debits and credits).

Returns aggregated usage statistics for the tenant.

Functions

balance(client)

Returns the current credit balance for the authenticated tenant.

transactions(client, opts \\ [])

Lists credit transactions (debits and credits).

Options

  • :limit — Maximum number of transactions. Defaults to 50.
  • :offset — Pagination offset. Defaults to 0.
  • :type — Filter by type: "debit", "credit", "promo".

usage(client, opts \\ [])

@spec usage(
  Miosa.Client.t(),
  keyword()
) :: Miosa.Client.result(map())

Returns aggregated usage statistics for the tenant.

Returns a raw map as usage schema varies by plan and time period.