api-auth-credits
Skill0 starsChanged 4 months agoMITView on GitHub
LeadMagic API authentication, API keys, credit balance, plans, and rate limits. Use when setting LEADMAGIC_API_KEY, calling GET /v1/credits, budgeting a run against a plan's credits, previewing bulk cost, or debugging 401, 402, 403, or 429 responses.
- Reads credentials
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- ads-intelligenceSkill
- analytics-observabilitySkill
- bulk-jobsSkill
- company-enrichmentSkill
- company-searchSkill
- connect-leadmagicSkill
- email-enrichmentSkill
- job-searchSkill
- jobs-hiring-intentSkill
- leadmagicSkill
- mcp-integrationSkill
- outbound-recipesSkill
- people-enrichmentSkill
- people-searchSkill
- sheetsSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Never echo or log LEADMAGIC_API_KEY.
- Very specific: line 22
Prefer hosted MCP (https://mcp.leadmagic.io/mcp) for agent workflows — OAuth, no key in shell history.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LeadMagic — API auth, credits & plans
Rules
- Never echo or log
LEADMAGIC_API_KEY. Read from env only; rotate immediately if a key was pasted into chat or committed. - REST auth header is
X-API-Key, notAuthorization: Bearer. - Prefer hosted MCP (
https://mcp.leadmagic.io/mcp) for agent workflows — OAuth, no key in shell history. - Preflight every run:
GET /v1/credits(free). Preview anything ≥ 500 credits:POST /v1/batch/preview-cost(free).
Base URL & key
- Base:
https://api.leadmagic.io - Key: app.leadmagic.io → Settings → API
curl -sS "https://api.leadmagic.io/v1/credits" -H "X-API-Key: $LEADMAGIC_API_KEY"Plans (what a run can afford)
Plans are Basic, Essential, Growth, Professional and Ultimate; current prices, monthly credits and rollover are on leadmagic.io/pricing. Professional and Ultimate include credit-free browse search (5 / 10 req/s) within a fair-use cap — see leadmagic.io/unlimited. Other plans pay 1 credit per returned row. Always read the live balance from GET /v1/credits. Full ladder + budgeting: leadmagic skill → references/plans-and-limits.md.
Status codes
| Code | Meaning | What to do |
| 400 | Validation | Error body names the field and the fix (detail, action) |
| 401 | Missing/invalid key | Check header name (X-API-Key) and env var; key may be revoked |
| 402 | Out of credits | Stop the run; report done/remaining; GET /v1/credits; resume after top-up. Never retry-loop |
| 403 | Plan/entitlement gate | Feature not on this plan — say which plan unlocks it |
| 404 | Unknown route | Retry once with errors[0].context.suggested_endpoint (the canonical path); if absent, don't guess other routes |
| 429 | Rate limited | Honor Retry-After, exponential backoff + jitter. Sustained hammering escalates temporary blocks |
| 5xx | Transient | One retry with backoff, then surface with trace.request_id |
Errors are RFC 9457 Problem Details — action is the machine-suggested fix; trace.request_id is what support needs.
Credit accounting facts
- Not-found results are free on the major finders (email, personal email, mobile, profile→email, company, funding).
- Email validation bills only conclusive outcomes (valid/invalid). Malformed, no-MX, disposable, and blocklisted addresses come back
invalidand bill;unknown(inconclusive SMTP, unverifiable catch-all, timeouts) is free. - Bulk jobs bill per successful row at single-request rates; failed rows free.
- Track spend with free
GET /v1/analytics/usage,/credits,/day/{date}(seeanalytics-observability).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

