@flame0510/project-aether 1.1.9
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 +150 -0
- package/agent-templates/README.md +37 -0
- package/agent-templates/argus/AGENTS.md +52 -0
- package/agent-templates/argus/IDENTITY.md +7 -0
- package/agent-templates/argus/MEMORY.md +9 -0
- package/agent-templates/argus/SOUL.md +24 -0
- package/agent-templates/argus/TOOLS.md +8 -0
- package/agent-templates/atlas/AGENTS.md +47 -0
- package/agent-templates/atlas/HEARTBEAT.md +10 -0
- package/agent-templates/atlas/IDENTITY.md +6 -0
- package/agent-templates/atlas/MEMORY.md +9 -0
- package/agent-templates/atlas/SOUL.md +21 -0
- package/agent-templates/atlas/TOOLS.md +4 -0
- package/agent-templates/base-image/.trigger +0 -0
- package/agent-templates/base-image/Dockerfile +90 -0
- package/agent-templates/base-image/entrypoint.sh +37 -0
- package/agent-templates/custom/AGENTS.md +29 -0
- package/agent-templates/custom/BOOTSTRAP.md +56 -0
- package/agent-templates/custom/MEMORY.md +8 -0
- package/agent-templates/prometheus/AGENTS.md +37 -0
- package/agent-templates/prometheus/IDENTITY.md +6 -0
- package/agent-templates/prometheus/MEMORY.md +9 -0
- package/agent-templates/prometheus/SOUL.md +21 -0
- package/agent-templates/prometheus/TOOLS.md +4 -0
- package/app/agents/ChannelManager.tsx +465 -0
- package/app/agents/ImageDownloadBanner.tsx +159 -0
- package/app/agents/PageClient.tsx +1285 -0
- package/app/agents/create/PageClient.tsx +437 -0
- package/app/agents/create/page.tsx +126 -0
- package/app/agents/loading.tsx +14 -0
- package/app/agents/page.tsx +5 -0
- package/app/api/agents/[id]/backup/route.ts +169 -0
- package/app/api/agents/[id]/channels/pairing/route.ts +69 -0
- package/app/api/agents/[id]/channels/route.ts +14 -0
- package/app/api/agents/[id]/channels/telegram/route.ts +50 -0
- package/app/api/agents/[id]/lifecycle/route.ts +94 -0
- package/app/api/agents/[id]/recreate/route.ts +199 -0
- package/app/api/agents/[id]/restart/route.ts +33 -0
- package/app/api/agents/[id]/restore/route.ts +81 -0
- package/app/api/agents/[id]/route.ts +280 -0
- package/app/api/agents/channels-summary/route.ts +39 -0
- package/app/api/agents/config-json/route.ts +58 -0
- package/app/api/agents/create/route.ts +488 -0
- package/app/api/agents/download-image/route.ts +32 -0
- package/app/api/agents/image-status/route.ts +126 -0
- package/app/api/agents/route.ts +213 -0
- package/app/api/agents/token/route.ts +94 -0
- package/app/api/agents-active/route.ts +190 -0
- package/app/api/agents-config/route.ts +629 -0
- package/app/api/alerts/smoke/route.ts +26 -0
- package/app/api/aliases/add/route.ts +28 -0
- package/app/api/aliases/remove/route.ts +27 -0
- package/app/api/assistant/route.ts +204 -0
- package/app/api/auth/check/route.ts +38 -0
- package/app/api/auth/login/route.ts +85 -0
- package/app/api/auth/logout/route.ts +7 -0
- package/app/api/auth/status/route.ts +33 -0
- package/app/api/config/env/route.ts +132 -0
- package/app/api/config/restart/route.ts +26 -0
- package/app/api/containers/route.ts +75 -0
- package/app/api/cost-override/route.ts +46 -0
- package/app/api/costs/route.ts +84 -0
- package/app/api/credentials/[id]/reveal/route.ts +21 -0
- package/app/api/credentials/[id]/route.ts +52 -0
- package/app/api/credentials/[id]/sync/route.ts +58 -0
- package/app/api/credentials/detect/route.ts +246 -0
- package/app/api/credentials/route.ts +33 -0
- package/app/api/crons/[id]/route.ts +69 -0
- package/app/api/crons/route.ts +12 -0
- package/app/api/crons/runs/route.ts +31 -0
- package/app/api/debug/route.ts +11 -0
- package/app/api/envcheck/route.ts +18 -0
- package/app/api/events/route.ts +24 -0
- package/app/api/gateway/agent/route.ts +154 -0
- package/app/api/gateway/provider/balance/route.ts +38 -0
- package/app/api/gateway/provider/keys.ts +38 -0
- package/app/api/gateway/provider/oauth/route.ts +304 -0
- package/app/api/gateway/provider/route.ts +209 -0
- package/app/api/gateway/route.ts +223 -0
- package/app/api/gateway/sync.ts +189 -0
- package/app/api/lineage/route.ts +54 -0
- package/app/api/memory-context/route.ts +15 -0
- package/app/api/metrics/route.ts +35 -0
- package/app/api/models/route.ts +77 -0
- package/app/api/plugins/route.js +37 -0
- package/app/api/provider/upstream.ts +142 -0
- package/app/api/provider/v1/chat/completions/route.ts +146 -0
- package/app/api/provider/v1/models/route.ts +167 -0
- package/app/api/provider-usage/route.ts +629 -0
- package/app/api/session/route.ts +39 -0
- package/app/api/sessions/[id]/route.ts +38 -0
- package/app/api/sessions/route.ts +23 -0
- package/app/api/setup/agent-image/route.ts +102 -0
- package/app/api/setup/password/route.ts +111 -0
- package/app/api/setup/restart/route.ts +76 -0
- package/app/api/skills/delete/route.js +105 -0
- package/app/api/skills/promote/route.js +129 -0
- package/app/api/skills/route.js +203 -0
- package/app/api/skills/save/route.js +142 -0
- package/app/api/stats/route.ts +34 -0
- package/app/api/stats-since/route.ts +20 -0
- package/app/api/stream/route.ts +70 -0
- package/app/api/system-health/route.ts +233 -0
- package/app/api/tool-calls/route.ts +24 -0
- package/app/api/tools-config/route.ts +163 -0
- package/app/api/update-check/route.ts +127 -0
- package/app/api/version/route.ts +25 -0
- package/app/api/wizard/complete/route.ts +32 -0
- package/app/api/wizard/reset/route.ts +28 -0
- package/app/api/wizard/status/route.ts +28 -0
- package/app/api/workspace/route.ts +392 -0
- package/app/api/workspace/stream/route.ts +136 -0
- package/app/components/AppShell.tsx +33 -0
- package/app/components/AuthGuard.tsx +91 -0
- package/app/components/CostBreakdown.tsx +37 -0
- package/app/components/DashboardHeader.tsx +73 -0
- package/app/components/DashboardLayout.tsx +76 -0
- package/app/components/DashboardToolbar.tsx +61 -0
- package/app/components/FloatingActions.tsx +33 -0
- package/app/components/Icons.tsx +78 -0
- package/app/components/LineageGraphPage.tsx +142 -0
- package/app/components/LiveFeed.tsx +48 -0
- package/app/components/MobileBottomNav.tsx +84 -0
- package/app/components/ModelPickerModal.tsx +94 -0
- package/app/components/PasswordInput.tsx +86 -0
- package/app/components/PulseChat.tsx +362 -0
- package/app/components/Rev4aLoader.tsx +48 -0
- package/app/components/SessionDrawer.tsx +263 -0
- package/app/components/SessionTopology.tsx +289 -0
- package/app/components/Sidebar.tsx +294 -0
- package/app/components/Skeleton.tsx +133 -0
- package/app/components/SystemCockpit.tsx +169 -0
- package/app/components/VersionBanner.tsx +105 -0
- package/app/components/WizardButton.tsx +30 -0
- package/app/components/ui/Badge.tsx +30 -0
- package/app/components/ui/Button.tsx +59 -0
- package/app/components/ui/ConfirmModal.tsx +46 -0
- package/app/components/ui/FilterBar.tsx +33 -0
- package/app/components/ui/Input.tsx +25 -0
- package/app/components/ui/ItemList.tsx +83 -0
- package/app/components/ui/LoadingSpinner.tsx +30 -0
- package/app/components/ui/Metric.tsx +22 -0
- package/app/components/ui/Modal.tsx +42 -0
- package/app/components/ui/Page.tsx +18 -0
- package/app/components/ui/Pill.tsx +6 -0
- package/app/components/ui/PropertyList.tsx +24 -0
- package/app/components/ui/Select.tsx +26 -0
- package/app/components/ui/StatusCard.tsx +32 -0
- package/app/components/ui/Surface.tsx +14 -0
- package/app/components/ui/Tabs.tsx +55 -0
- package/app/components/ui/TemplateOption.tsx +59 -0
- package/app/components/ui/Toast.tsx +44 -0
- package/app/components/ui/index.ts +19 -0
- package/app/components/ui/tokens.ts +18 -0
- package/app/config/PageClient.tsx +293 -0
- package/app/config/loading.tsx +10 -0
- package/app/config/page.tsx +7 -0
- package/app/containers/ContainersClient.tsx +129 -0
- package/app/containers/loading.tsx +21 -0
- package/app/containers/page.tsx +5 -0
- package/app/containers/terminal/[id]/TerminalClient.tsx +313 -0
- package/app/containers/terminal/[id]/page.tsx +6 -0
- package/app/credentials/PageClient.tsx +598 -0
- package/app/credentials/loading.tsx +10 -0
- package/app/credentials/page.tsx +7 -0
- package/app/crons/PageClient.tsx +538 -0
- package/app/crons/loading.tsx +10 -0
- package/app/crons/page.tsx +5 -0
- package/app/design-system.ts +57 -0
- package/app/gateway/PageClient.tsx +1048 -0
- package/app/gateway/loading.tsx +24 -0
- package/app/gateway/page.tsx +5 -0
- package/app/globals.css +1474 -0
- package/app/layout.tsx +45 -0
- package/app/lib/models-context.tsx +41 -0
- package/app/lineage/loading.tsx +10 -0
- package/app/lineage/page.tsx +13 -0
- package/app/loading.tsx +16 -0
- package/app/login/page.tsx +160 -0
- package/app/memory/MemoryContextPageClient.tsx +196 -0
- package/app/memory/loading.tsx +10 -0
- package/app/memory/page.tsx +8 -0
- package/app/page.tsx +31 -0
- package/app/plugins/PageClient.tsx +296 -0
- package/app/plugins/loading.tsx +10 -0
- package/app/plugins/page.tsx +5 -0
- package/app/setup/PageClient.tsx +227 -0
- package/app/setup/loading.tsx +21 -0
- package/app/setup/page.tsx +7 -0
- package/app/skills/PageClient.tsx +499 -0
- package/app/skills/loading.tsx +10 -0
- package/app/skills/page.tsx +5 -0
- package/app/tools/ToolsPageClient.tsx +308 -0
- package/app/tools/loading.tsx +10 -0
- package/app/tools/page.tsx +62 -0
- package/app/tools/tools-catalog.ts +141 -0
- package/app/wizard/PageClient.tsx +485 -0
- package/app/wizard/icons.tsx +89 -0
- package/app/wizard/loading.tsx +24 -0
- package/app/wizard/page.tsx +7 -0
- package/app/wizard/storage.ts +33 -0
- package/app/wizard/useWizard.ts +101 -0
- package/app/workspace/WorkspaceClient.tsx +633 -0
- package/app/workspace/loading.tsx +36 -0
- package/app/workspace/page.tsx +8 -0
- package/bin/docker-entrypoint.sh +21 -0
- package/bin/postinstall.js +20 -0
- package/bin/rev4a.js +696 -0
- package/daemon.js +783 -0
- package/docs/ARCHITECTURE.md +557 -0
- package/docs/CONTAINER-TERMINAL.md +280 -0
- package/docs/DESIGN-SYSTEM.md +99 -0
- package/docs/FRONTEND-ARCHITECTURE.md +119 -0
- package/docs/REV4A.md +504 -0
- package/docs/dev/API-REFERENCE.md +1835 -0
- package/docs/dev/DATABASE.md +224 -0
- package/docs/dev/GATEWAY.md +300 -0
- package/docs/dev/PROVIDERS.md +229 -0
- package/docs/dev/SESSION-MAINTENANCE-PLAN.md +607 -0
- package/docs/dev/WORKSPACE.md +199 -0
- package/docs/rag/DATA-FRESHNESS.md +109 -0
- package/docs/rag/GLOSSARY.md +125 -0
- package/docs/rag/REV4A-OVERVIEW.md +135 -0
- package/docs/rag/WHAT-I-CAN-ANSWER.md +124 -0
- package/lib/agent-setup.ts +130 -0
- package/lib/alerts.ts +115 -0
- package/lib/apiFetch.ts +7 -0
- package/lib/auth.ts +28 -0
- package/lib/billing.ts +100 -0
- package/lib/buildAgentImage.ts +346 -0
- package/lib/channelManager.ts +386 -0
- package/lib/container.ts +60 -0
- package/lib/credentials/db.ts +86 -0
- package/lib/credentials/delivery.ts +448 -0
- package/lib/credentials/detect.ts +149 -0
- package/lib/credentials/hash.ts +9 -0
- package/lib/credentials/providers.ts +110 -0
- package/lib/credentials/vault.ts +195 -0
- package/lib/db-bootstrap.d.ts +3 -0
- package/lib/db-bootstrap.mjs +144 -0
- package/lib/db.ts +25 -0
- package/lib/docker-utils.ts +60 -0
- package/lib/hooks/useDashboard.ts +264 -0
- package/lib/hooks/useRev4aTimezone.ts +28 -0
- package/lib/hooks/useScreenshot.ts +30 -0
- package/lib/memory-context.ts +385 -0
- package/lib/model-catalogue.ts +131 -0
- package/lib/model-pricing.ts +63 -0
- package/lib/openclaw-cron.ts +350 -0
- package/lib/patterns/ApiAdapter.ts +73 -0
- package/lib/patterns/ApiClient.ts +65 -0
- package/lib/patterns/EventBus.ts +113 -0
- package/lib/patterns/FilterStrategy.ts +79 -0
- package/lib/patterns/SessionFactory.ts +117 -0
- package/lib/patterns/sessionPresentation.ts +117 -0
- package/lib/provider-balance.ts +163 -0
- package/lib/requireAuth.tsx +38 -0
- package/lib/rev4a-auth.d.ts +3 -0
- package/lib/rev4a-auth.js +36 -0
- package/lib/rev4a-paths.ts +145 -0
- package/lib/timezone.ts +46 -0
- package/lib/types/index.ts +96 -0
- package/lib/utils/format.ts +82 -0
- package/lineage.js +56 -0
- package/model-pricing.json +482 -0
- package/models.config.json +844 -0
- package/next-env.d.ts +6 -0
- package/next.config.mjs +7 -0
- package/package.json +82 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-64.png +0 -0
- package/public/favicon.svg +58 -0
- package/public/icon-192-maskable.png +0 -0
- package/public/icon-192.png +0 -0
- package/public/icon-512-maskable.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/manifest.json +38 -0
- package/public/rev4a-logo.png +0 -0
- package/public/rev4a-logo.svg +58 -0
- package/rev4a-rules/AGENTS.md +37 -0
- package/scripts/add-auth.cjs +185 -0
- package/scripts/backup.sh +66 -0
- package/scripts/check-providers.mjs +143 -0
- package/scripts/docker/traefik/docker-compose.yml +32 -0
- package/scripts/docker/traefik/dynamic/.gitkeep +18 -0
- package/scripts/docker/traefik/traefik.yml +37 -0
- package/scripts/remove-auth-profile.js +56 -0
- package/scripts/restore.sh +82 -0
- package/terminal-ws-server.js +139 -0
- package/tsconfig.json +42 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# Provider Gateway & Key Management
|
|
2
|
+
|
|
3
|
+
> **Last updated:** 2026-07-31
|
|
4
|
+
|
|
5
|
+
This document covers the Rev4a Provider Gateway (proxy),
|
|
6
|
+
the vault key endpoint, and how agent containers authenticate against the
|
|
7
|
+
Rev4a proxy.
|
|
8
|
+
|
|
9
|
+
> **Note:** The old `/providers` UI page and its API routes (`/api/providers/*`,
|
|
10
|
+
> `/api/agent-providers`) have been removed (2026-07-27). Provider/API-key
|
|
11
|
+
> configuration is now centralized in the [Gateway](../GATEWAY.md) page.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Rev4a Provider Gateway
|
|
16
|
+
|
|
17
|
+
The Rev4a server at `/api/provider/v1/` acts as an OpenAI-compatible proxy.
|
|
18
|
+
Agent containers point their `rev4a` provider to this gateway instead of
|
|
19
|
+
connecting directly to upstream APIs.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
Agent Container Rev4a Gateway Upstream API
|
|
23
|
+
│ │ │
|
|
24
|
+
│ Authorization: Bearer <rev4a-key> │
|
|
25
|
+
│ POST /api/provider/v1/chat/completions │
|
|
26
|
+
│ model: rev4a/deepseek-deepseek-v4-flash │
|
|
27
|
+
│────────────────────────>│ │
|
|
28
|
+
│ │ POST https://api.deepseek.com/v1/chat/completions
|
|
29
|
+
│ │ Authorization: Bearer <deepseek-key>
|
|
30
|
+
│ │────────────────────────>│
|
|
31
|
+
│ │ response │
|
|
32
|
+
│ │<────────────────────────│
|
|
33
|
+
│ response │ │
|
|
34
|
+
│<────────────────────────│ │
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Authentication
|
|
38
|
+
|
|
39
|
+
The Gateway authenticates requests against `data/provider-keys.json`. The
|
|
40
|
+
`Authorization` Bearer token must match the value of the 'rev4a' entry:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"rev4a": "<gateway-token>"
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
| Token match | Result |
|
|
49
|
+
|---|---|
|
|
50
|
+
| Matches `rev4a` key | Authenticated — returns all enabled models or proxies the chat request |
|
|
51
|
+
| No match | `GET /models` returns empty list, `POST /chat/completions` returns 401 |
|
|
52
|
+
| No token | Same as no match |
|
|
53
|
+
|
|
54
|
+
Only the 'rev4a' entry is checked. Other provider keys in the file (e.g.
|
|
55
|
+
`deepseek`, `openrouter`) are ignored for authentication — they are used as
|
|
56
|
+
upstream credentials by the proxy, not as client tokens.
|
|
57
|
+
|
|
58
|
+
### Model Discovery
|
|
59
|
+
|
|
60
|
+
#### `GET /api/provider/v1/models`
|
|
61
|
+
|
|
62
|
+
Returns all enabled models from `models.config.json` at the project root in
|
|
63
|
+
OpenAI-compatible format.
|
|
64
|
+
Models are filtered by the `models.config.json` catalogue (tracked in the repo),
|
|
65
|
+
not by auto-discovery.
|
|
66
|
+
|
|
67
|
+
**Response:**
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"object": "list",
|
|
71
|
+
"total": 9,
|
|
72
|
+
"data": [
|
|
73
|
+
{
|
|
74
|
+
"id": "deepseek/deepseek-v4-flash",
|
|
75
|
+
"object": "model",
|
|
76
|
+
"created": 1700000000,
|
|
77
|
+
"owned_by": "deepseek"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Behaviour by auth state:**
|
|
84
|
+
|
|
85
|
+
| Auth state | Response |
|
|
86
|
+
|---|---|
|
|
87
|
+
| Valid `rev4a` token | All enabled models |
|
|
88
|
+
| Invalid token | `total: 0`, empty `data` array |
|
|
89
|
+
| No token | `total: 0`, empty `data` array |
|
|
90
|
+
|
|
91
|
+
### Chat Completions
|
|
92
|
+
|
|
93
|
+
#### `POST /api/provider/v1/chat/completions` (optional)
|
|
94
|
+
|
|
95
|
+
Proxies a chat completion request to the correct upstream provider. The model
|
|
96
|
+
name is parsed to extract the provider and model ID.
|
|
97
|
+
|
|
98
|
+
**Model alias resolution:**
|
|
99
|
+
|
|
100
|
+
| Model alias | Upstream provider | Upstream model |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| `rev4a/deepseek-v4-flash` | `deepseek` | `deepseek-v4-flash` |
|
|
103
|
+
| `rev4a/deepseek-v4-pro` | `deepseek` | `deepseek-v4-pro` |
|
|
104
|
+
| `rev4a/kimi-k3` | `kimi` | `kimi-k3` |
|
|
105
|
+
| `rev4a/glm-5.2` | `glm` | `glm-5.2` |
|
|
106
|
+
| `rev4a/qwen3.7-plus` | `qwen` | `qwen3.7-plus` |
|
|
107
|
+
|
|
108
|
+
**Model parsing fallback:**
|
|
109
|
+
1. Check `request.provider` field
|
|
110
|
+
2. Check `MODEL_ALIASES` map (for `rev4a/` prefixed aliases)
|
|
111
|
+
3. Parse `provider/model` from the model string (e.g. `rev4a/kimi/kimi-k3` → provider `kimi`, model `kimi-k3`)
|
|
112
|
+
4. Fall back to `deepseek`
|
|
113
|
+
|
|
114
|
+
**Provider API paths:** Most providers use the standard `/v1/chat/completions` endpoint.
|
|
115
|
+
GLM uses `/api/paas/v4/chat/completions` and Qwen uses `/compatible-mode/v1/chat/completions`.
|
|
116
|
+
The upstream module (`app/api/provider/upstream.ts`) handles this via a per-provider `basePath` field.
|
|
117
|
+
|
|
118
|
+
**Request body** (OpenAI-compatible):
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"model": "rev4a/deepseek-v4-flash",
|
|
122
|
+
"messages": [{"role": "user", "content": "Hello"}]
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The proxy authenticates using the provider's real API key from
|
|
127
|
+
`data/provider-keys.json`.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Vault & Provider Key Endpoints
|
|
132
|
+
|
|
133
|
+
### `GET /api/vault/provider/key`
|
|
134
|
+
|
|
135
|
+
Returns the full API key for a provider. Used by the Providers page SHOW KEY flow.
|
|
136
|
+
|
|
137
|
+
**Query params:**
|
|
138
|
+
|
|
139
|
+
| Param | Required | Description |
|
|
140
|
+
|---|---|---|
|
|
141
|
+
| `provider` | Yes | Provider identifier (e.g. `openai`, `deepseek`) |
|
|
142
|
+
| `agent` | No | Docker container name for agent-targeted reads; omitting reads the VPS host |
|
|
143
|
+
|
|
144
|
+
**Auth:** browser cookie
|
|
145
|
+
|
|
146
|
+
**Response (200):**
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"provider": "deepseek",
|
|
150
|
+
"apiKey": "sk-...full-key...",
|
|
151
|
+
"masked": "sk-...be03",
|
|
152
|
+
"source": "local"
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Source values:**
|
|
157
|
+
- `local` — read from `data/provider-keys.json` on the VPS host
|
|
158
|
+
- `container` — read from inside the agent container config
|
|
159
|
+
|
|
160
|
+
**Error (404):** `{ "error": "not_found" }` — provider has no key
|
|
161
|
+
|
|
162
|
+
### `POST /api/vault/provider`
|
|
163
|
+
|
|
164
|
+
Add or update a stored provider credential in the vault.
|
|
165
|
+
|
|
166
|
+
**Body:** `{ "provider": "deepseek", "apiKey": "sk-...", "baseUrl": "https://api.deepseek.com" }`
|
|
167
|
+
|
|
168
|
+
**Response:** `{ "status": "ok", "provider": "deepseek", "masked": "sk-...be03", "updatedAt": 1749200000000 }`
|
|
169
|
+
|
|
170
|
+
### `DELETE /api/vault/provider`
|
|
171
|
+
|
|
172
|
+
Remove a stored provider credential from the vault.
|
|
173
|
+
|
|
174
|
+
**Body:** `{ "provider": "deepseek" }`
|
|
175
|
+
|
|
176
|
+
**Response:** `{ "status": "removed" }`
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Agent Container Gateway Config
|
|
181
|
+
|
|
182
|
+
Inside each agent container, the `openclaw.json` file has this structure for the Rev4a provider:
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"models": {
|
|
187
|
+
"providers": {
|
|
188
|
+
"rev4a": {
|
|
189
|
+
"baseUrl": "http://host.docker.internal:3740/api/provider/v1",
|
|
190
|
+
"api": "openai-completions",
|
|
191
|
+
"apiKey": "<gateway-token>",
|
|
192
|
+
"models": [
|
|
193
|
+
{ "id": "deepseek/deepseek-v4-flash", "name": "DeepSeek V4 Flash" },
|
|
194
|
+
{ "id": "deepseek/deepseek-v4-pro", "name": "DeepSeek V4 Pro" }
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"agents": {
|
|
200
|
+
"defaults": {
|
|
201
|
+
"model": {
|
|
202
|
+
"primary": "rev4a/deepseek/deepseek-v4-flash"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Key points:
|
|
210
|
+
|
|
211
|
+
- `models.providers.rev4a.models` uses model IDs **without** the `rev4a/` prefix
|
|
212
|
+
- `agents.defaults.model.primary` uses the model ID **with** the `rev4a/`
|
|
213
|
+
prefix (as it would appear at runtime). No fallbacks are set by default.
|
|
214
|
+
- The `apiKey` value must match the 'rev4a' entry in `data/provider-keys.json`
|
|
215
|
+
for the container to successfully authenticate against the Gateway
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Security Notes
|
|
220
|
+
|
|
221
|
+
- The `GET /api/vault/provider/key` endpoint is protected by the authentication
|
|
222
|
+
middleware (browser cookie or bearer token). Only authenticated users can reveal
|
|
223
|
+
keys.
|
|
224
|
+
- The UI **must never** log, screenshot, or otherwise persist the revealed key
|
|
225
|
+
outside the active screen view.
|
|
226
|
+
- All secrets in documentation, logs, or reports must be masked (e.g. `sk-...ast4`).
|
|
227
|
+
- The Gateway's `GET /api/provider/v1/models` endpoint returns an empty list when
|
|
228
|
+
no valid token is provided, preventing model information leakage.
|
|
229
|
+
- API keys live in `data/provider-keys.json` (gitignored), never in committed code.
|