Analyze Beam.ai agent credit consumption per execution path. Load when user says 'credit analysis', 'beam credit analysis', 'agent credit consumption', 'how many credits does this agent use', 'cost per path', 'analyze agent credits', 'credit breakdown', or provides a Beam agent URL and asks about credits or cost.
Analyze a Beam.ai agent's credit consumption and cost across all execution paths, based on the latest Beam pricing model.
Given a Beam agent URL (or graph JSON), this skill:
Pricing source: Beam Credits (New Agent OS)
Time Estimate: 2-3 minutes
Ask user for the Beam agent URL. Accepted formats:
https://app.beam.ai/{workspace_id}/{agent_id}/flowhttps://app.enterprise.beam.ai/{workspace_id}/{agent_id}/flowIf URL contains enterprise.beam, the script auto-detects and uses https://api.enterprise.beamstudio.ai.
Ask if any models in the agent have been changed from their defaults. Common scenario: a node originally using Gemini 3 Pro was switched to GPT 5.2.
If overrides exist, pass them to the script as --model-override OLD=NEW.
Example: --model-override GEMINI_3_PRO=GPT_5_2
Check that BEAM_API_KEY exists in .env:
grep "BEAM_API_KEY" .env
If missing, ask user to provide it and add to .env.
Skip this step if user provides a --graph-file instead of a URL.
Execute the analysis script:
From URL:
python3 03-skills/beam-credit-analysis/scripts/analyze_agent_credits.py "AGENT_URL" --model-override GEMINI_3_PRO=GPT_5_2
From local graph file:
python3 03-skills/beam-credit-analysis/scripts/analyze_agent_credits.py --graph-file ./path/to/graph.json
With custom output directory:
python3 03-skills/beam-credit-analysis/scripts/analyze_agent_credits.py "AGENT_URL" --output ./custom/path
For JSON output (programmatic):
python3 03-skills/beam-credit-analysis/scripts/analyze_agent_credits.py "AGENT_URL" --json
The script generates a markdown file containing:
Show the user:
Arguments:
| Argument | Required | Description |
|---|---|---|
url | Yes* | Beam agent URL |
--workspace-id | Alt* | Workspace ID (if not using URL) |
--agent-id | Alt* | Agent ID (if not using URL) |
--graph-file | Alt* | Path to local graph JSON (skip API) |
--base-url | No | API base URL override |
--output | No | Output directory |
--model-override | No | Model name override (repeatable) |
--pricing-file | No | Custom pricing.json path |
--json | No | Output raw JSON instead of markdown |
*One of: URL, workspace+agent IDs, or graph-file is required.
Exit codes:
0 = Success1 = Error (auth, network, missing config)The pricing reference is stored at references/pricing.json. To update:
references/pricing.json with new rateslast_updated field in _metaThe script supports both UPPER_CASE and lower-case model name formats for flexibility.
| Error | Cause | Solution |
|---|---|---|
| BEAM_API_KEY not found | Missing from .env | Add to .env file |
| Auth failed (401) | Invalid or expired API key | Check BEAM_API_KEY |
| Graph fetch failed (404) | Invalid agent/workspace ID | Verify URL is correct |
| No paths found | Graph has no entry nodes | Check agent is properly configured |
| Model not in pricing | New model not yet in pricing.json | Update pricing.json or use --model-override |
get-beam-agent-graph — Fetch and save agent graph JSON (used internally)calculate-beam-agent-pricing — Design node architecture and calculate pricing from requirements