abi/screenshot-to-code · warning · SystemExit

Live API calls are disabled by default. Re-run with --live t

Error message

Live API calls are disabled by default. Re-run with --live to opt in.

What it means

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().

Source

Thrown at backend/evals/asset_extraction_benchmark.py:846

    parser.add_argument(
        "--live",
        action="store_true",
        help="Required acknowledgement that this command makes paid Gemini API calls.",
    )
    parser.add_argument("--output-dir", type=Path)
    parser.add_argument(
        "--iou-threshold",
        type=float,
        default=DEFAULT_IOU_THRESHOLD,
    )
    return parser.parse_args()


async def main() -> None:
    load_dotenv(Path(".env"))
    args = parse_args()
    if not args.live:
        raise SystemExit(
            "Live API calls are disabled by default. Re-run with --live to opt in."
        )
    if not 0 <= args.iou_threshold <= 1:
        raise SystemExit("--iou-threshold must be between 0 and 1")
    api_key = os.environ.get("GEMINI_API_KEY")
    if not api_key:
        raise SystemExit("Missing GEMINI_API_KEY")
    output_dir = args.output_dir or (
        DEFAULT_OUTPUT_ROOT / time.strftime("%Y%m%d_%H%M%S")
    )
    await run_benchmark(
        api_key=api_key,
        output_dir=output_dir,
        iou_threshold=args.iou_threshold,
    )


if __name__ == "__main__":

View on GitHub (pinned to d026163f58)

Solutions

  1. Re-run with --live if you intend real API calls (and have GEMINI_API_KEY set).
  2. If you wanted a dry run, use whatever offline mode the script exposes; otherwise there is none by design.

Example fix

# before
python asset_extraction_benchmark.py --output-dir out

# after
python asset_extraction_benchmark.py --live --output-dir out
Defensive patterns

Strategy: validation

Validate before calling

if not args.live:
    print("Refusing to run: pass --live to enable real Gemini API calls")
    sys.exit(2)

Prevention

When it happens

Trigger: Running `python asset_extraction_benchmark.py <args>` without passing --live — any invocation using default or partially specified flags.

Common situations: New contributor running the benchmark for the first time, or a cron/CI job configured before the opt-in flag existed.

Related errors


AI-assisted analysis of abi/screenshot-to-code@d026163f58 (2026-08-14). Data as JSON: /api/errors/9ec3a0b03fcf238e. Report an issue: GitHub.