AI agents
Command-line interface
The official kawaa package on npm ships a non-interactive CLI built for scripts, CI/CD pipelines and terminal-based AI coding agents. Every command writes structured data to stdout, keeps diagnostics and JSON errors on stderr, and exits with a deterministic status code.
Install and authenticate
Run npx kawaa directly with Node.js 18 or later, or install the package globally. Set KAWAA_API_KEY in the environment so secrets stay out of shell history and process listings. Issue a dedicated scoped agent key in Settings → API keys.
npm install -g kawaa
export KAWAA_API_KEY=ev_your_key_here
# Read plan, balance and rate limits (free)
kawaa account
# Verify one address (1 credit fresh, 0.5 cached)
kawaa verify someone@example.comIf your agent supports the Model Context Protocol directly (Claude Code, Codex, Cursor, GitHub Copilot, Grok, Antigravity or OpenClaw / Clawbot), you can also connect it to the hosted MCP endpoint without installing anything locally: see MCP server for AI agents.
Commands
The current release on npm is kawaa@0.5.5.
| Command | Since | Cost | What it does |
|---|---|---|---|
kawaa verify <email> | 0.2.0 | 1 credit (0.5 cached) | Verify one address and print the JSON verdict. |
kawaa verify-batch [email...] | 0.2.0 | 1 per unique address (0.5 cached) | Submit a list from arguments, --file <path>, or --file - (stdin). Pass --wait to poll until settled; --max-credits <n> is added in 0.5.4. |
kawaa job <job_id> | 0.2.0 | Free | Read job progress, verdict counts and billing settlement. Exits 10 while running or settling. |
kawaa cancel-job <job_id> | 0.5.4 | Free | Stop a running batch or file job and refund unchecked addresses. |
kawaa jobs | 0.5.4 | Free | List verification jobs newest first (--limit, --status, --offset). |
kawaa results <job_id> | 0.2.0 | Free | Download verified rows as JSON or raw CSV (--format json|csv). |
kawaa account | 0.2.0 | Free | Read plan, credit balance, allowance basis and per-key rate limits. |
kawaa usage | 0.5.4 | Free | Read allowance usage and retention coverage window. |
kawaa find | 0.2.0 | 5 credits | Find and verify a business address from --first, --last and --domain (Starter plan and up). |
kawaa check-domain <domain> | 0.5.4 | 10 credits (0 cached) | Check SPF, DKIM, DMARC, MX and blocklists (requires deliverability:write). |
Batch workflows, stdin and spend caps
Pass --file - to verify-batch to read newline-separated addresses from standard input, and --wait to poll until the job settles. Unrecognised flags exit 2 before sending anything. With kawaa@0.5.5, set --max-credits <n> to cap the charge for a batch. If the maximum estimate exceeds the limit, the command sends no request and exits 6 with MAX_CREDITS_EXCEEDED and nothing_charged: true. The estimate may include internationalized addresses your version of Node.js cannot normalize.
Run kawaa cancel-job <job_id> to stop a running batch. After cancellation, kawaa job <job_id> shows when the refund for unchecked addresses has settled.
# Read addresses from stdin, wait for completion, and export verified CSV rows cleanly to a file:
cat leads.txt | kawaa verify-batch --file - --wait > job.json
JOB_ID=$(node -e 'console.log(JSON.parse(require("fs").readFileSync("job.json", "utf8")).jobId)')
kawaa results "$JOB_ID" --format csv > verified.csvOutput, errors and safe retries
Redirecting stdout to a file always produces valid JSON (or raw CSV for kawaa results <job_id> --format csv). On any non-zero exit code, stderr contains a single structured JSON error object with kind, message, retryable, next_step and exit_code, plus a code when there is one: the API’s error code, or MAX_CREDITS_EXCEEDED when --max-credits stopped the command. Pass --compact for single-line JSON output.
Idempotency keys on every paid command
verify, verify-batch, find and check-domain send an Idempotency-Key automatically (or use the one you pass via --idempotency-key) and print it as idempotencyKey on stdout and idempotency_key on ambiguous errors. Reusing that key after a timeout or 5xx replays the original charge instead of billing twice.
Exit codes
| Exit | Kind | Meaning |
|---|---|---|
0 | ok | Completed cleanly. |
1 | unknown | Failed in a way the CLI could not classify, or a terminal job produced no clean result set. |
2 | usage | Invalid flag or missing argument. Nothing was sent and nothing was charged. |
3 | authentication_required | Missing or rejected API key. |
4 | permission_denied | Valid credential lacking the required scope (check error.required_scopes). |
5 | payment_required | Insufficient credits. |
6 | invalid_request | Refused input or --max-credits ceiling exceeded (MAX_CREDITS_EXCEEDED, nothing charged). |
7 | not_found | No such job or resource. |
8 | rate_limited | Rate limited; wait error.retry_after_seconds and retry. |
9 | service_unavailable | Temporary upstream error or timeout; retry with the printed --idempotency-key. |
10 | in_progress | Work is still running or settling its refund. Poll kawaa job <job_id>; do not resubmit. |
11 | plan_upgrade_required | Feature requires a higher plan; changing keys will not help. |