{"record":{"id":"9ec3a0b03fcf238e","repo":"abi/screenshot-to-code","slug":"live-api-calls-are-disabled-by-default-re-run-wit","errorCode":null,"errorMessage":"Live API calls are disabled by default. Re-run with --live to opt in.","messagePattern":"Live API calls are disabled by default\\. Re-run with --live to opt in\\.","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"warning","filePath":"backend/evals/asset_extraction_benchmark.py","lineNumber":846,"sourceCode":"    parser.add_argument(\n        \"--live\",\n        action=\"store_true\",\n        help=\"Required acknowledgement that this command makes paid Gemini API calls.\",\n    )\n    parser.add_argument(\"--output-dir\", type=Path)\n    parser.add_argument(\n        \"--iou-threshold\",\n        type=float,\n        default=DEFAULT_IOU_THRESHOLD,\n    )\n    return parser.parse_args()\n\n\nasync def main() -> None:\n    load_dotenv(Path(\".env\"))\n    args = parse_args()\n    if not args.live:\n        raise SystemExit(\n            \"Live API calls are disabled by default. Re-run with --live to opt in.\"\n        )\n    if not 0 <= args.iou_threshold <= 1:\n        raise SystemExit(\"--iou-threshold must be between 0 and 1\")\n    api_key = os.environ.get(\"GEMINI_API_KEY\")\n    if not api_key:\n        raise SystemExit(\"Missing GEMINI_API_KEY\")\n    output_dir = args.output_dir or (\n        DEFAULT_OUTPUT_ROOT / time.strftime(\"%Y%m%d_%H%M%S\")\n    )\n    await run_benchmark(\n        api_key=api_key,\n        output_dir=output_dir,\n        iou_threshold=args.iou_threshold,\n    )\n\n\nif __name__ == \"__main__\":","sourceCodeStart":828,"sourceCodeEnd":864,"githubUrl":"https://github.com/abi/screenshot-to-code/blob/d026163f586dfa8c5c10d28c36edd59a9d3b0e88/backend/evals/asset_extraction_benchmark.py#L828-L864","documentation":"SystemExit raised in the asset-extraction benchmark CLI's main() when the script is run without --live. Live Gemini API calls cost money, so the benchmark refuses to run by default; --live is an explicit opt-in flag parsed by parse_args().","triggerScenarios":"Running `python asset_extraction_benchmark.py <args>` without passing --live — any invocation using default or partially specified flags.","commonSituations":"New contributor running the benchmark for the first time, or a cron/CI job configured before the opt-in flag existed.","solutions":["Re-run with --live if you intend real API calls (and have GEMINI_API_KEY set).","If you wanted a dry run, use whatever offline mode the script exposes; otherwise there is none by design."],"exampleFix":"# before\npython asset_extraction_benchmark.py --output-dir out\n\n# after\npython asset_extraction_benchmark.py --live --output-dir out","handlingStrategy":"validation","validationCode":"if not args.live:\n    print(\"Refusing to run: pass --live to enable real Gemini API calls\")\n    sys.exit(2)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read the CLI help before running cost-incurring benchmarks.","Document the --live requirement in CI job definitions so runs never fail at 2am.","Keep the default non-live so accidental invocations cost nothing."],"tags":["cli","opt-in","benchmark","cost-control"],"backgroundTag":null,"analyzedSha":"d026163f586dfa8c5c10d28c36edd59a9d3b0e88","analyzedAt":"2026-08-14T22:02:06.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}