Skip to main content

Do and don’t

DoDon’t
Use the estimate API before generatingAssume all models cost the same
Monitor your balance programmaticallyWait until you get a BSE1004 error to check balance
Purchase credit packs before high-volume runsRely solely on subscription credits for spikes
Review transactions regularly for unexpected chargesIgnore the credits table
Check the model pricing page for costsHard-code cost values in your application

Use the estimate API

Always check the cost before generating, especially for video models where duration, resolution, or audio can affect price:
TypeScript
const estimate = await client.estimate('kling/v1.5-pro', {
  duration: 10,
  resolution: '720p',
  audio: false,
});

if (!estimate.data.credit_balance_can_afford) {
  console.log('Insufficient credits for this generation');
  return;
}

// Safe to proceed
const result = await client.generate('kling/v1.5-pro', {
  generation_prompt: 'A baby seal swimming',
  generation_duration: 10,
});
The estimate endpoint costs nothing and uses no GPU time.

Monitor balance programmatically

Build credit checks into your generation pipeline:
TypeScript
async function generateWithBalanceCheck(
  client: BabySea,
  model: string,
  prompt: string,
) {
  const billing = await client.billing();
  const balance = billing.data.billing_credit_balance;

  if (balance < 1) {
    // Alert your team or pause generation queue
    await notifyLowBalance(balance);
    return;
  }

  return client.generate(model, {
    generation_prompt: prompt,
  });
}
If you need broader usage totals, use GET /v1/usage?days=30 with an API key that has account:read.

Plan for high-volume runs

If you are running batch generations (e.g. generating images for a catalog), calculate the total cost first:
TypeScript
const modelsToGenerate = 500;
const estimate = await client.estimate('bfl/flux-1.1-pro');
const totalCost = estimate.data.cost_per_generation * modelsToGenerate;

console.log(`Total cost: $${totalCost.toFixed(3)}`);
console.log(`Current balance: $${estimate.data.credit_balance.toFixed(3)}`);
console.log(`Can afford: ${estimate.data.credit_balance >= totalCost}`);
Purchase enough credit packs before starting the run. Credit pack purchases are instantaneous after Stripe confirms payment.

Review transactions for anomalies

Check your transactions regularly for:
PatternWhat it might indicate
Many refunds in a rowA model or provider may be experiencing issues
Unexpectedly high chargesA video model generating longer output than expected
Unknown generation IDsA leaked or compromised API key
No charge after reserveA generation stuck in processing
If you see transactions you do not recognize, revoke the API key immediately and review your logs.

Know the audit-trail window

The billing configuration exposes plan-based credit audit trail windows:
PlanCredit audit trail window
Free30 days
Starter90 days
Pro180 days
Scale1 year
Enterprise1 year
Export is not available on the current Credits page, so review the ledger regularly if you depend on the dashboard history.

Additional tips

Use the playground for experimentation

The playground lets you test models interactively before building them into your pipeline. This helps you choose the right model and parameters without writing code.

Compare models before committing

Visit the model pricing page to compare all available models and their costs side by side before integrating a model into your pipeline.

Quick reference

TopicDetail
Check balanceDashboard or GET /v1/user/billing
Preview costGET /v1/estimate/{model_identifier}
Buy creditsBilling page, credit packs section
View transactionsDashboard Credits page, transactions table
Insufficient creditsError BSE1004, HTTP 402