Nodaro Docs
DocumentationNode ReferenceModelsAI Agents (MCP)DevelopersSelf-hostingResearch
TypeScript SDK

Models and credits

List the AI models a Nodaro instance offers with client.models, read your credit balance, and look up the price of a model before you run it.

client.models returns the catalog of AI models a Nodaro instance offers, and client.credits returns your credit balance and the price of any model. Use them together to show users which models they can pick and what each run costs. The methods call the same endpoints as the Credits REST API. Prices and balances exist on Nodaro Cloud; self-hosted Community and Business installs have no credit system. See Credits.

Methods

MethodWhat it does
models.list(opts?)List the models, grouped by kind and maker
credits.balance()Read your credit balance and tier
credits.modelCosts(ids)Look up the credit price of up to 50 models or variants

client.models

models.list(opts?)

Returns the model catalog (GET /v1/models), grouped by kind (image, video, audio) and by maker. Each model has its capabilities, its credit prices on Nodaro Cloud, and short prompt tips. The endpoint is public, and the server caches the answer for 5 minutes. The MCP list_models tool returns the same data.

list(opts?: {
  kind?: "image" | "video" | "audio"
  mode?: string
  family?: string
  featuredOnly?: boolean
}): Promise<ModelsListResult>

Prop

Type

const catalog = await client.models.list({ kind: "video", mode: "i2v" })

for (const section of catalog.sections) {
  for (const family of section.families) {
    for (const model of family.models) {
      console.log(family.family, model.id, model.durations, model.pricing?.[0]?.credits)
    }
  }
}

The result has sections, one per kind, each with families of models; recommendations, lists of model ids for common jobs; and totalModels. Each model has these fields:

FieldTypeDescription
idstringThe model id, for the provider parameter of a node run.
label, descriptionstringThe display name and a short description.
modesstring[]What the model does, such as t2i, i2i, t2v or i2v.
useCasesstring[]Jobs the model suits.
aspectRatios, resolutions, qualities, durationsarraysThe values the model accepts, where they apply.
featuresstring[]Extra capabilities.
pricing{ identifier, credits, note? }[]The credit price of each variant. Nodaro Cloud only.
featuredbooleanWhether the model is featured.
promptTipsstring[]Short prompting advice for the model.
doctrineCoveredbooleantrue only when Nodaro has sourced prompting guidance for the model's family. Show a "maker guidance" badge only when it is true.

The same catalog is on the Models pages. For advice on which model to use, read Choosing a model.

client.credits

credits.balance()

Returns your credit balance and tier (GET /v1/user/credits). Throws UnauthorizedError when no user is signed in.

balance(): Promise<UserBalance>
const balance = await client.credits.balance()
console.log(`${balance.total} credits (${balance.effectiveTier})`)
FieldTypeDescription
totalnumberThe credits you can spend now.
subscriptionnumberCredits from the current subscription period.
topupnumberCredits you bought separately.
dailySpentnumberCredits spent today.
dailyLimitnumber | nullThe daily spending limit, or null for none.
monthlyAllocationnumberCredits granted per billing period.
tierstringThe stored subscription tier, such as "free" or "pro".
effectiveTierstringThe tier actually applied. "payg" means pay-as-you-go: no subscription, but bought credits, with every model, no watermark and no daily limit.
featuresRecord<string, unknown>The features of the tier.
periodEndstring | nullThe end of the billing period, as an ISO 8601 date.
appCreditsAllowancenumberCredits earned by running apps, on the free tier.
externalWallet{ available: number | null }Present when the deployment uses a shared external wallet. null means the amount is unavailable. Do not show total in its place. See External wallet.

Prefer effectiveTier over tier when you decide what to show.

credits.modelCosts(ids)

Looks up the credit price of models and their variants in one call (POST /v1/credits/model-costs). It checks up to the first 50 identifiers.

modelCosts(ids: string[]): Promise<{
  data: Record<string, number>
  missing: string[]
  errors: string[]
}>

Prop

Type

const { data, missing } = await client.credits.modelCosts([
  "nano-banana-pro",
  "nano-banana-pro:4K",
  "seedance-2-fast:8s:720p",
])
console.log(data["nano-banana-pro:4K"])
if (missing.length) console.warn("No price for:", missing)
  • data maps each priced identifier to its credit price.
  • missing lists identifiers that have no price. Show a dash for them.
  • errors lists identifiers whose lookup failed. The other prices still arrive.

The identifiers of each model are in the pricing field of models.list() and on each model's page. Settings such as quality, resolution and duration change the price, so name the variant the run will use. The price at run time is checked again when the run starts, so this call is a preview.

Show models with their prices

Build a model picker for one node, with the price next to each model:

const { data: node } = await client.nodes.get("generate-video")
const { data: prices } = await client.credits.modelCosts(node.providers ?? [])

const options = (node.providers ?? []).map((id) => ({
  id,
  price: prices[id] ?? null, // null: no price on this instance
}))

Omit provider in a run to use the node's default model. When a user picks a model, send its id as provider to client.nodes.runAndWait().

Frequently asked questions

Last updated on

On this page