apilive 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/GUIDE.md ADDED
@@ -0,0 +1,167 @@
1
+ # Guide
2
+
3
+ apilive checks whether your API keys work, across 24 AI providers, without spending tokens. It runs on your computer and nothing is stored.
4
+
5
+ ## Getting started
6
+
7
+ You need **Node.js 18 or newer**. Check with `node --version`.
8
+
9
+ ```bash
10
+ npx apilive
11
+ ```
12
+
13
+ This starts apilive on your computer and opens it in your browser at `http://127.0.0.1:4577`. Run it from a project folder and it lists the keys it finds in that folder's `.env` files and in your environment. **Nothing is sent until you choose to check.**
14
+
15
+ To install it permanently instead:
16
+
17
+ ```bash
18
+ npm install -g apilive
19
+ apilive
20
+ ```
21
+
22
+ ## Checking keys in the app
23
+
24
+ 1. Click **Add keys** (or press `K`).
25
+ 2. Paste one key, several keys (one per line), or an entire `.env` file.
26
+ 3. apilive detects each key's provider from its format (`sk-ant-…`, `gsk_…`, `AIza…`) or its variable name (`OPENAI_API_KEY`). Check the preview, change the provider if needed, and click **Check**.
27
+ 4. Click any row to open its details: the full status, the provider's message, available models, credit and where the key was found.
28
+
29
+ Keys found in `.env` files show up automatically. Use **Check all** to test them.
30
+
31
+ ### Keyboard shortcuts
32
+
33
+ | Key | Action |
34
+ |---|---|
35
+ | `K` | Add keys |
36
+ | `/` | Filter the table |
37
+ | `R` | Re-check all |
38
+ | `Esc` | Close a dialog or panel |
39
+ | `Ctrl` / `⌘` + `Enter` | Check the keys in the Add dialog |
40
+
41
+ ## What each status means
42
+
43
+ | Status | Meaning | What to do |
44
+ |---|---|---|
45
+ | **Live** | The provider accepted the key. | Nothing. It works. |
46
+ | **Invalid** | The provider rejected the key (usually HTTP 401 or 403). | The key is revoked, mistyped, expired, or belongs to a different provider. Create a new one in the provider's dashboard. |
47
+ | **No credit** | The key is valid but the account has no balance (HTTP 402). | Add credit or billing with the provider. |
48
+ | **Rate-limited** | The key is valid but is being throttled right now (HTTP 429). | Wait and check again. |
49
+ | **Unverified** | apilive couldn't get a clear answer: a network error, timeout or unexpected response. | Check your connection, proxy or firewall, then retry. The provider may be having an outage. |
50
+
51
+ > "Live" means the key authenticates. Some providers, such as OpenAI, don't report credit through their API, so a live key can still run out of quota when you use it for real.
52
+
53
+ ## Command line
54
+
55
+ ```bash
56
+ apilive check # scan ./.env* files and environment variables
57
+ apilive check .env.production # scan specific files
58
+ apilive check --no-env # only .env files, ignore environment variables
59
+ apilive check --stdin # read keys from standard input
60
+ apilive check --json # machine-readable output
61
+ apilive check --models # also list each key's models
62
+ apilive providers # list supported providers and variable names
63
+ apilive update # update to the latest version
64
+ apilive privacy | terms # print the Privacy Policy or Terms
65
+ ```
66
+
67
+ Pipe keys from your clipboard so they never end up in your shell history:
68
+
69
+ ```bash
70
+ pbpaste | apilive check --stdin # macOS
71
+ Get-Clipboard | apilive check --stdin # Windows PowerShell
72
+ xclip -o -selection clipboard | apilive check --stdin # Linux
73
+ ```
74
+
75
+ ### Options
76
+
77
+ | Option | Description |
78
+ |---|---|
79
+ | `--port <n>` | Port for the app (default 4577). If it's busy, the next free port is used. |
80
+ | `--no-open` | Don't open the browser automatically |
81
+ | `--no-env` | Ignore environment variables; only read `.env` files |
82
+ | `--stdin` | Read keys or `.env` text from standard input |
83
+ | `-p, --provider <id>` | Treat keys from stdin as this provider (see `apilive providers`) |
84
+ | `--json` | JSON output |
85
+ | `--models` | Include model lists |
86
+ | `--timeout <sec>` | Per-request timeout (default 15) |
87
+ | `--concurrency <n>` | Number of checks run in parallel (default 6) |
88
+ | `--no-update-check` | Don't check npm for a newer version |
89
+ | `--demo` | Sample keys and simulated responses, for screenshots |
90
+
91
+ ### Exit codes
92
+
93
+ | Code | Meaning |
94
+ |---|---|
95
+ | `0` | All keys are live (rate-limited counts as live) |
96
+ | `1` | At least one key is invalid, out of credit or unverified |
97
+ | `2` | No keys found, or invalid usage |
98
+
99
+ ### Using it in CI
100
+
101
+ ```yaml
102
+ # .github/workflows/keys.yml
103
+ on:
104
+ schedule: [{ cron: "0 6 * * *" }]
105
+ jobs:
106
+ keys:
107
+ runs-on: ubuntu-latest
108
+ steps:
109
+ - run: npx -y apilive@1 check
110
+ env:
111
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
112
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
113
+ ```
114
+
115
+ Pin a major version (`apilive@1`) in CI so a future release can't change behaviour unexpectedly.
116
+
117
+ ## How keys are detected
118
+
119
+ apilive recognises a key in one of two ways:
120
+
121
+ 1. **By variable name**, such as `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY` or `GROQ_API_KEY`. Run `apilive providers` for the full list.
122
+ 2. **By format**, when the prefix is unique: `sk-ant-`, `sk-proj-`, `sk-or-`, `gsk_`, `AIza`, `xai-`, `pplx-`, `csk-`, `fw_`, `tgp_v1_`, `hf_`, `r8_`.
123
+
124
+ Some formats are shared. A plain `sk-…` key could belong to OpenAI, DeepSeek, Qwen, Kimi or SiliconFlow. apilive **will not** try the key against each of them, because that would send your key to companies it doesn't belong to. It shows its best guess and asks you to confirm.
125
+
126
+ Placeholder values like `your-key-here`, `sk-...` or `xxxx` are ignored.
127
+
128
+ ## Updating
129
+
130
+ apilive checks the npm registry for a new version at most once a day and tells you when one is available. It never updates itself without your permission.
131
+
132
+ | How you run apilive | How to update |
133
+ |---|---|
134
+ | `npx apilive` | Run `npx apilive@latest`. npx then uses the newest version. |
135
+ | Installed globally | `apilive update` (runs `npm install -g apilive@latest` after asking) |
136
+ | Project dependency | `npm install apilive@latest` |
137
+
138
+ To turn off update checks, set `NO_UPDATE_NOTIFIER=1` or `DO_NOT_TRACK=1`, or pass `--no-update-check`. See the [Changelog](CHANGELOG.md) for what's new in each release.
139
+
140
+ ## Troubleshooting
141
+
142
+ **The browser didn't open.** Open the address printed in the terminal (for example `http://127.0.0.1:4577`) yourself. Over SSH or in a container, use `--no-open` and forward the port.
143
+
144
+ **"Port in use".** apilive tries the next free port automatically. Use `--port 5000` to pick one.
145
+
146
+ **Every key shows "Unverified" with a network error.** You're offline, or a proxy or firewall is blocking access to the provider. Node.js ignores `HTTP_PROXY` by default. On Node 24 or newer, set `NODE_USE_ENV_PROXY=1` along with `HTTPS_PROXY` to route through a corporate proxy.
147
+
148
+ **A key I know works shows "Invalid".** Check it's assigned to the right provider. Open the row and look at the provider shown. Also check for regional accounts: Kimi, Qwen, GLM and SiliconFlow keys are tried against both their international and China endpoints.
149
+
150
+ **"Can't reach the apilive server" in the browser.** The terminal running apilive was closed. Start it again.
151
+
152
+ ## FAQ
153
+
154
+ **Does checking cost money?**
155
+ No tokens are generated. apilive only uses endpoints that list models or show account or balance details, and providers normally don't bill for those. Pricing is up to each provider, though, so see the [Terms](TERMS.md).
156
+
157
+ **Is it safe to paste my keys?**
158
+ Keys stay in the apilive process on your own computer. They're sent only to the provider they belong to, never written to disk, and never sent to the maintainers. The web page itself only sees masked keys. See the [Privacy Policy](PRIVACY.md) and [Security Policy](SECURITY.md).
159
+
160
+ **Why is there a 100-key limit?**
161
+ apilive is built for managing your own keys. A small limit keeps it useful for that and much less useful for testing leaked keys in bulk, which you must never do (see the [Terms](TERMS.md)).
162
+
163
+ **Can I check keys for a provider that isn't listed?**
164
+ Not yet. [Request it](https://github.com/parthksingh1/apilive/issues/new?template=provider_request.yml) or add it yourself (see `CONTRIBUTING.md`).
165
+
166
+ **How do I uninstall?**
167
+ If you used `npx`, there's nothing to uninstall. Otherwise run `npm uninstall -g apilive`. Optionally delete the config folder described in the [Privacy Policy](PRIVACY.md).
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "apilive",
3
+ "version": "1.1.0",
4
+ "description": "Check if your LLM API keys are live — across 24 providers, without spending a single token. Local, zero-dependency CLI + web UI.",
5
+ "type": "module",
6
+ "bin": {
7
+ "apilive": "bin/apilive.js"
8
+ },
9
+ "main": "src/check.js",
10
+ "exports": {
11
+ ".": "./src/check.js",
12
+ "./providers": "./src/providers.js",
13
+ "./env": "./src/env.js"
14
+ },
15
+ "files": [
16
+ "bin",
17
+ "src",
18
+ "public",
19
+ "docs/GUIDE.md",
20
+ "CHANGELOG.md",
21
+ "PRIVACY.md",
22
+ "TERMS.md",
23
+ "SECURITY.md",
24
+ "SUPPORT.md"
25
+ ],
26
+ "scripts": {
27
+ "start": "node bin/apilive.js",
28
+ "dev": "node --watch bin/apilive.js --no-open",
29
+ "check": "node bin/apilive.js check",
30
+ "test": "node --test",
31
+ "verify": "node scripts/verify-endpoints.js"
32
+ },
33
+ "keywords": [
34
+ "api-key",
35
+ "api-key-checker",
36
+ "llm",
37
+ "openai",
38
+ "anthropic",
39
+ "claude",
40
+ "gemini",
41
+ "groq",
42
+ "deepseek",
43
+ "openrouter",
44
+ "mistral",
45
+ "dotenv",
46
+ "cli",
47
+ "validator"
48
+ ],
49
+ "author": "Parth Kumar Singh",
50
+ "license": "MIT",
51
+ "homepage": "https://github.com/parthksingh1/APILive#readme",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/parthksingh1/APILive.git"
55
+ },
56
+ "bugs": {
57
+ "url": "https://github.com/parthksingh1/APILive/issues"
58
+ },
59
+ "engines": {
60
+ "node": ">=18"
61
+ }
62
+ }