@nordsym/apiclaw 2.1.0 ā 2.2.1
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/README.md +15 -2
- package/dist/bin-http.js +0 -0
- package/dist/bin.bundled.js +79288 -0
- package/dist/funnel-client.d.ts +24 -0
- package/dist/funnel-client.d.ts.map +1 -0
- package/dist/funnel-client.js +131 -0
- package/dist/funnel-client.js.map +1 -0
- package/dist/funnel.test.d.ts +2 -0
- package/dist/funnel.test.d.ts.map +1 -0
- package/dist/funnel.test.js +145 -0
- package/dist/funnel.test.js.map +1 -0
- package/dist/gateway-client.d.ts.map +1 -1
- package/dist/gateway-client.js +24 -2
- package/dist/gateway-client.js.map +1 -1
- package/dist/index.bundled.js +61263 -0
- package/dist/index.js +161 -74
- package/dist/index.js.map +1 -1
- package/dist/postinstall.d.ts +0 -5
- package/dist/postinstall.d.ts.map +1 -1
- package/dist/postinstall.js +24 -3
- package/dist/postinstall.js.map +1 -1
- package/dist/registration-guard.d.ts +29 -0
- package/dist/registration-guard.d.ts.map +1 -0
- package/dist/registration-guard.js +87 -0
- package/dist/registration-guard.js.map +1 -0
- package/package.json +7 -2
- package/.claude/settings.local.json +0 -9
- package/.env.prod +0 -1
- package/apiclaw-README.md +0 -494
- package/convex/_generated/api.d.ts +0 -137
- package/convex/_generated/api.js +0 -23
- package/convex/_generated/dataModel.d.ts +0 -60
- package/convex/_generated/server.d.ts +0 -143
- package/convex/_generated/server.js +0 -93
- package/convex/adminActivate.ts +0 -53
- package/convex/adminStats.ts +0 -306
- package/convex/agents.ts +0 -939
- package/convex/analytics.ts +0 -187
- package/convex/apiKeys.ts +0 -220
- package/convex/backfillAnalytics.ts +0 -272
- package/convex/backfillSearchLogs.ts +0 -35
- package/convex/billing.ts +0 -834
- package/convex/capabilities.ts +0 -157
- package/convex/chains.ts +0 -1318
- package/convex/credits.ts +0 -211
- package/convex/crons.ts +0 -50
- package/convex/debugFilestackLogs.ts +0 -16
- package/convex/debugGetToken.ts +0 -18
- package/convex/directCall.ts +0 -713
- package/convex/earnProgress.ts +0 -753
- package/convex/email.ts +0 -329
- package/convex/feedback.ts +0 -265
- package/convex/http.ts +0 -3430
- package/convex/inbound.ts +0 -32
- package/convex/logs.ts +0 -701
- package/convex/migrateFilestack.ts +0 -81
- package/convex/migratePartnersProd.ts +0 -174
- package/convex/migratePratham.ts +0 -126
- package/convex/migrateProviderWorkspaces.ts +0 -175
- package/convex/mou.ts +0 -91
- package/convex/providerKeys.ts +0 -289
- package/convex/providers.ts +0 -1135
- package/convex/purchases.ts +0 -183
- package/convex/ratelimit.ts +0 -104
- package/convex/schema.ts +0 -869
- package/convex/searchLogs.ts +0 -265
- package/convex/seedAPILayerAPIs.ts +0 -191
- package/convex/seedDirectCallConfigs.ts +0 -336
- package/convex/seedPratham.ts +0 -149
- package/convex/spendAlerts.ts +0 -442
- package/convex/stripeActions.ts +0 -607
- package/convex/teams.ts +0 -243
- package/convex/telemetry.ts +0 -81
- package/convex/tsconfig.json +0 -25
- package/convex/updateAPIStatus.ts +0 -44
- package/convex/usage.ts +0 -260
- package/convex/usageReports.ts +0 -357
- package/convex/waitlist.ts +0 -55
- package/convex/webhooks.ts +0 -494
- package/convex/workspaceSettings.ts +0 -143
- package/convex/workspaces.ts +0 -1331
- package/convex.json +0 -3
- package/direct-test.mjs +0 -51
- package/email-templates/filestack-provider-outreach.html +0 -162
- package/email-templates/partnership-template.html +0 -116
- package/email-templates/pratham-draft-preview.txt +0 -57
- package/email-templates/pratham-partnership-draft.html +0 -141
- package/reports/APIClaw-Session-Report-2026-04-05.pdf +0 -0
- package/reports/pipeline/PIPELINE-REPORT.json +0 -153
- package/reports/pipeline/acquire_apisguru.json +0 -17
- package/reports/pipeline/capabilities.json +0 -38
- package/reports/pipeline/discover_azure_recursive.json +0 -1551
- package/reports/pipeline/discover_github.json +0 -25
- package/reports/pipeline/discover_github_repos.json +0 -49
- package/reports/pipeline/discover_swaggerhub.json +0 -24
- package/reports/pipeline/discover_well_known.json +0 -23
- package/reports/pipeline/fetch_specs.json +0 -19
- package/reports/pipeline/generate_providers.json +0 -14
- package/reports/pipeline/match_registry.json +0 -11
- package/reports/pipeline/parse_specs.json +0 -17
- package/reports/pipeline/promote_candidates.json +0 -34
- package/reports/pipeline/validate.json +0 -30
- package/reports/pipeline/validate_smoke_details.json +0 -3835
- package/reports/session-report-2026-04-05.html +0 -433
- package/seed-apis-direct.mjs +0 -106
- package/src/access-control.ts +0 -174
- package/src/adapters/base.ts +0 -364
- package/src/adapters/claude-desktop.ts +0 -41
- package/src/adapters/cline.ts +0 -88
- package/src/adapters/continue.ts +0 -91
- package/src/adapters/cursor.ts +0 -43
- package/src/adapters/custom.ts +0 -188
- package/src/adapters/detect.ts +0 -202
- package/src/adapters/index.ts +0 -47
- package/src/adapters/windsurf.ts +0 -44
- package/src/bin-http.ts +0 -45
- package/src/bin.ts +0 -34
- package/src/capability-router.ts +0 -331
- package/src/chainExecutor.ts +0 -730
- package/src/chainResolver.test.ts +0 -246
- package/src/chainResolver.ts +0 -658
- package/src/cli/commands/demo.ts +0 -109
- package/src/cli/commands/doctor.ts +0 -435
- package/src/cli/commands/index.ts +0 -9
- package/src/cli/commands/login.ts +0 -203
- package/src/cli/commands/mcp-install.ts +0 -373
- package/src/cli/commands/restore.ts +0 -333
- package/src/cli/commands/setup.ts +0 -297
- package/src/cli/commands/uninstall.ts +0 -240
- package/src/cli/index.ts +0 -148
- package/src/cli.ts +0 -370
- package/src/confirmation.ts +0 -296
- package/src/credentials.ts +0 -455
- package/src/credits.ts +0 -329
- package/src/crypto.ts +0 -75
- package/src/discovery.ts +0 -568
- package/src/enterprise/env.ts +0 -156
- package/src/enterprise/index.ts +0 -7
- package/src/enterprise/script-generator.ts +0 -481
- package/src/execute-dynamic.ts +0 -617
- package/src/execute.ts +0 -2386
- package/src/gateway-client.ts +0 -192
- package/src/hivr-whitelist.ts +0 -110
- package/src/http-api.ts +0 -286
- package/src/http-server-minimal.ts +0 -154
- package/src/index.ts +0 -2611
- package/src/intelligent-gateway.ts +0 -339
- package/src/mcp-analytics.ts +0 -156
- package/src/metered.ts +0 -149
- package/src/open-apis-generated.ts +0 -157
- package/src/open-apis.ts +0 -558
- package/src/postinstall.ts +0 -18
- package/src/product-whitelist.ts +0 -246
- package/src/proxy.ts +0 -36
- package/src/session.ts +0 -129
- package/src/stripe.ts +0 -497
- package/src/telemetry.ts +0 -71
- package/src/test.ts +0 -135
- package/src/types/convex-api.d.ts +0 -20
- package/src/types/convex-api.ts +0 -21
- package/src/types.ts +0 -109
- package/src/ui/colors.ts +0 -219
- package/src/ui/errors.ts +0 -394
- package/src/ui/index.ts +0 -17
- package/src/ui/prompts.ts +0 -390
- package/src/ui/spinner.ts +0 -325
- package/src/utils/backup.ts +0 -224
- package/src/utils/config.ts +0 -318
- package/src/utils/os.ts +0 -124
- package/src/utils/paths.ts +0 -203
- package/src/webhook.ts +0 -107
- package/test-10-working.cjs +0 -97
- package/test-14-final.cjs +0 -96
- package/test-actual-handlers.ts +0 -92
- package/test-apilayer-all-14.ts +0 -249
- package/test-apilayer-fixed.ts +0 -248
- package/test-direct-endpoints.ts +0 -174
- package/test-exact-endpoints.ts +0 -144
- package/test-final.ts +0 -83
- package/test-full-routing.ts +0 -100
- package/test-handlers-correct.ts +0 -217
- package/test-numverify-key.ts +0 -41
- package/test-via-handlers.ts +0 -92
- package/test-worldnews.mjs +0 -26
- package/tsconfig.json +0 -20
|
@@ -1,433 +0,0 @@
|
|
|
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.0">
|
|
6
|
-
<title>APIClaw Session Report ā 2026-04-05</title>
|
|
7
|
-
<style>
|
|
8
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
|
|
9
|
-
|
|
10
|
-
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
11
|
-
|
|
12
|
-
body {
|
|
13
|
-
font-family: 'Inter', -apple-system, sans-serif;
|
|
14
|
-
background: #0a0a0a;
|
|
15
|
-
color: #e5e5e5;
|
|
16
|
-
line-height: 1.6;
|
|
17
|
-
padding: 60px;
|
|
18
|
-
max-width: 900px;
|
|
19
|
-
margin: 0 auto;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.header {
|
|
23
|
-
text-align: center;
|
|
24
|
-
padding-bottom: 48px;
|
|
25
|
-
border-bottom: 1px solid #262626;
|
|
26
|
-
margin-bottom: 48px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.header .logo { font-size: 48px; margin-bottom: 12px; }
|
|
30
|
-
.header h1 { font-size: 32px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
|
|
31
|
-
.header .subtitle { font-size: 14px; color: #737373; margin-top: 8px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; }
|
|
32
|
-
.header .date { font-size: 13px; color: #525252; margin-top: 16px; }
|
|
33
|
-
|
|
34
|
-
.highlight-box {
|
|
35
|
-
background: linear-gradient(135deg, #ef4444/10, #ef4444/5);
|
|
36
|
-
border: 1px solid #ef4444/30;
|
|
37
|
-
border-radius: 12px;
|
|
38
|
-
padding: 24px 28px;
|
|
39
|
-
margin-bottom: 40px;
|
|
40
|
-
text-align: center;
|
|
41
|
-
}
|
|
42
|
-
.highlight-box p { font-size: 16px; color: #fca5a5; font-weight: 600; }
|
|
43
|
-
.highlight-box .sub { font-size: 13px; color: #a3a3a3; margin-top: 8px; font-weight: 400; }
|
|
44
|
-
|
|
45
|
-
h2 {
|
|
46
|
-
font-size: 20px;
|
|
47
|
-
font-weight: 700;
|
|
48
|
-
color: #fff;
|
|
49
|
-
margin: 40px 0 20px;
|
|
50
|
-
padding-bottom: 10px;
|
|
51
|
-
border-bottom: 1px solid #1a1a1a;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
h3 {
|
|
55
|
-
font-size: 15px;
|
|
56
|
-
font-weight: 600;
|
|
57
|
-
color: #ef4444;
|
|
58
|
-
margin: 28px 0 12px;
|
|
59
|
-
text-transform: uppercase;
|
|
60
|
-
letter-spacing: 1px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
p { font-size: 14px; color: #a3a3a3; margin-bottom: 12px; }
|
|
64
|
-
|
|
65
|
-
.feature-grid {
|
|
66
|
-
display: grid;
|
|
67
|
-
grid-template-columns: 1fr 1fr;
|
|
68
|
-
gap: 16px;
|
|
69
|
-
margin: 20px 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.feature-card {
|
|
73
|
-
background: #141414;
|
|
74
|
-
border: 1px solid #262626;
|
|
75
|
-
border-radius: 10px;
|
|
76
|
-
padding: 20px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.feature-card .num {
|
|
80
|
-
font-size: 11px;
|
|
81
|
-
font-weight: 700;
|
|
82
|
-
color: #ef4444;
|
|
83
|
-
letter-spacing: 2px;
|
|
84
|
-
text-transform: uppercase;
|
|
85
|
-
margin-bottom: 8px;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.feature-card h4 {
|
|
89
|
-
font-size: 15px;
|
|
90
|
-
font-weight: 700;
|
|
91
|
-
color: #fff;
|
|
92
|
-
margin-bottom: 6px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.feature-card p { font-size: 12px; color: #737373; margin: 0; }
|
|
96
|
-
|
|
97
|
-
table {
|
|
98
|
-
width: 100%;
|
|
99
|
-
border-collapse: collapse;
|
|
100
|
-
margin: 16px 0;
|
|
101
|
-
font-size: 13px;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
th {
|
|
105
|
-
text-align: left;
|
|
106
|
-
padding: 10px 14px;
|
|
107
|
-
background: #141414;
|
|
108
|
-
color: #a3a3a3;
|
|
109
|
-
font-weight: 600;
|
|
110
|
-
font-size: 11px;
|
|
111
|
-
text-transform: uppercase;
|
|
112
|
-
letter-spacing: 1px;
|
|
113
|
-
border-bottom: 1px solid #262626;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
td {
|
|
117
|
-
padding: 10px 14px;
|
|
118
|
-
border-bottom: 1px solid #1a1a1a;
|
|
119
|
-
color: #d4d4d4;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.status-pass {
|
|
123
|
-
color: #4ade80;
|
|
124
|
-
font-weight: 600;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.status-live {
|
|
128
|
-
background: #4ade80/15;
|
|
129
|
-
color: #4ade80;
|
|
130
|
-
padding: 2px 10px;
|
|
131
|
-
border-radius: 20px;
|
|
132
|
-
font-size: 11px;
|
|
133
|
-
font-weight: 600;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
code {
|
|
137
|
-
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
138
|
-
background: #1a1a1a;
|
|
139
|
-
padding: 2px 6px;
|
|
140
|
-
border-radius: 4px;
|
|
141
|
-
font-size: 12px;
|
|
142
|
-
color: #fca5a5;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
pre {
|
|
146
|
-
background: #141414;
|
|
147
|
-
border: 1px solid #262626;
|
|
148
|
-
border-radius: 8px;
|
|
149
|
-
padding: 16px 20px;
|
|
150
|
-
overflow-x: auto;
|
|
151
|
-
margin: 12px 0;
|
|
152
|
-
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
153
|
-
font-size: 12px;
|
|
154
|
-
line-height: 1.5;
|
|
155
|
-
color: #d4d4d4;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.e2e-chain {
|
|
159
|
-
display: flex;
|
|
160
|
-
align-items: center;
|
|
161
|
-
justify-content: center;
|
|
162
|
-
gap: 8px;
|
|
163
|
-
padding: 20px;
|
|
164
|
-
margin: 20px 0;
|
|
165
|
-
background: #141414;
|
|
166
|
-
border: 1px solid #262626;
|
|
167
|
-
border-radius: 10px;
|
|
168
|
-
flex-wrap: wrap;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.e2e-chain .node {
|
|
172
|
-
background: #1a1a1a;
|
|
173
|
-
border: 1px solid #333;
|
|
174
|
-
padding: 8px 14px;
|
|
175
|
-
border-radius: 6px;
|
|
176
|
-
font-size: 12px;
|
|
177
|
-
font-weight: 600;
|
|
178
|
-
color: #fff;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.e2e-chain .arrow { color: #ef4444; font-size: 16px; font-weight: 700; }
|
|
182
|
-
|
|
183
|
-
.files-list {
|
|
184
|
-
list-style: none;
|
|
185
|
-
margin: 12px 0;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.files-list li {
|
|
189
|
-
padding: 8px 0;
|
|
190
|
-
border-bottom: 1px solid #1a1a1a;
|
|
191
|
-
font-size: 13px;
|
|
192
|
-
display: flex;
|
|
193
|
-
gap: 12px;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.files-list li code { flex-shrink: 0; }
|
|
197
|
-
.files-list li span { color: #737373; }
|
|
198
|
-
|
|
199
|
-
.footer {
|
|
200
|
-
margin-top: 60px;
|
|
201
|
-
padding-top: 24px;
|
|
202
|
-
border-top: 1px solid #262626;
|
|
203
|
-
text-align: center;
|
|
204
|
-
font-size: 12px;
|
|
205
|
-
color: #525252;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.footer .brand { color: #737373; font-weight: 600; }
|
|
209
|
-
|
|
210
|
-
.badge {
|
|
211
|
-
display: inline-block;
|
|
212
|
-
padding: 3px 10px;
|
|
213
|
-
border-radius: 20px;
|
|
214
|
-
font-size: 11px;
|
|
215
|
-
font-weight: 600;
|
|
216
|
-
}
|
|
217
|
-
.badge-green { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
|
|
218
|
-
.badge-red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
|
|
219
|
-
.badge-new { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
|
|
220
|
-
|
|
221
|
-
@media print {
|
|
222
|
-
body { background: #fff; color: #1a1a1a; padding: 40px; }
|
|
223
|
-
.feature-card, pre, .e2e-chain { background: #f5f5f5; border-color: #e5e5e5; }
|
|
224
|
-
.feature-card p, p { color: #525252; }
|
|
225
|
-
td { color: #1a1a1a; }
|
|
226
|
-
th { background: #f5f5f5; color: #525252; }
|
|
227
|
-
h2 { border-bottom-color: #e5e5e5; }
|
|
228
|
-
code { background: #f0f0f0; color: #dc2626; }
|
|
229
|
-
.e2e-chain .node { background: #f0f0f0; border-color: #d4d4d4; color: #1a1a1a; }
|
|
230
|
-
}
|
|
231
|
-
</style>
|
|
232
|
-
</head>
|
|
233
|
-
<body>
|
|
234
|
-
|
|
235
|
-
<div class="header">
|
|
236
|
-
<div class="logo">🦞</div>
|
|
237
|
-
<h1>APIClaw Session Report</h1>
|
|
238
|
-
<div class="subtitle">The API Layer for AI Agents</div>
|
|
239
|
-
<div class="date">Session: April 5, 2026 — NordSym AB</div>
|
|
240
|
-
</div>
|
|
241
|
-
|
|
242
|
-
<div class="highlight-box">
|
|
243
|
-
<p>APIClaw is now a live production API gateway.</p>
|
|
244
|
-
<div class="sub">Telegram bot responding via APIClaw. Anthropic OAuth dependency eliminated. E2E proven.</div>
|
|
245
|
-
</div>
|
|
246
|
-
|
|
247
|
-
<!-- ========== FEATURES ========== -->
|
|
248
|
-
<h2>What We Built</h2>
|
|
249
|
-
|
|
250
|
-
<div class="feature-grid">
|
|
251
|
-
<div class="feature-card">
|
|
252
|
-
<div class="num">Feature 1</div>
|
|
253
|
-
<h4>Workspace API Keys</h4>
|
|
254
|
-
<p>Generate persistent <code>sk-claw-</code> keys in your workspace. One key, every API. Keys are hashed after creation -- shown once, never stored in plain text.</p>
|
|
255
|
-
</div>
|
|
256
|
-
<div class="feature-card">
|
|
257
|
-
<div class="num">Feature 2</div>
|
|
258
|
-
<h4>Unified Auth Layer</h4>
|
|
259
|
-
<p>All 15+ proxy endpoints upgraded in one change. Accepts <code>Authorization: Bearer sk-claw-...</code> alongside legacy identifier auth. Zero breaking changes.</p>
|
|
260
|
-
</div>
|
|
261
|
-
<div class="feature-card">
|
|
262
|
-
<div class="num">Feature 3</div>
|
|
263
|
-
<h4>Gateway /v1/chat/completions</h4>
|
|
264
|
-
<p>OpenAI-compatible LLM endpoint. Routes to OpenRouter (800+ models). Streaming support. Usage tracking. Standard protocol -- works with any AI tool.</p>
|
|
265
|
-
</div>
|
|
266
|
-
<div class="feature-card">
|
|
267
|
-
<div class="num">Feature 4</div>
|
|
268
|
-
<h4>OpenClaw Integration</h4>
|
|
269
|
-
<p>APIClaw configured as a first-class provider in OpenClaw. Telegram bots now powered entirely by APIClaw gateway. No direct Anthropic key needed.</p>
|
|
270
|
-
</div>
|
|
271
|
-
</div>
|
|
272
|
-
|
|
273
|
-
<!-- ========== E2E CHAIN ========== -->
|
|
274
|
-
<h2>E2E Architecture</h2>
|
|
275
|
-
|
|
276
|
-
<div class="e2e-chain">
|
|
277
|
-
<div class="node">Telegram</div>
|
|
278
|
-
<div class="arrow">→</div>
|
|
279
|
-
<div class="node">OpenClaw Gateway</div>
|
|
280
|
-
<div class="arrow">→</div>
|
|
281
|
-
<div class="node">APIClaw Gateway<br><small style="color:#ef4444">sk-claw-...q6Yd</small></div>
|
|
282
|
-
<div class="arrow">→</div>
|
|
283
|
-
<div class="node">OpenRouter</div>
|
|
284
|
-
<div class="arrow">→</div>
|
|
285
|
-
<div class="node">Claude Sonnet 4.6</div>
|
|
286
|
-
</div>
|
|
287
|
-
|
|
288
|
-
<!-- ========== TEST RESULTS ========== -->
|
|
289
|
-
<h2>E2E Test Results</h2>
|
|
290
|
-
|
|
291
|
-
<table>
|
|
292
|
-
<thead>
|
|
293
|
-
<tr><th>Test</th><th>Result</th><th>Latency</th></tr>
|
|
294
|
-
</thead>
|
|
295
|
-
<tbody>
|
|
296
|
-
<tr>
|
|
297
|
-
<td><code>GET /v1/models</code> on prod</td>
|
|
298
|
-
<td class="status-pass">13 models listed</td>
|
|
299
|
-
<td>--</td>
|
|
300
|
-
</tr>
|
|
301
|
-
<tr>
|
|
302
|
-
<td>Fake key rejection</td>
|
|
303
|
-
<td class="status-pass">401 with error message</td>
|
|
304
|
-
<td>--</td>
|
|
305
|
-
</tr>
|
|
306
|
-
<tr>
|
|
307
|
-
<td><code>sk-claw-</code> → Gateway → OpenRouter → Claude</td>
|
|
308
|
-
<td class="status-pass">Response received</td>
|
|
309
|
-
<td>2.2s</td>
|
|
310
|
-
</tr>
|
|
311
|
-
<tr>
|
|
312
|
-
<td>OpenClaw CLI → APIClaw → Telegram delivery</td>
|
|
313
|
-
<td class="status-pass">"APIClaw e2e works through OpenClaw"</td>
|
|
314
|
-
<td>17.8s</td>
|
|
315
|
-
</tr>
|
|
316
|
-
<tr>
|
|
317
|
-
<td>Telegram DM → bot responds</td>
|
|
318
|
-
<td class="status-pass">Confirmed live by operator</td>
|
|
319
|
-
<td>--</td>
|
|
320
|
-
</tr>
|
|
321
|
-
</tbody>
|
|
322
|
-
</table>
|
|
323
|
-
|
|
324
|
-
<!-- ========== BACKEND DETAIL ========== -->
|
|
325
|
-
<h2>Backend: API Keys</h2>
|
|
326
|
-
|
|
327
|
-
<h3>Schema (convex/schema.ts)</h3>
|
|
328
|
-
<pre>workspaceApiKeys: defineTable({
|
|
329
|
-
workspaceId: v.id("workspaces"),
|
|
330
|
-
key: v.string(),
|
|
331
|
-
keyHash: v.string(), // SHA lookup (raw key not stored)
|
|
332
|
-
keyPrefix: v.string(), // "sk-claw-...last4" for display
|
|
333
|
-
name: v.string(), // user label
|
|
334
|
-
lastUsedAt: v.optional(v.number()),
|
|
335
|
-
createdAt: v.number(),
|
|
336
|
-
revokedAt: v.optional(v.number()),
|
|
337
|
-
})
|
|
338
|
-
.index("by_keyHash", ["keyHash"])
|
|
339
|
-
.index("by_workspaceId", ["workspaceId"])</pre>
|
|
340
|
-
|
|
341
|
-
<h3>Functions (convex/apiKeys.ts)</h3>
|
|
342
|
-
<table>
|
|
343
|
-
<thead><tr><th>Function</th><th>Type</th><th>Purpose</th></tr></thead>
|
|
344
|
-
<tbody>
|
|
345
|
-
<tr><td><code>generateKey</code></td><td>mutation</td><td>Create key, return raw ONCE, store hash only</td></tr>
|
|
346
|
-
<tr><td><code>listKeys</code></td><td>query</td><td>Return prefix + metadata (never raw key)</td></tr>
|
|
347
|
-
<tr><td><code>revokeKey</code></td><td>mutation</td><td>Soft delete with revokedAt timestamp</td></tr>
|
|
348
|
-
<tr><td><code>resolveKey</code></td><td>internalQuery</td><td>Hash lookup for gateway auth</td></tr>
|
|
349
|
-
<tr><td><code>touchKey</code></td><td>mutation</td><td>Update lastUsedAt on each use</td></tr>
|
|
350
|
-
</tbody>
|
|
351
|
-
</table>
|
|
352
|
-
|
|
353
|
-
<!-- ========== GATEWAY DETAIL ========== -->
|
|
354
|
-
<h2>Backend: Gateway</h2>
|
|
355
|
-
|
|
356
|
-
<h3>Auth Resolution (convex/http.ts)</h3>
|
|
357
|
-
<pre>resolveWorkspaceFromRequest(ctx, request)
|
|
358
|
-
1. Authorization: Bearer sk-claw-... → resolveKey → workspaceId
|
|
359
|
-
2. X-APIClaw-Identifier (legacy) → workspaceId
|
|
360
|
-
3. Anonymous → allowed, untracked</pre>
|
|
361
|
-
|
|
362
|
-
<h3>Endpoints</h3>
|
|
363
|
-
<table>
|
|
364
|
-
<thead><tr><th>Endpoint</th><th>Method</th><th>Auth</th><th>Purpose</th></tr></thead>
|
|
365
|
-
<tbody>
|
|
366
|
-
<tr><td><code>/v1/chat/completions</code></td><td>POST</td><td>sk-claw- required</td><td>OpenAI-compatible LLM gateway</td></tr>
|
|
367
|
-
<tr><td><code>/v1/models</code></td><td>GET</td><td>optional</td><td>List available models</td></tr>
|
|
368
|
-
<tr><td><code>/proxy/*</code> (15+ routes)</td><td>POST</td><td>sk-claw- or legacy</td><td>All existing API proxies</td></tr>
|
|
369
|
-
</tbody>
|
|
370
|
-
</table>
|
|
371
|
-
|
|
372
|
-
<!-- ========== OPENCLAW CONFIG ========== -->
|
|
373
|
-
<h2>OpenClaw Configuration</h2>
|
|
374
|
-
|
|
375
|
-
<pre>{
|
|
376
|
-
"models": {
|
|
377
|
-
"providers": {
|
|
378
|
-
"apiclaw": {
|
|
379
|
-
"baseUrl": "https://adventurous-avocet-799.convex.site/v1",
|
|
380
|
-
"apiKey": "sk-claw-...q6Yd",
|
|
381
|
-
"api": "openai-completions",
|
|
382
|
-
"auth": "api-key",
|
|
383
|
-
"models": [
|
|
384
|
-
{ "id": "anthropic/claude-sonnet-4-6", "name": "Claude Sonnet 4.6" },
|
|
385
|
-
{ "id": "anthropic/claude-haiku-3.5", "name": "Claude Haiku 3.5" },
|
|
386
|
-
{ "id": "openai/gpt-4o", "name": "GPT-4o" },
|
|
387
|
-
{ "id": "google/gemini-2.5-pro-preview", "name": "Gemini 2.5 Pro" },
|
|
388
|
-
{ "id": "meta-llama/llama-3.3-70b-instruct", "name": "Llama 3.3 70B" },
|
|
389
|
-
{ "id": "deepseek/deepseek-chat", "name": "DeepSeek Chat" }
|
|
390
|
-
]
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
}</pre>
|
|
395
|
-
|
|
396
|
-
<p><strong>Key discovery:</strong> OpenClaw appends <code>/chat/completions</code> to baseUrl. The baseUrl must include <code>/v1</code>.</p>
|
|
397
|
-
|
|
398
|
-
<!-- ========== FILES ========== -->
|
|
399
|
-
<h2>Files Changed</h2>
|
|
400
|
-
|
|
401
|
-
<ul class="files-list">
|
|
402
|
-
<li><code>convex/schema.ts</code> <span>Added workspaceApiKeys table + indexes</span></li>
|
|
403
|
-
<li><code>convex/apiKeys.ts</code> <span class="badge badge-new">NEW</span> <span>Generate, list, revoke, resolve, touch</span></li>
|
|
404
|
-
<li><code>convex/http.ts</code> <span>Unified auth + /v1/chat/completions + /v1/models</span></li>
|
|
405
|
-
<li><code>landing/.../workspace/page.tsx</code> <span>API Keys tab + nav + config snippet</span></li>
|
|
406
|
-
<li><code>~/.openclaw/openclaw.json</code> <span>APIClaw as primary provider, Telegram restored</span></li>
|
|
407
|
-
</ul>
|
|
408
|
-
|
|
409
|
-
<!-- ========== PRODUCTION STATE ========== -->
|
|
410
|
-
<h2>Production State</h2>
|
|
411
|
-
|
|
412
|
-
<table>
|
|
413
|
-
<thead><tr><th>Component</th><th>Status</th><th>Detail</th></tr></thead>
|
|
414
|
-
<tbody>
|
|
415
|
-
<tr><td>Convex prod</td><td><span class="badge badge-green">DEPLOYED</span></td><td>adventurous-avocet-799</td></tr>
|
|
416
|
-
<tr><td>Gateway endpoint</td><td><span class="badge badge-green">LIVE</span></td><td>/v1/chat/completions responding</td></tr>
|
|
417
|
-
<tr><td>Prod API key</td><td><span class="badge badge-green">ACTIVE</span></td><td>sk-claw-...q6Yd ("OpenClaw Production")</td></tr>
|
|
418
|
-
<tr><td>OpenClaw default model</td><td><span class="badge badge-green">ACTIVE</span></td><td>apiclaw/anthropic/claude-sonnet-4-6</td></tr>
|
|
419
|
-
<tr><td>Telegram bots</td><td><span class="badge badge-green">LIVE</span></td><td>4 accounts responding</td></tr>
|
|
420
|
-
<tr><td>Anthropic OAuth</td><td><span class="badge badge-red">ELIMINATED</span></td><td>No longer needed</td></tr>
|
|
421
|
-
<tr><td>Frontend build</td><td><span class="badge badge-green">CLEAN</span></td><td>Next.js + Convex both pass</td></tr>
|
|
422
|
-
</tbody>
|
|
423
|
-
</table>
|
|
424
|
-
|
|
425
|
-
<!-- ========== FOOTER ========== -->
|
|
426
|
-
<div class="footer">
|
|
427
|
-
<p class="brand">NordSym AB (559535-5768)</p>
|
|
428
|
-
<p>APIClaw -- The API Layer for AI Agents</p>
|
|
429
|
-
<p>Session report generated April 5, 2026</p>
|
|
430
|
-
</div>
|
|
431
|
-
|
|
432
|
-
</body>
|
|
433
|
-
</html>
|
package/seed-apis-direct.mjs
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Direct seed - create provider + all 27 APIs via Convex admin endpoint
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const apis = [
|
|
7
|
-
// Unified APIs (14)
|
|
8
|
-
{ name: "ExchangeRate API", description: "Real-time exchange rates and currency conversion", category: "finance" },
|
|
9
|
-
{ name: "Marketstack", description: "Real-time, intraday & historical market data", category: "finance" },
|
|
10
|
-
{ name: "AviationStack", description: "Real-time flight status & global aviation data", category: "geolocation" },
|
|
11
|
-
{ name: "PDF Layer", description: "High quality HTML to PDF conversion", category: "business" },
|
|
12
|
-
{ name: "Screenshot Layer", description: "Capture website screenshots", category: "marketing" },
|
|
13
|
-
{ name: "Email Verification API", description: "Verify email addresses in real-time", category: "devtools" },
|
|
14
|
-
{ name: "Number Verification API", description: "Validate phone numbers globally", category: "devtools" },
|
|
15
|
-
{ name: "VAT Layer", description: "EU VAT number validation", category: "finance" },
|
|
16
|
-
{ name: "World News API", description: "Extract news from any URL", category: "news" },
|
|
17
|
-
{ name: "Finance News API", description: "Real-time financial news feed", category: "news" },
|
|
18
|
-
{ name: "Advanced Scraper API", description: "Web scraping without the hassle", category: "scraping" },
|
|
19
|
-
{ name: "Image Crop API", description: "Smart image cropping", category: "marketing" },
|
|
20
|
-
{ name: "Skills API", description: "Search skill database", category: "devtools" },
|
|
21
|
-
{ name: "Form API", description: "Form submission handling", category: "devtools" },
|
|
22
|
-
|
|
23
|
-
// Legacy APIs (13)
|
|
24
|
-
{ name: "Fixer API", description: "Foreign exchange rates & currency conversion", category: "finance" },
|
|
25
|
-
{ name: "Currencylayer", description: "Reliable exchange rates for your business", category: "finance" },
|
|
26
|
-
{ name: "Coinlayer", description: "Real-time crypto currency exchange rates", category: "finance" },
|
|
27
|
-
{ name: "Exchangerate.host", description: "Free exchange rates API", category: "finance" },
|
|
28
|
-
{ name: "Weatherstack", description: "Real-time & historical weather data", category: "geolocation" },
|
|
29
|
-
{ name: "IPstack", description: "Locate and identify website visitors by IP", category: "geolocation" },
|
|
30
|
-
{ name: "IPapi", description: "IP address geolocation lookup", category: "geolocation" },
|
|
31
|
-
{ name: "Positionstack", description: "Forward & reverse geocoding", category: "geolocation" },
|
|
32
|
-
{ name: "Languagelayer", description: "Powerful language detection", category: "devtools" },
|
|
33
|
-
{ name: "Scrapestack", description: "Real-time web scraping", category: "scraping" },
|
|
34
|
-
{ name: "Serpstack", description: "Google search results API", category: "scraping" },
|
|
35
|
-
{ name: "Mediastack", description: "Live news & blog articles", category: "news" },
|
|
36
|
-
{ name: "Userstack", description: "Detect any browser, device & OS", category: "devtools" },
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
console.log("š Seed data prepared:");
|
|
40
|
-
console.log(` Total APIs: ${apis.length}`);
|
|
41
|
-
console.log("\nš Copy/paste this into Convex dashboard:\n");
|
|
42
|
-
console.log("=" * 60);
|
|
43
|
-
|
|
44
|
-
const seedCode = `
|
|
45
|
-
// Run this in Convex dashboard (Functions > Run > Custom)
|
|
46
|
-
|
|
47
|
-
const email = "gustav_hemmingsson@hotmail.com";
|
|
48
|
-
|
|
49
|
-
// 1. Create or get provider
|
|
50
|
-
let provider = await ctx.db
|
|
51
|
-
.query("providers")
|
|
52
|
-
.withIndex("by_email", (q) => q.eq("email", email))
|
|
53
|
-
.first();
|
|
54
|
-
|
|
55
|
-
if (!provider) {
|
|
56
|
-
const providerId = await ctx.db.insert("providers", {
|
|
57
|
-
email,
|
|
58
|
-
name: "APILayer",
|
|
59
|
-
company: "APILayer",
|
|
60
|
-
website: "https://apilayer.com",
|
|
61
|
-
status: "approved",
|
|
62
|
-
stripeOnboardingComplete: false,
|
|
63
|
-
createdAt: Date.now(),
|
|
64
|
-
updatedAt: Date.now(),
|
|
65
|
-
approvedAt: Date.now(),
|
|
66
|
-
});
|
|
67
|
-
provider = await ctx.db.get(providerId);
|
|
68
|
-
console.log("ā Provider created");
|
|
69
|
-
} else {
|
|
70
|
-
console.log("ā Provider exists");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// 2. Add all APIs
|
|
74
|
-
const apis = ${JSON.stringify(apis, null, 2)};
|
|
75
|
-
|
|
76
|
-
let created = 0;
|
|
77
|
-
for (const api of apis) {
|
|
78
|
-
const existing = await ctx.db
|
|
79
|
-
.query("providerAPIs")
|
|
80
|
-
.withIndex("by_providerId", (q) => q.eq("providerId", provider._id))
|
|
81
|
-
.filter((q) => q.eq(q.field("name"), api.name))
|
|
82
|
-
.first();
|
|
83
|
-
|
|
84
|
-
if (!existing) {
|
|
85
|
-
await ctx.db.insert("providerAPIs", {
|
|
86
|
-
providerId: provider._id,
|
|
87
|
-
name: api.name,
|
|
88
|
-
description: api.description,
|
|
89
|
-
category: api.category,
|
|
90
|
-
pricingModel: "freemium",
|
|
91
|
-
pricingNotes: "Free tier available",
|
|
92
|
-
status: "approved",
|
|
93
|
-
createdAt: Date.now(),
|
|
94
|
-
approvedAt: Date.now(),
|
|
95
|
-
discoveryCount: 0,
|
|
96
|
-
});
|
|
97
|
-
created++;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return { success: true, created, total: apis.length };
|
|
102
|
-
`;
|
|
103
|
-
|
|
104
|
-
console.log(seedCode);
|
|
105
|
-
console.log("=" * 60);
|
|
106
|
-
console.log("\nā
Ready! Go to Convex dashboard to run this.");
|