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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="1" y="1" width="22" height="22" rx="6" fill="#171717"/><path d="M5 12.5h3.2l1.8-4 3 8 1.9-4H19" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="color-scheme" content="light dark" />
|
|
7
|
+
<meta name="apilive-token" content="__APILIVE_TOKEN__" />
|
|
8
|
+
<title>apilive</title>
|
|
9
|
+
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
|
10
|
+
<link rel="stylesheet" href="/style.css" />
|
|
11
|
+
<script src="/app.js" defer></script>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<a class="skip-link" href="#main">Skip to content</a>
|
|
15
|
+
|
|
16
|
+
<header class="header">
|
|
17
|
+
<div class="container header-inner">
|
|
18
|
+
<a class="logo" href="#/" aria-label="apilive home">
|
|
19
|
+
<svg class="logo-mark" viewBox="0 0 24 24" aria-hidden="true">
|
|
20
|
+
<rect x="1" y="1" width="22" height="22" rx="6" />
|
|
21
|
+
<path d="M5 12.5h3.2l1.8-4 3 8 1.9-4H19" />
|
|
22
|
+
</svg>
|
|
23
|
+
<span class="logo-text">apilive</span>
|
|
24
|
+
</a>
|
|
25
|
+
<nav class="nav" aria-label="Primary">
|
|
26
|
+
<a href="#/" data-nav="keys">Keys</a>
|
|
27
|
+
<a href="#/docs/guide" data-nav="docs">Docs</a>
|
|
28
|
+
<a href="#/docs/changelog" data-nav="changelog">Changelog</a>
|
|
29
|
+
</nav>
|
|
30
|
+
<div class="header-right">
|
|
31
|
+
<button class="chip chip-update" id="updateChip" type="button" hidden>
|
|
32
|
+
<span class="chip-dot"></span><span id="updateChipText">Update available</span>
|
|
33
|
+
</button>
|
|
34
|
+
<span class="chip chip-demo" id="demoChip" hidden title="Started with --demo. Sample keys and simulated responses.">Demo data</span>
|
|
35
|
+
<span class="chip chip-local" title="Served from 127.0.0.1. Not reachable from your network.">
|
|
36
|
+
<span class="icon" data-icon="lock"></span><span>Local</span>
|
|
37
|
+
</span>
|
|
38
|
+
<a class="btn-icon" href="https://github.com/parthksingh1/apilive" target="_blank" rel="noopener noreferrer" aria-label="Source code on GitHub" title="Source code on GitHub">
|
|
39
|
+
<span class="icon" data-icon="github"></span>
|
|
40
|
+
</a>
|
|
41
|
+
<button class="btn-icon" id="themeBtn" type="button" aria-label="Switch colour theme" title="Switch theme">
|
|
42
|
+
<span class="icon only-light" data-icon="moon"></span>
|
|
43
|
+
<span class="icon only-dark" data-icon="sun"></span>
|
|
44
|
+
</button>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</header>
|
|
48
|
+
|
|
49
|
+
<main id="main" class="container main">
|
|
50
|
+
<!-- Keys ----------------------------------------------------------- -->
|
|
51
|
+
<section id="view-keys" class="view" aria-labelledby="keysTitle">
|
|
52
|
+
<div class="page-head">
|
|
53
|
+
<div>
|
|
54
|
+
<h1 id="keysTitle">API keys</h1>
|
|
55
|
+
<p class="page-desc">Each key is checked against its provider's model or account endpoint. No tokens are generated.</p>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="page-actions">
|
|
58
|
+
<button class="btn btn-secondary" id="recheckAllBtn" type="button">
|
|
59
|
+
<span class="icon" data-icon="refresh"></span><span>Re-check all</span>
|
|
60
|
+
</button>
|
|
61
|
+
<button class="btn btn-primary" id="addBtn" type="button">
|
|
62
|
+
<span class="icon" data-icon="plus"></span><span>Add keys</span><kbd class="kbd kbd-inverse">K</kbd>
|
|
63
|
+
</button>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div class="banner" id="envBanner" role="status" hidden>
|
|
68
|
+
<span class="icon banner-icon" data-icon="file"></span>
|
|
69
|
+
<div class="banner-text">
|
|
70
|
+
<strong id="envBannerTitle"></strong>
|
|
71
|
+
<span id="envBannerSub"></span>
|
|
72
|
+
</div>
|
|
73
|
+
<button class="btn btn-secondary btn-sm" id="envCheckBtn" type="button">Check all</button>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div class="card">
|
|
77
|
+
<div class="toolbar">
|
|
78
|
+
<div class="tabs" id="tabs" role="tablist" aria-label="Filter by status"></div>
|
|
79
|
+
<div class="toolbar-right">
|
|
80
|
+
<label class="search">
|
|
81
|
+
<span class="icon" data-icon="search"></span>
|
|
82
|
+
<input id="searchInput" type="search" placeholder="Filter" aria-label="Filter keys" autocomplete="off" />
|
|
83
|
+
<kbd class="kbd">/</kbd>
|
|
84
|
+
</label>
|
|
85
|
+
<button class="btn btn-secondary btn-sm" id="exportBtn" type="button" aria-haspopup="menu" aria-expanded="false">
|
|
86
|
+
<span class="icon" data-icon="download"></span><span class="hide-sm">Export</span><span class="icon icon-sm" data-icon="chevron"></span>
|
|
87
|
+
</button>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="table-scroll">
|
|
92
|
+
<table class="table" id="table">
|
|
93
|
+
<thead>
|
|
94
|
+
<tr>
|
|
95
|
+
<th scope="col">Provider</th>
|
|
96
|
+
<th scope="col">Key</th>
|
|
97
|
+
<th scope="col" class="col-source">Source</th>
|
|
98
|
+
<th scope="col">Status</th>
|
|
99
|
+
<th scope="col" class="num col-latency">Latency</th>
|
|
100
|
+
<th scope="col" class="num col-models">Models</th>
|
|
101
|
+
<th scope="col" class="num col-credit">Credit</th>
|
|
102
|
+
<th scope="col" class="col-actions"><span class="sr-only">Actions</span></th>
|
|
103
|
+
</tr>
|
|
104
|
+
</thead>
|
|
105
|
+
<tbody id="tbody"></tbody>
|
|
106
|
+
</table>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<div class="empty" id="emptyState" hidden>
|
|
110
|
+
<div class="empty-icon"><span class="icon" data-icon="key"></span></div>
|
|
111
|
+
<h2>No keys yet</h2>
|
|
112
|
+
<p>Run apilive inside a project to pick up keys from its <code>.env</code> files, or add keys yourself.</p>
|
|
113
|
+
<div class="empty-actions">
|
|
114
|
+
<button class="btn btn-primary" id="emptyAddBtn" type="button"><span class="icon" data-icon="plus"></span>Add keys</button>
|
|
115
|
+
<a class="btn btn-secondary" href="#/docs/guide">Read the guide</a>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
<p class="no-match" id="noMatch" hidden>No keys match this filter.</p>
|
|
119
|
+
|
|
120
|
+
<div class="card-foot" id="cardFoot"></div>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<section class="providers" aria-labelledby="providersTitle">
|
|
124
|
+
<div class="section-head">
|
|
125
|
+
<h2 id="providersTitle">Supported providers</h2>
|
|
126
|
+
<p>apilive is independent and not affiliated with any provider. Names are trademarks of their respective owners.</p>
|
|
127
|
+
</div>
|
|
128
|
+
<ul class="provider-list" id="providerList"></ul>
|
|
129
|
+
</section>
|
|
130
|
+
</section>
|
|
131
|
+
|
|
132
|
+
<!-- Docs ----------------------------------------------------------- -->
|
|
133
|
+
<section id="view-docs" class="view" hidden>
|
|
134
|
+
<div class="docs">
|
|
135
|
+
<nav class="docs-nav" id="docsNav" aria-label="Documentation"></nav>
|
|
136
|
+
<article class="docs-article">
|
|
137
|
+
<div class="prose" id="docBody" tabindex="-1"></div>
|
|
138
|
+
</article>
|
|
139
|
+
<aside class="docs-toc" id="docToc" aria-label="On this page"></aside>
|
|
140
|
+
</div>
|
|
141
|
+
</section>
|
|
142
|
+
</main>
|
|
143
|
+
|
|
144
|
+
<footer class="footer">
|
|
145
|
+
<div class="container footer-inner">
|
|
146
|
+
<div class="footer-left">
|
|
147
|
+
<span>apilive <span id="footerVersion"></span></span>
|
|
148
|
+
<span class="footer-note">Not affiliated with any AI provider. Open source under the MIT License.</span>
|
|
149
|
+
</div>
|
|
150
|
+
<nav class="footer-links" aria-label="Legal and help">
|
|
151
|
+
<a href="#/docs/guide">Docs</a>
|
|
152
|
+
<a href="#/docs/privacy">Privacy</a>
|
|
153
|
+
<a href="#/docs/terms">Terms</a>
|
|
154
|
+
<a href="#/docs/security">Security</a>
|
|
155
|
+
<a href="#/docs/support">Support</a>
|
|
156
|
+
<a href="#/docs/license">License</a>
|
|
157
|
+
</nav>
|
|
158
|
+
</div>
|
|
159
|
+
</footer>
|
|
160
|
+
|
|
161
|
+
<!-- Add keys dialog -->
|
|
162
|
+
<dialog class="dialog" id="addDialog" aria-labelledby="addTitle" aria-describedby="addDesc">
|
|
163
|
+
<div class="dialog-head">
|
|
164
|
+
<div>
|
|
165
|
+
<h2 id="addTitle">Add keys</h2>
|
|
166
|
+
<p id="addDesc">Paste one key per line, or the contents of a <code>.env</code> file.</p>
|
|
167
|
+
</div>
|
|
168
|
+
<button class="btn-icon" type="button" data-close aria-label="Close"><span class="icon" data-icon="x"></span></button>
|
|
169
|
+
</div>
|
|
170
|
+
<div class="dialog-body">
|
|
171
|
+
<textarea id="keyInput" class="textarea" rows="6" spellcheck="false" autocomplete="off" autocapitalize="off" data-gramm="false" aria-label="API keys"
|
|
172
|
+
placeholder="OPENAI_API_KEY=sk-proj-… sk-ant-api03-… gsk_…"></textarea>
|
|
173
|
+
<div class="field-inline">
|
|
174
|
+
<label for="providerSelect">Provider</label>
|
|
175
|
+
<div class="select">
|
|
176
|
+
<select id="providerSelect"><option value="">Detect automatically</option></select>
|
|
177
|
+
<span class="icon icon-sm" data-icon="chevron"></span>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
<div class="preview" id="preview" aria-live="polite"></div>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="dialog-foot">
|
|
183
|
+
<p class="dialog-note"><span class="icon icon-sm" data-icon="lock"></span>Held in memory on this computer. Sent only to each key's own provider.</p>
|
|
184
|
+
<div class="dialog-actions">
|
|
185
|
+
<button class="btn btn-secondary" type="button" data-close>Cancel</button>
|
|
186
|
+
<button class="btn btn-primary" type="button" id="addSubmit" disabled>Check keys</button>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
</dialog>
|
|
190
|
+
|
|
191
|
+
<!-- First-run acknowledgement -->
|
|
192
|
+
<dialog class="dialog dialog-sm" id="ackDialog" aria-labelledby="ackTitle">
|
|
193
|
+
<div class="dialog-head">
|
|
194
|
+
<div>
|
|
195
|
+
<h2 id="ackTitle">Before you start</h2>
|
|
196
|
+
<p>apilive checks keys by calling each provider's API from your computer.</p>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
<div class="dialog-body">
|
|
200
|
+
<ul class="checklist">
|
|
201
|
+
<li><span class="icon" data-icon="shield"></span><span><strong>Only check keys you own or are authorized to use.</strong> Testing anyone else's keys may be illegal.</span></li>
|
|
202
|
+
<li><span class="icon" data-icon="lock"></span><span>Keys stay on this computer. They're never stored, and never sent to the apilive maintainers.</span></li>
|
|
203
|
+
<li><span class="icon" data-icon="info"></span><span>Checks use free endpoints, but each provider sets its own pricing and limits.</span></li>
|
|
204
|
+
</ul>
|
|
205
|
+
<label class="checkbox">
|
|
206
|
+
<input type="checkbox" id="ackCheck" />
|
|
207
|
+
<span>I agree to the <a href="#/docs/terms" data-close-link>Terms of Use</a> and have read the <a href="#/docs/privacy" data-close-link>Privacy Policy</a>.</span>
|
|
208
|
+
</label>
|
|
209
|
+
</div>
|
|
210
|
+
<div class="dialog-foot dialog-foot-end">
|
|
211
|
+
<button class="btn btn-primary" type="button" id="ackContinue" disabled>Continue</button>
|
|
212
|
+
</div>
|
|
213
|
+
</dialog>
|
|
214
|
+
|
|
215
|
+
<!-- Update dialog -->
|
|
216
|
+
<dialog class="dialog dialog-sm" id="updateDialog" aria-labelledby="updateTitle">
|
|
217
|
+
<div class="dialog-head">
|
|
218
|
+
<div>
|
|
219
|
+
<h2 id="updateTitle">Update available</h2>
|
|
220
|
+
<p id="updateDesc"></p>
|
|
221
|
+
</div>
|
|
222
|
+
<button class="btn-icon" type="button" data-close aria-label="Close"><span class="icon" data-icon="x"></span></button>
|
|
223
|
+
</div>
|
|
224
|
+
<div class="dialog-body">
|
|
225
|
+
<p class="muted-text">Stop apilive with <kbd class="kbd">Ctrl</kbd> <kbd class="kbd">C</kbd>, then run:</p>
|
|
226
|
+
<button class="command" type="button" id="updateCommand" title="Copy command">
|
|
227
|
+
<span class="command-prompt">$</span><span id="updateCommandText"></span><span class="icon icon-sm" data-icon="copy"></span>
|
|
228
|
+
</button>
|
|
229
|
+
<p class="muted-text small">apilive never installs updates by itself. You decide when to update.</p>
|
|
230
|
+
</div>
|
|
231
|
+
<div class="dialog-foot dialog-foot-end">
|
|
232
|
+
<a class="btn btn-secondary" id="releaseNotesLink" target="_blank" rel="noopener noreferrer">Release notes<span class="icon icon-sm" data-icon="external"></span></a>
|
|
233
|
+
<button class="btn btn-primary" type="button" data-close>Done</button>
|
|
234
|
+
</div>
|
|
235
|
+
</dialog>
|
|
236
|
+
|
|
237
|
+
<!-- Detail sheet -->
|
|
238
|
+
<div class="sheet-backdrop" id="sheetBackdrop" hidden></div>
|
|
239
|
+
<aside class="sheet" id="sheet" role="dialog" aria-modal="true" aria-labelledby="sheetTitle" hidden></aside>
|
|
240
|
+
|
|
241
|
+
<div class="menu" id="menu" role="menu" hidden></div>
|
|
242
|
+
<div class="toasts" id="toasts" aria-live="polite"></div>
|
|
243
|
+
</body>
|
|
244
|
+
</html>
|