Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
getcargohq avatar

Cargo Billing

  • 3.4k installs
  • 15 repo stars
  • Updated August 3, 2026
  • getcargohq/cargo-skills

cargo-billing is an agent skill from getcargohq/cargo-skills that helps developers integrate Cargo billing and subscription payment flows into backend services and agent-driven product workflows.

About

Reports billing analytics, credit usage, subscription details, and invoice history for a Cargo workspace. A developer uses it when checking usage costs or managing credits.

  • Usage reports and credit management
  • Subscription status and invoice history

Cargo Billing by the numbers

  • 3,359 all-time installs (skills.sh)
  • +535 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #45 of 1,106 Finance & Trading skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/getcargohq/cargo-skills --skill cargo-billing

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs3.4k
repo stars15
Last updatedAugust 3, 2026
Repositorygetcargohq/cargo-skills

How do you integrate Cargo billing into an API?

Pull usage metrics, check subscription status, view invoices, and manage credits for a Cargo workspace via the CLI.

Who is it for?

Backend developers adding Cargo-powered subscription billing to APIs or agent-built SaaS products.

Skip if: Projects using Stripe, Paddle, or another billing provider, or apps with no payment or subscription requirements.

When should I use this skill?

The user asks to add Cargo billing, subscriptions, payment flows, or plan management to a backend service.

What you get

Cargo billing integration code, subscription plan hooks, and payment event handlers.

  • billing integration code
  • subscription webhook handlers

Files

SKILL.mdMarkdownGitHub ↗

Cargo CLI — Billing

Billing and credit management: pulling usage metrics, checking subscription status, viewing invoices, and managing credits.

See references/response-shapes.md for full JSON response structures.
See references/troubleshooting.md for common errors and how to fix them.
See references/examples/usage-metrics.md for usage metric and subscription examples.

Prerequisites

See `../cargo/references/prerequisites.md` for install, login (--oauth / --token), JSON output conventions, and error shapes. Verify the session with cargo-ai whoami before running any of the commands below.

Admin-only: every command in this skill requires a token with admin access on the workspace. Non-admin tokens return {"errorMessage":"forbidden"}.

Discover resources first

Usage metrics can be filtered and grouped by resource UUID. Discover them before querying.

cargo-ai orchestration play list            # all plays (name, workflowUuid)
cargo-ai orchestration tool list            # all tools (name, workflowUuid)
cargo-ai ai agent list                     # all agents (uuid, name)
cargo-ai connection connector list          # all connectors (uuid, name, integrationSlug)
cargo-ai storage model list                # all models (uuid, name, slug)

Quick reference

cargo-ai billing usage get-metrics --from <YYYY-MM-DD> --to <YYYY-MM-DD>
cargo-ai billing usage get-metrics --from <YYYY-MM-DD> --to <YYYY-MM-DD> --group-by workflow_uuid
cargo-ai billing subscription get
cargo-ai billing subscription get-invoices
cargo-ai billing subscription create-portal-session

Estimating cost before running a batch

Before triggering a large batch, estimate credit consumption to avoid unexpected charges.

Step 1 — Check current credit balance:

cargo-ai billing subscription get
# → subscriptionAvailableCreditsCount - subscriptionCreditsUsedCount = remaining credits

Step 2 — Estimate cost from a sample run:

Run the workflow on a single record first and measure credits consumed:

# Run on one record
cargo-ai orchestration run create --workflow-uuid <uuid> --data '{...}'
# → poll to completion

# Check credits used for that run
cargo-ai billing usage get-metrics \
  --from <today> --to <today> \
  --workflow-uuid <uuid>
# → .totalUsage = credits consumed today for this workflow

Step 3 — Project batch cost:

estimated_cost = credits_per_record × number_of_records

Compare against subscriptionAvailableCreditsCount - subscriptionCreditsUsedCount before proceeding.

Step 4 — Monitor during the batch:

# Check running costs mid-batch
cargo-ai billing usage get-metrics \
  --from <start-date> --to <today> \
  --workflow-uuid <uuid>

Cost levers:

ActionEffect
Use a cheaper model (e.g. gpt-4o-mini vs gpt-4o)Significant reduction for AI nodes
Add filter nodes early in the graphSkip ineligible records before expensive connector calls
Set fallbackOnFailure: falseStop the run early on failures instead of continuing to downstream nodes
Reduce maxSteps on agent nodesLimit how many tool calls an agent can make per record

Usage metrics

Pull credit and usage data for any time range, optionally filtered and grouped.

# Basic usage for a period
cargo-ai billing usage get-metrics --from <start-date> --to <end-date>

# Group by dimension
cargo-ai billing usage get-metrics --from <start-date> --to <end-date> --group-by workflow_uuid
cargo-ai billing usage get-metrics --from <start-date> --to <end-date> --group-by connector_uuid
cargo-ai billing usage get-metrics --from <start-date> --to <end-date> --group-by integration_slug
cargo-ai billing usage get-metrics --from <start-date> --to <end-date> --group-by model_uuid
cargo-ai billing usage get-metrics --from <start-date> --to <end-date> --group-by agent_uuid

# Filter by specific resource
cargo-ai billing usage get-metrics --from <start-date> --to <end-date> --workflow-uuid <uuid>
cargo-ai billing usage get-metrics --from <start-date> --to <end-date> --agent-uuid <uuid>
cargo-ai billing usage get-metrics --from <start-date> --to <end-date> --connector-uuid <uuid>
cargo-ai billing usage get-metrics --from <start-date> --to <end-date> --integration-slug <slug>

# Specify unit
cargo-ai billing usage get-metrics --from <start-date> --to <end-date> --unit credits

--group-by values: workflow_uuid, connector_uuid, model_uuid, integration_slug, agent_uuid.

Available filters: --workflow-uuid, --model-uuid, --connector-uuid, --integration-slug, --slug, --agent-uuid. Combine with --group-by and --unit.

Subscription and credits

cargo-ai billing subscription get                    # current plan, credits used/available, period dates
cargo-ai billing subscription get-invoices            # invoice history (amounts in cents)
cargo-ai billing subscription get-credit-card         # card on file
cargo-ai billing subscription create-portal-session   # Stripe portal URL for self-service billing

Remaining credits = subscriptionAvailableCreditsCount - subscriptionCreditsUsedCount from subscription get.

Note: Invoice amounts are returned in cents. Divide by 100 for the dollar value.

Help

Every command supports --help:

cargo-ai billing usage get-metrics --help
cargo-ai billing subscription get --help
cargo-ai billing subscription get-invoices --help

Related skills

How it compares

Use cargo-billing when the payment stack is Cargo; use Stripe or Paddle integration skills for other billing providers.

FAQ

What does cargo-billing help implement?

cargo-billing is a getcargohq agent skill for integrating Cargo billing into backend services. It guides subscription setup, payment event handling, and plan management for APIs and agent-built SaaS products.

When should I use cargo-billing?

Use cargo-billing when a product uses the Cargo billing platform and needs subscription or payment logic wired into backend code. The skill fits active integration work during SaaS feature development.

Finance & Tradingfinancepricing

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.