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/CHANGELOG.md +46 -0
- package/LICENSE +21 -0
- package/PRIVACY.md +74 -0
- package/README.md +206 -0
- package/SECURITY.md +62 -0
- package/SUPPORT.md +33 -0
- package/TERMS.md +66 -0
- package/bin/apilive.js +20 -0
- package/docs/GUIDE.md +167 -0
- package/package.json +62 -0
- package/public/app.js +1026 -0
- package/public/favicon.svg +1 -0
- package/public/index.html +244 -0
- package/public/style.css +554 -0
- package/src/check.js +204 -0
- package/src/cli.js +427 -0
- package/src/demo.js +40 -0
- package/src/env.js +134 -0
- package/src/markdown.js +133 -0
- package/src/providers.js +400 -0
- package/src/server.js +293 -0
- package/src/term.js +28 -0
- package/src/update.js +129 -0
- package/src/util.js +13 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to apilive are documented here. This project follows [Semantic Versioning](https://semver.org/) and the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.
|
|
4
|
+
|
|
5
|
+
## [1.1.0] - 2026-09-29
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Redesigned app.** A table view with a details panel, an add-keys dialog with a live detection preview, search, status filters and keyboard shortcuts.
|
|
10
|
+
- **Docs inside the app.** The Guide, Changelog, Privacy Policy, Terms of Use, Security Policy, Support and License are available offline from the app.
|
|
11
|
+
- **Update notifications.** At most once a day, apilive checks the npm registry for a newer version and shows it in the app and the terminal.
|
|
12
|
+
- `apilive update` updates a global install in place. For npx users it prints the right command.
|
|
13
|
+
- `apilive privacy` and `apilive terms` print the policies in the terminal.
|
|
14
|
+
- `--no-update-check` flag, plus support for `NO_UPDATE_NOTIFIER`, `APILIVE_NO_UPDATE_CHECK` and `DO_NOT_TRACK`.
|
|
15
|
+
- A first-run notice confirming you'll only check keys you're authorized to use.
|
|
16
|
+
- Releases are published from GitHub Actions with npm provenance.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Provider marks are now neutral monograms. apilive no longer uses provider brand colours, and states clearly that it is not affiliated with any provider.
|
|
21
|
+
- At most 100 keys per session, in both the app and the CLI.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- SambaNova could report a fake key as live when requests came from some regions, which returned an empty 404. Validation-probe providers now count a key as live only when the provider returns a genuine validation error.
|
|
26
|
+
- A 2xx response that isn't JSON (for example a captive portal or bot-challenge page) now shows as unverified instead of live.
|
|
27
|
+
|
|
28
|
+
### Privacy
|
|
29
|
+
|
|
30
|
+
- New: the optional update check sends one anonymous request to `registry.npmjs.org`. It contains no keys or usage data. See the [Privacy Policy](PRIVACY.md).
|
|
31
|
+
- New: a small `state.json` in your config folder stores the update-check time and whether you've seen the notice.
|
|
32
|
+
|
|
33
|
+
## [1.0.0] - 2026-09-29
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- `npx apilive` local web app and `npx apilive check` CLI with exit codes and `--json`.
|
|
38
|
+
- 24 providers, with credit balances for OpenRouter, DeepSeek, Kimi, SiliconFlow and Novita.
|
|
39
|
+
- Scanning of `.env*` files and environment variables, with provider detection by key format or variable name.
|
|
40
|
+
- Five statuses: live, invalid, no credit, rate-limited and unverified.
|
|
41
|
+
- Zero dependencies. The server listens only on your machine and uses Host checks, a session token and a strict Content Security Policy.
|
|
42
|
+
- `npm run verify` proves every provider endpoint rejects a fake key.
|
|
43
|
+
- `--demo` mode for screenshots.
|
|
44
|
+
|
|
45
|
+
[1.1.0]: https://github.com/parthksingh1/apilive/releases/tag/v1.1.0
|
|
46
|
+
[1.0.0]: https://github.com/parthksingh1/apilive/releases/tag/v1.0.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Parth Kumar Singh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/PRIVACY.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Privacy Policy
|
|
2
|
+
|
|
3
|
+
**Effective date:** 29 September 2026 · **Applies to:** apilive 1.1.0 and later
|
|
4
|
+
|
|
5
|
+
apilive is free, open-source software that runs entirely on your own computer. This policy explains what the software does with information, and what the people who maintain it ("we", "us") receive. Short answer: **we receive nothing.**
|
|
6
|
+
|
|
7
|
+
## Summary
|
|
8
|
+
|
|
9
|
+
| Question | Answer |
|
|
10
|
+
|---|---|
|
|
11
|
+
| Does apilive collect or sell personal data? | No. |
|
|
12
|
+
| Do the maintainers receive your API keys? | No. We have no servers that receive them. |
|
|
13
|
+
| Is there telemetry, analytics or crash reporting? | No. |
|
|
14
|
+
| Are cookies or trackers used? | No. The local page uses browser storage only for your theme and a one-time notice. |
|
|
15
|
+
| Where do my keys go? | Only to the official API of the provider that issued them, when you ask apilive to check them. |
|
|
16
|
+
| Does apilive connect to anything else? | Only an optional daily update check to the public npm registry, which you can turn off. |
|
|
17
|
+
|
|
18
|
+
## 1. Who we are
|
|
19
|
+
|
|
20
|
+
apilive is an open-source project maintained by Parth Kumar Singh and contributors, and distributed under the [MIT License](LICENSE). We do not operate a hosted service. You download the software (for example with `npx apilive`) and run it on your device.
|
|
21
|
+
|
|
22
|
+
## 2. Information processed on your device
|
|
23
|
+
|
|
24
|
+
**API keys.** When you paste a key, or when apilive finds one in a `.env` file or environment variable, the key is held **in the memory of the apilive process on your computer**. It is never written to disk or logs, and never sent to your browser in full (the web page receives a masked copy such as `sk-proj…7Hq2`). When you stop apilive, the keys are gone.
|
|
25
|
+
|
|
26
|
+
**`.env` files and environment variables.** apilive reads `.env*` files in the folder you run it from, plus your environment variables, to look for values that match known API-key formats or variable names. Other values are ignored and never leave your computer.
|
|
27
|
+
|
|
28
|
+
**Check results.** Status, latency, model lists and credit balances returned by providers are shown to you and held in memory only.
|
|
29
|
+
|
|
30
|
+
**Browser storage.** The local web page stores two preferences in your browser's `localStorage`: your colour theme, and whether you have seen the first-run notice. This data never leaves your browser.
|
|
31
|
+
|
|
32
|
+
**Local state file.** apilive writes one small file, `state.json`, in your user configuration folder (`%APPDATA%\apilive` on Windows, `~/Library/Preferences/apilive` on macOS, `~/.config/apilive` on Linux). It records the time of the last update check, the latest version number seen, and whether you have seen the command-line notice. It contains no keys or personal data. You can delete it at any time.
|
|
33
|
+
|
|
34
|
+
## 3. Information sent to third parties
|
|
35
|
+
|
|
36
|
+
apilive makes network requests only in these cases:
|
|
37
|
+
|
|
38
|
+
1. **Checking a key.** When you choose to check a key, apilive sends it to **the API of the provider it belongs to** (for example, an OpenAI key goes only to `api.openai.com`). It uses endpoints that list models or show account or balance details, and never generates content. The provider receives the key, your IP address and standard request metadata, and handles them under **its own privacy policy and terms**. apilive never sends a key to more than one provider. If it can't tell which provider a key belongs to, it asks you.
|
|
39
|
+
2. **Update check.** Once a day at most, apilive asks the public npm registry (`registry.npmjs.org`, operated by GitHub, Inc.) for the latest version number of the `apilive` package. The request contains no keys, usage data or identifiers. Like any web request, it reveals your IP address to the registry operator, which handles it under [GitHub's privacy statement](https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement). To turn it off, use any of:
|
|
40
|
+
- the `--no-update-check` flag
|
|
41
|
+
- `NO_UPDATE_NOTIFIER=1`
|
|
42
|
+
- `APILIVE_NO_UPDATE_CHECK=1`
|
|
43
|
+
- `DO_NOT_TRACK=1`
|
|
44
|
+
|
|
45
|
+
It is skipped automatically in CI environments.
|
|
46
|
+
3. **Links you open.** Links to provider dashboards, GitHub or documentation open in your browser like any other link.
|
|
47
|
+
|
|
48
|
+
The web page itself loads nothing from the internet: no fonts, scripts, images or analytics. A strict Content Security Policy enforces this.
|
|
49
|
+
|
|
50
|
+
## 4. What the maintainers receive
|
|
51
|
+
|
|
52
|
+
Nothing. We do not receive keys, results, file contents, device information, usage statistics or error reports. If you contact us, for example by opening a GitHub issue, we receive only what you choose to write. That is handled under GitHub's terms and privacy statement. **Never include real API keys in an issue or message.**
|
|
53
|
+
|
|
54
|
+
## 5. Legal bases and your rights
|
|
55
|
+
|
|
56
|
+
Because the maintainers do not collect, receive or store personal data through the software, we are not a data controller or processor for the information apilive handles on your device. That includes processing under the EU and UK GDPR, the California Consumer Privacy Act (CCPA/CPRA) and India's Digital Personal Data Protection Act, 2023. You stay in control of that information throughout.
|
|
57
|
+
|
|
58
|
+
AI providers who receive your keys when you check them, and the npm registry operator, are independent controllers under their own policies. To exercise privacy rights over data they hold, contact them directly.
|
|
59
|
+
|
|
60
|
+
## 6. Children
|
|
61
|
+
|
|
62
|
+
apilive is a developer tool and is not directed at children under 16.
|
|
63
|
+
|
|
64
|
+
## 7. Security
|
|
65
|
+
|
|
66
|
+
We design apilive to keep keys safe on your machine: the local server listens only on `127.0.0.1`, it uses a per-session access token, it rejects requests from other websites, and it has no third-party dependencies. See the [Security Policy](SECURITY.md) for details and for how to report a vulnerability.
|
|
67
|
+
|
|
68
|
+
## 8. Changes to this policy
|
|
69
|
+
|
|
70
|
+
If a future version changes how apilive handles information, we will update this policy, change the effective date, and note it in the [Changelog](CHANGELOG.md) **before** that version is released. The policy that ships with the version you run applies to that version.
|
|
71
|
+
|
|
72
|
+
## 9. Contact
|
|
73
|
+
|
|
74
|
+
Questions about this policy: open a discussion or issue at https://github.com/parthksingh1/apilive. For sensitive matters, use GitHub's private vulnerability reporting described in the [Security Policy](SECURITY.md).
|
package/README.md
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# apilive
|
|
4
|
+
|
|
5
|
+
**Are your API keys alive?**
|
|
6
|
+
|
|
7
|
+
Check LLM API keys for 24 providers in seconds, with latency, models and remaining credit.<br>
|
|
8
|
+
It never makes an inference call, so it costs **zero tokens**. It runs on your machine and has **zero dependencies**.
|
|
9
|
+
|
|
10
|
+
[](https://www.npmjs.com/package/apilive)
|
|
11
|
+
[](https://github.com/parthksingh1/apilive/actions/workflows/ci.yml)
|
|
12
|
+

|
|
13
|
+

|
|
14
|
+
[](LICENSE)
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx apilive
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
<img src="docs/screenshot.png" alt="apilive checking eight API keys: five live with latency, models and credit, one rate-limited, one invalid, one out of credit" width="860">
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Why
|
|
27
|
+
|
|
28
|
+
You have keys scattered across `.env` files, old projects and password managers. Some are revoked, some are out of credit, and you can't tell which without writing a curl command for each provider.
|
|
29
|
+
|
|
30
|
+
Online key checkers want you to paste secrets into someone else's website. **apilive runs on your own machine.** Every key goes straight to its own provider's official API and nowhere else.
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- **24 providers**: OpenAI, Anthropic, Gemini, Groq, Mistral, OpenRouter, DeepSeek, xAI, Together, Cohere, Kimi, Qwen, GLM/Z.ai, SiliconFlow, Perplexity, Cerebras, Fireworks, SambaNova, Hugging Face, Replicate, Novita, DeepInfra, Hyperbolic and Nebius.
|
|
35
|
+
- **Zero cost.** It only calls model-list, account and balance endpoints. It never generates a token.
|
|
36
|
+
- **Finds your keys.** It scans `.env`, `.env.local`, `.env.production`… and your shell environment.
|
|
37
|
+
- **Auto-detects the provider** from the key format (`sk-ant-`, `gsk_`, `AIza…`) or the variable name.
|
|
38
|
+
- **More than "valid or not".** Each key is reported as `live`, `invalid`, `no credit`, `rate-limited` or `unverified`.
|
|
39
|
+
- **Shows what the key can do**: latency, available models, and remaining **credit** for OpenRouter, DeepSeek, Kimi, SiliconFlow and Novita.
|
|
40
|
+
- **Paste a whole `.env` file.** It picks out every key, skips placeholders and removes duplicates.
|
|
41
|
+
- **CI-ready CLI** with exit codes and `--json`.
|
|
42
|
+
- **Exports** a Markdown or JSON report with keys masked.
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
### Web UI
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx apilive
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
This opens `http://127.0.0.1:4577`. Any keys found in the current directory's `.env*` files or in your environment are listed but **not sent anywhere until you click Check**. You can also paste one key or an entire `.env` file.
|
|
53
|
+
|
|
54
|
+
### Terminal
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx apilive check # scan ./.env* + environment
|
|
58
|
+
npx apilive check .env.production # specific files
|
|
59
|
+
npx apilive check --no-env # only .env files, ignore shell env
|
|
60
|
+
pbpaste | npx apilive check --stdin # from clipboard, stays out of shell history
|
|
61
|
+
npx apilive check --json # machine-readable
|
|
62
|
+
npx apilive providers # list providers + env var names
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
apilive v1.1.0 · checking 4 keys · free endpoints only, no credits spent
|
|
67
|
+
|
|
68
|
+
✓ OpenAI sk-proj…7Hq2 live · 412ms · 87 models · 4999 req remaining
|
|
69
|
+
OPENAI_API_KEY · .env
|
|
70
|
+
✓ OpenRouter sk-or-v…2c81 live · 390ms · $13.42 / $20.00
|
|
71
|
+
OPENROUTER_API_KEY · .env
|
|
72
|
+
~ Groq gsk_DE…Wm4T rate-limited · 305ms
|
|
73
|
+
GROQ_API_KEY · .env.local
|
|
74
|
+
✗ Mistral DEMOde…91Lz invalid · 604ms · Unauthorized
|
|
75
|
+
MISTRAL_API_KEY · .env
|
|
76
|
+
|
|
77
|
+
2 live · 1 rate-limited · 1 invalid · 1.1s · 0 tokens spent
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Exit codes:** `0` all keys live (or only rate-limited) · `1` a key is invalid, out of credit, or unverifiable · `2` no keys found or bad usage.
|
|
81
|
+
|
|
82
|
+
### In CI
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
# .github/workflows/keys.yml — nightly check that production keys still work
|
|
86
|
+
on:
|
|
87
|
+
schedule: [{ cron: "0 6 * * *" }]
|
|
88
|
+
jobs:
|
|
89
|
+
keys:
|
|
90
|
+
runs-on: ubuntu-latest
|
|
91
|
+
steps:
|
|
92
|
+
- run: npx -y apilive@1 check # pin the major version in CI
|
|
93
|
+
env:
|
|
94
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
95
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Options
|
|
99
|
+
|
|
100
|
+
| Flag | Description |
|
|
101
|
+
|---|---|
|
|
102
|
+
| `--port <n>` | UI port (default `4577`, falls back to the next free port) |
|
|
103
|
+
| `--no-open` | Don't open the browser |
|
|
104
|
+
| `--no-env` | Ignore environment variables; only read `.env` files |
|
|
105
|
+
| `--stdin` | Read keys or `.env` text from stdin |
|
|
106
|
+
| `-p, --provider <id>` | Treat keys from stdin as this provider |
|
|
107
|
+
| `--json` | JSON output for `check` |
|
|
108
|
+
| `--models` | Print each key's model list |
|
|
109
|
+
| `--timeout <sec>` | Per-request timeout (default `15`) |
|
|
110
|
+
| `--concurrency <n>` | Parallel checks (default `6`) |
|
|
111
|
+
| `--demo` | UI with sample keys and simulated responses, for screenshots |
|
|
112
|
+
| `--no-update-check` | Don't check npm for a newer version |
|
|
113
|
+
|
|
114
|
+
Other commands: `apilive update` (update in place), `apilive privacy`, `apilive terms`. The [Guide](docs/GUIDE.md) has the full reference, troubleshooting and FAQ.
|
|
115
|
+
|
|
116
|
+
## Updating
|
|
117
|
+
|
|
118
|
+
apilive checks the npm registry for a newer version at most once a day and tells you in the terminal and the app. It **never installs anything by itself**.
|
|
119
|
+
|
|
120
|
+
| How you run it | How to update |
|
|
121
|
+
|---|---|
|
|
122
|
+
| `npx apilive` | `npx apilive@latest` |
|
|
123
|
+
| Global install | `apilive update` (asks, then runs `npm install -g apilive@latest`) |
|
|
124
|
+
|
|
125
|
+
The check sends one anonymous request to `registry.npmjs.org`, with no keys and no usage data. Turn it off with `--no-update-check`, `NO_UPDATE_NOTIFIER=1` or `DO_NOT_TRACK=1`. It's skipped in CI. Release notes are in the [Changelog](CHANGELOG.md). Releases are published from GitHub Actions with [npm provenance](https://docs.npmjs.com/generating-provenance-statements/), so you can verify with `npm audit signatures` that the package was built from this repository.
|
|
126
|
+
|
|
127
|
+
## How it stays free
|
|
128
|
+
|
|
129
|
+
Each provider is checked with an endpoint that **authenticates the key but runs no model**:
|
|
130
|
+
|
|
131
|
+
| Endpoint type | Providers |
|
|
132
|
+
|---|---|
|
|
133
|
+
| `GET /models` | OpenAI, Anthropic, Gemini, Groq, Mistral, xAI, Together, Cohere, Kimi, Qwen, GLM, SiliconFlow, Perplexity, Cerebras, Fireworks, DeepInfra, Hyperbolic, Nebius |
|
|
134
|
+
| Account / balance | OpenRouter `/key`, DeepSeek `/user/balance`, Novita `/billing/balance`, Hugging Face `/whoami-v2`, Replicate `/account` |
|
|
135
|
+
| Validation-error probe | SambaNova: an embeddings request with no input, rejected before anything runs |
|
|
136
|
+
|
|
137
|
+
Some providers (Novita, SambaNova, Nvidia, OpenRouter) serve their model list **without authentication**. A naive checker would report *any* string as a working key for them. apilive avoids those endpoints, and `npm run verify` sends a fake key to every provider to prove each one rejects it:
|
|
138
|
+
|
|
139
|
+
```text
|
|
140
|
+
$ npm run verify
|
|
141
|
+
ok openai invalid 401 Incorrect API key provided
|
|
142
|
+
ok anthropic invalid 401 API key is invalid.
|
|
143
|
+
ok gemini invalid 400 API key not valid.
|
|
144
|
+
…
|
|
145
|
+
No provider accepted a fake key.
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
> "Live" means the provider authenticated the key. Providers such as OpenAI don't expose credit balance through the API, so a live key can still hit a quota limit on its first real request.
|
|
149
|
+
|
|
150
|
+
## Security model
|
|
151
|
+
|
|
152
|
+
apilive handles secrets, so it's built to be easy to audit:
|
|
153
|
+
|
|
154
|
+
- **No dependencies.** It uses only Node's built-in `http` and `fetch`. The whole backend is about 1,400 lines of plain JavaScript.
|
|
155
|
+
- **Loopback only.** The server binds to `127.0.0.1` and is unreachable from your network.
|
|
156
|
+
- **DNS-rebinding protection.** Requests whose `Host` isn't `127.0.0.1` or `localhost` on the right port are rejected.
|
|
157
|
+
- **Per-session token.** Every API call needs a random token embedded in the page. Other websites can't read it, so they can't drive the local API.
|
|
158
|
+
- **Strict CSP.** `default-src 'none'` with no third-party scripts, fonts or analytics. The page talks only to `127.0.0.1`.
|
|
159
|
+
- **Keys never reach the browser.** The UI receives masked keys (`sk-proj…7Hq2`) and opaque refs. Raw keys stay in server memory and are dropped when you press Ctrl+C.
|
|
160
|
+
- **One key, one destination.** An ambiguous `sk-…` key is **never** tried against several providers, because that would leak it to the wrong companies. You pick the provider instead.
|
|
161
|
+
- **Nothing logged, no telemetry.** Keys are never written to disk. The only file apilive writes is a tiny `state.json` holding the update-check time and whether you've seen the first-run notice. Provider error messages are scrubbed so a key is never echoed back.
|
|
162
|
+
- **Built for your own keys.** There's a limit of 100 keys per session and a first-run notice that you may only check keys you're authorized to use.
|
|
163
|
+
|
|
164
|
+
See [SECURITY.md](SECURITY.md) to report a vulnerability.
|
|
165
|
+
|
|
166
|
+
## Add a provider
|
|
167
|
+
|
|
168
|
+
Providers live in [`src/providers.js`](src/providers.js). Most OpenAI-compatible APIs take six lines:
|
|
169
|
+
|
|
170
|
+
```js
|
|
171
|
+
{
|
|
172
|
+
id: "acme",
|
|
173
|
+
name: "Acme AI",
|
|
174
|
+
mark: "Ac",
|
|
175
|
+
keyUrl: "https://acme.ai/keys",
|
|
176
|
+
env: ["ACME_API_KEY"],
|
|
177
|
+
pattern: /^acme-\w{20,}$/, // optional: unique key format
|
|
178
|
+
regions: ["https://api.acme.ai/v1"],
|
|
179
|
+
...openAICompatible(),
|
|
180
|
+
},
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Then run `npm run verify` to confirm the endpoint rejects fake keys, and `npm test`.
|
|
184
|
+
|
|
185
|
+
## Development
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
git clone https://github.com/parthksingh1/apilive && cd apilive
|
|
189
|
+
npm start # UI (no install step, since there are no dependencies)
|
|
190
|
+
npm run check # CLI
|
|
191
|
+
npm test # unit + server security tests
|
|
192
|
+
npm run verify # live fake-key check against every provider
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Legal
|
|
196
|
+
|
|
197
|
+
- **Authorized use only.** Only check keys you own or are explicitly authorized to test. Checking leaked or found keys may be illegal. See the [Terms of Use](TERMS.md).
|
|
198
|
+
- **Privacy.** apilive collects nothing and the maintainers receive nothing. See the [Privacy Policy](PRIVACY.md).
|
|
199
|
+
- **Not affiliated.** apilive is an independent project, not affiliated with, endorsed by or sponsored by any provider it supports. Product names are trademarks of their respective owners and are used only to identify services.
|
|
200
|
+
- **No warranty.** apilive is provided "as is", without warranty of any kind. See the [License](LICENSE).
|
|
201
|
+
|
|
202
|
+
Help: [Support](SUPPORT.md) · [Security](SECURITY.md) · [Contributing](CONTRIBUTING.md) · [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
203
|
+
|
|
204
|
+
## License
|
|
205
|
+
|
|
206
|
+
[MIT](LICENSE) © 2026 Parth Kumar Singh
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
apilive handles API keys, so we take security reports seriously and appreciate responsible disclosure.
|
|
4
|
+
|
|
5
|
+
## Supported versions
|
|
6
|
+
|
|
7
|
+
Only the **latest release** receives security fixes. Update with `apilive update` or run `npx apilive@latest`.
|
|
8
|
+
|
|
9
|
+
| Version | Supported |
|
|
10
|
+
|---|---|
|
|
11
|
+
| Latest 1.x | Yes |
|
|
12
|
+
| Older releases | No. Please update. |
|
|
13
|
+
|
|
14
|
+
## Reporting a vulnerability
|
|
15
|
+
|
|
16
|
+
**Please do not open a public issue for security problems.**
|
|
17
|
+
|
|
18
|
+
Report privately through GitHub's private vulnerability reporting:
|
|
19
|
+
https://github.com/parthksingh1/apilive/security/advisories/new
|
|
20
|
+
|
|
21
|
+
Include:
|
|
22
|
+
|
|
23
|
+
- a description of the issue and its impact;
|
|
24
|
+
- steps to reproduce, or a proof of concept;
|
|
25
|
+
- affected version(s), operating system and Node.js version.
|
|
26
|
+
|
|
27
|
+
**Never include real API keys in a report.** Use obviously fake keys or the `--demo` mode.
|
|
28
|
+
|
|
29
|
+
We aim to acknowledge reports within a few days, keep you informed while we investigate, and credit you in the release notes if you wish. This is a volunteer project, so timelines are best effort.
|
|
30
|
+
|
|
31
|
+
## Safe harbor
|
|
32
|
+
|
|
33
|
+
We will not pursue or support legal action against anyone who, in good faith:
|
|
34
|
+
|
|
35
|
+
- tests only against their own installation and their own keys;
|
|
36
|
+
- does not access, change or destroy data that isn't theirs;
|
|
37
|
+
- does not degrade services for others, including third-party AI providers;
|
|
38
|
+
- gives us reasonable time to fix the issue before disclosing it publicly.
|
|
39
|
+
|
|
40
|
+
This safe harbor covers apilive itself only. It does not authorize testing of any AI provider's systems. Their own policies govern that.
|
|
41
|
+
|
|
42
|
+
## Security design
|
|
43
|
+
|
|
44
|
+
| Protection | How |
|
|
45
|
+
|---|---|
|
|
46
|
+
| Not reachable from the network | The server binds to `127.0.0.1` only |
|
|
47
|
+
| DNS-rebinding protection | Requests whose `Host` header isn't `127.0.0.1` or `localhost` on the running port are rejected |
|
|
48
|
+
| Cross-site request protection | Every API call needs a random per-session token embedded in the served page, and cross-origin `Origin` headers are rejected |
|
|
49
|
+
| No third-party code in the page | A strict Content-Security-Policy (`default-src 'none'`) blocks external scripts, fonts and trackers |
|
|
50
|
+
| Keys don't reach the browser | The browser gets masked keys and opaque references only |
|
|
51
|
+
| Keys don't reach disk | Keys live in process memory and are cleared on exit, with no logging |
|
|
52
|
+
| No key leakage between providers | Each key is only ever sent to its own provider |
|
|
53
|
+
| Supply chain | Zero runtime dependencies; releases are published from GitHub Actions with npm provenance attestations |
|
|
54
|
+
| Misuse limits | At most 100 keys per session |
|
|
55
|
+
|
|
56
|
+
### Verifying a release
|
|
57
|
+
|
|
58
|
+
Releases are published with [npm provenance](https://docs.npmjs.com/generating-provenance-statements/), which links each package version to the exact GitHub commit and workflow that built it. You can verify installed packages with:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm audit signatures
|
|
62
|
+
```
|
package/SUPPORT.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Support
|
|
2
|
+
|
|
3
|
+
apilive is a free, open-source project maintained by volunteers. Support is best effort and has no guaranteed response time.
|
|
4
|
+
|
|
5
|
+
## Before you ask
|
|
6
|
+
|
|
7
|
+
1. Read the [Guide](docs/GUIDE.md), especially **Troubleshooting** and **FAQ**.
|
|
8
|
+
2. Make sure you're on the latest version: `apilive update`, or run `npx apilive@latest`.
|
|
9
|
+
3. Run `npx apilive --demo`. If the demo works but your key doesn't, the problem is most likely the key or the provider, not apilive.
|
|
10
|
+
|
|
11
|
+
## Where to get help
|
|
12
|
+
|
|
13
|
+
| You want to… | Go to |
|
|
14
|
+
|---|---|
|
|
15
|
+
| Ask a question or share an idea | [GitHub Discussions](https://github.com/parthksingh1/apilive/discussions) |
|
|
16
|
+
| Report a bug | [Open a bug report](https://github.com/parthksingh1/apilive/issues/new?template=bug_report.yml) |
|
|
17
|
+
| Request a new provider | [Request a provider](https://github.com/parthksingh1/apilive/issues/new?template=provider_request.yml) |
|
|
18
|
+
| Report a security vulnerability | Privately, see the [Security Policy](SECURITY.md) |
|
|
19
|
+
| Fix a problem with your key, billing or account | The provider's own support. apilive can't see or change your account. |
|
|
20
|
+
|
|
21
|
+
## When reporting a problem
|
|
22
|
+
|
|
23
|
+
Please include:
|
|
24
|
+
|
|
25
|
+
- your apilive version (`apilive --version`), operating system and Node.js version (`node --version`);
|
|
26
|
+
- the provider, the status apilive showed, and the message in the details panel;
|
|
27
|
+
- the output of `apilive check --json`, **with keys removed**. apilive already masks them, but double-check.
|
|
28
|
+
|
|
29
|
+
> **Never post a real API key**: not in issues, discussions, screenshots or logs. If you post one by accident, revoke it immediately in the provider's dashboard. Deleting the post is not enough.
|
|
30
|
+
|
|
31
|
+
## Code of conduct
|
|
32
|
+
|
|
33
|
+
Everyone taking part in the project's spaces is expected to follow the [Code of Conduct](https://github.com/parthksingh1/apilive/blob/main/CODE_OF_CONDUCT.md).
|
package/TERMS.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Terms of Use
|
|
2
|
+
|
|
3
|
+
**Effective date:** 29 September 2026
|
|
4
|
+
|
|
5
|
+
These Terms of Use ("Terms") apply to your use of apilive, the open-source software for checking whether API keys are valid ("the Software"). The Software is maintained by Parth Kumar Singh and contributors ("we", "us").
|
|
6
|
+
|
|
7
|
+
The Software's source code is licensed to you under the [MIT License](LICENSE). Nothing in these Terms limits any right the MIT License grants you to use, copy, modify or distribute the code. These Terms set out the conditions for using the Software's features responsibly and repeat the disclaimers that protect the people who build it. If you do not agree, do not use the Software.
|
|
8
|
+
|
|
9
|
+
## 1. Authorized use only
|
|
10
|
+
|
|
11
|
+
You may use the Software only to check API keys that **you own, or that you are explicitly authorized to test** by the owner of the account the key belongs to (for example, your employer's keys, as part of your job).
|
|
12
|
+
|
|
13
|
+
You must not use the Software to:
|
|
14
|
+
|
|
15
|
+
- check keys that were leaked, found, scraped, purchased, shared without permission, or otherwise obtained without the account owner's authorization;
|
|
16
|
+
- gain, attempt, or help anyone gain unauthorized access to any account, system or service;
|
|
17
|
+
- break the terms of service, acceptable-use policy or rate limits of any API provider;
|
|
18
|
+
- break any applicable law, including computer misuse and unauthorized-access laws. Examples include the U.S. Computer Fraud and Abuse Act, the UK Computer Misuse Act 1990, India's Information Technology Act, 2000, and their equivalents where you live.
|
|
19
|
+
|
|
20
|
+
The Software checks a limited number of keys per session and is designed for managing your own credentials, not for bulk testing. You are solely responsible for making sure every key you check is one you are allowed to check.
|
|
21
|
+
|
|
22
|
+
## 2. Third-party providers
|
|
23
|
+
|
|
24
|
+
When you check a key, the Software sends a request to that key's provider (for example, OpenAI or Anthropic). That request is made **by you, from your computer, with your credentials**, and is governed by your agreement with the provider. Providers may record, rate-limit or bill for API requests under their own terms. The Software uses endpoints that are normally free, but we do not control provider pricing or behaviour and cannot guarantee that no charge, rate limit or account action will ever result.
|
|
25
|
+
|
|
26
|
+
## 3. No affiliation; trademarks
|
|
27
|
+
|
|
28
|
+
apilive is an independent project. It is **not affiliated with, endorsed by or sponsored by** any AI provider or other company named in it. All product names, company names and trademarks, including OpenAI, Anthropic, Claude, Google, Gemini, Groq, Mistral, OpenRouter, DeepSeek, xAI, Grok, Together AI, Cohere, Moonshot, Kimi, Alibaba Cloud, Qwen, Zhipu, Z.ai, SiliconFlow, Perplexity, Cerebras, Fireworks AI, SambaNova, Hugging Face, Replicate, Novita AI, DeepInfra, Hyperbolic and Nebius, belong to their respective owners. They are used only to identify which service a key belongs to. The Software does not use provider logos.
|
|
29
|
+
|
|
30
|
+
## 4. Results are informational
|
|
31
|
+
|
|
32
|
+
Results show what a provider's API reported at the time of the check. "Live" means the provider accepted the key for a metadata request. It does **not** guarantee that the key has quota, credit, access to a particular model, or that it will keep working. Credit balances, model lists and rate-limit figures come from providers and may be incomplete, delayed or wrong. Do not rely on the Software as your only control for security, billing or compliance decisions.
|
|
33
|
+
|
|
34
|
+
## 5. Disclaimer of warranties
|
|
35
|
+
|
|
36
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. THIS INCLUDES, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, ACCURACY, AND THAT THE SOFTWARE WILL BE UNINTERRUPTED, SECURE OR ERROR-FREE. YOU USE THE SOFTWARE AT YOUR OWN RISK.
|
|
37
|
+
|
|
38
|
+
## 6. Limitation of liability
|
|
39
|
+
|
|
40
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT WILL THE AUTHORS, MAINTAINERS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR ITS USE. This includes any direct, indirect, incidental, special, consequential, exemplary or punitive damages, and any loss of data, credentials, profits, revenue, credits or goodwill, API charges, account suspension, or security incident, even if advised of the possibility of such damages.
|
|
41
|
+
|
|
42
|
+
Where the law does not allow liability to be excluded entirely, the total liability of all such persons combined is limited to **zero (0) US dollars**. The Software is provided free of charge. Some jurisdictions do not allow certain exclusions or limitations, so some of the above may not apply to you. In that case they apply to the fullest extent permitted.
|
|
43
|
+
|
|
44
|
+
## 7. Indemnity
|
|
45
|
+
|
|
46
|
+
To the extent permitted by law, you agree to defend, indemnify and hold harmless the authors, maintainers and contributors from any claim, demand, loss or expense (including reasonable legal fees) arising from your use or misuse of the Software, your breach of these Terms, or your violation of any law or third-party right. This expressly includes checking keys you were not authorized to check.
|
|
47
|
+
|
|
48
|
+
## 8. Updates, support and availability
|
|
49
|
+
|
|
50
|
+
We may release new versions, change or remove features, or stop maintaining the Software at any time without notice. The Software can check for new versions (see the [Privacy Policy](PRIVACY.md)). Installing an update is always your choice. Support is provided voluntarily, on a best-effort basis, with no guaranteed response time (see [Support](SUPPORT.md)).
|
|
51
|
+
|
|
52
|
+
## 9. Export and sanctions
|
|
53
|
+
|
|
54
|
+
You are responsible for complying with all export-control and sanctions laws that apply to your use of the Software and of the third-party services you connect to.
|
|
55
|
+
|
|
56
|
+
## 10. Governing law
|
|
57
|
+
|
|
58
|
+
These Terms are governed by the laws of **[JURISDICTION, e.g. India]**, without regard to conflict-of-law rules. Any dispute will be subject to the exclusive jurisdiction of the courts of **[CITY, COUNTRY]**, unless the law of your country of residence requires otherwise.
|
|
59
|
+
|
|
60
|
+
## 11. General
|
|
61
|
+
|
|
62
|
+
If any part of these Terms is found unenforceable, the rest remains in effect. If we don't enforce a provision, that isn't a waiver. These Terms, together with the MIT License and the [Privacy Policy](PRIVACY.md), are the entire agreement between you and us about the Software. We may update these Terms, and the version shipped with the release you use applies to that release. Changes are noted in the [Changelog](CHANGELOG.md).
|
|
63
|
+
|
|
64
|
+
## 12. Contact
|
|
65
|
+
|
|
66
|
+
Questions about these Terms: https://github.com/parthksingh1/apilive/discussions
|
package/bin/apilive.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { main } from "../src/cli.js";
|
|
3
|
+
|
|
4
|
+
const [major] = process.versions.node.split(".").map(Number);
|
|
5
|
+
if (major < 18) {
|
|
6
|
+
console.error(`apilive needs Node.js 18 or newer (you have ${process.versions.node}).`);
|
|
7
|
+
process.exit(2);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
main(process.argv.slice(2)).then(
|
|
11
|
+
// exitCode (not exit()) lets pending sockets close cleanly — avoids a libuv
|
|
12
|
+
// assertion on Windows when exiting mid-teardown.
|
|
13
|
+
(code) => {
|
|
14
|
+
process.exitCode = code ?? 0;
|
|
15
|
+
},
|
|
16
|
+
(e) => {
|
|
17
|
+
console.error(e?.stack || e);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
},
|
|
20
|
+
);
|