Scan

paygent scan walks a codebase, finds every AI provider call that is not yet metered, and writes an integration plan for them.

paygent scan

$paygent scan .
FILE LINE PROVIDER KIND FUNCTION
generator.py 340 Google Gemini LLM _generate_structured
research.py 47 Google Gemini LLM research_topic
2 call(s) to instrument across 2 file(s).
Integration plan written to:
paygent_module/paygent_integration_prompt.md
FlagDescription
--copyCopy the integration plan to the clipboard.
--print-promptWrite the plan to stdout instead of the table.
--dynamic-customerThread a per-request customer ID through the plan.
--provider <name>Only report this provider.
--no-writeReport without writing paygent_module/.
--quietPrint only the count.
--out-dir <path>Write results somewhere else.

The scan is read-only. Nothing is sent anywhere, no credentials are needed, and no source file is modified.

What It Detects

121 detectors across Python, JavaScript, TypeScript, and Go.

CategoryProviders
LLMOpenAI, Anthropic, Gemini, Vertex AI, Groq, Cohere, Mistral, Together, Replicate, Ollama, OpenRouter, DeepInfra
FrameworksLangChain, LangGraph, LlamaIndex
Speech-to-textDeepgram, AssemblyAI, Whisper, Google Cloud, Azure, Rev AI, Speechmatics, Amazon Transcribe, Gladia, Soniox, Vosk
Text-to-speechElevenLabs, Cartesia, Amazon Polly, PlayHT, OpenAI, Google Cloud, Azure, Murf, Resemble, LMNT, Kokoro, Rime, Speechify
Speech-to-speechLiveKit, Vapi, OpenAI Realtime, Gemini Live
VideoOpenAI Sora, Google Veo, RunwayML

Files already reporting usage are skipped, as are node_modules, .venv, dist, and build.

Getting the Plan

$paygent scan . --copy

The plan proposes agents, asks the questions that cannot be inferred from source code, then gives the exact commands to create everything and instrument the calls.

Multi-Tenant Apps

On a terminal the scan asks whether your customer ID is resolved per request. Skip the question with the flag:

$paygent scan . --dynamic-customer

The plan then asks which variable holds the customer ID and threads it through every usage call.

In CI

Fail a build that introduces an unmetered call:

$if [ "$(paygent scan . --no-write --output json | jq '.total_detections')" -gt 0 ]; then
$ echo "Unmetered AI calls introduced"
$ exit 1
$fi