@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.
Files changed (290) hide show
  1. package/README.md +150 -0
  2. package/agent-templates/README.md +37 -0
  3. package/agent-templates/argus/AGENTS.md +52 -0
  4. package/agent-templates/argus/IDENTITY.md +7 -0
  5. package/agent-templates/argus/MEMORY.md +9 -0
  6. package/agent-templates/argus/SOUL.md +24 -0
  7. package/agent-templates/argus/TOOLS.md +8 -0
  8. package/agent-templates/atlas/AGENTS.md +47 -0
  9. package/agent-templates/atlas/HEARTBEAT.md +10 -0
  10. package/agent-templates/atlas/IDENTITY.md +6 -0
  11. package/agent-templates/atlas/MEMORY.md +9 -0
  12. package/agent-templates/atlas/SOUL.md +21 -0
  13. package/agent-templates/atlas/TOOLS.md +4 -0
  14. package/agent-templates/base-image/.trigger +0 -0
  15. package/agent-templates/base-image/Dockerfile +90 -0
  16. package/agent-templates/base-image/entrypoint.sh +37 -0
  17. package/agent-templates/custom/AGENTS.md +29 -0
  18. package/agent-templates/custom/BOOTSTRAP.md +56 -0
  19. package/agent-templates/custom/MEMORY.md +8 -0
  20. package/agent-templates/prometheus/AGENTS.md +37 -0
  21. package/agent-templates/prometheus/IDENTITY.md +6 -0
  22. package/agent-templates/prometheus/MEMORY.md +9 -0
  23. package/agent-templates/prometheus/SOUL.md +21 -0
  24. package/agent-templates/prometheus/TOOLS.md +4 -0
  25. package/app/agents/ChannelManager.tsx +465 -0
  26. package/app/agents/ImageDownloadBanner.tsx +159 -0
  27. package/app/agents/PageClient.tsx +1285 -0
  28. package/app/agents/create/PageClient.tsx +437 -0
  29. package/app/agents/create/page.tsx +126 -0
  30. package/app/agents/loading.tsx +14 -0
  31. package/app/agents/page.tsx +5 -0
  32. package/app/api/agents/[id]/backup/route.ts +169 -0
  33. package/app/api/agents/[id]/channels/pairing/route.ts +69 -0
  34. package/app/api/agents/[id]/channels/route.ts +14 -0
  35. package/app/api/agents/[id]/channels/telegram/route.ts +50 -0
  36. package/app/api/agents/[id]/lifecycle/route.ts +94 -0
  37. package/app/api/agents/[id]/recreate/route.ts +199 -0
  38. package/app/api/agents/[id]/restart/route.ts +33 -0
  39. package/app/api/agents/[id]/restore/route.ts +81 -0
  40. package/app/api/agents/[id]/route.ts +280 -0
  41. package/app/api/agents/channels-summary/route.ts +39 -0
  42. package/app/api/agents/config-json/route.ts +58 -0
  43. package/app/api/agents/create/route.ts +488 -0
  44. package/app/api/agents/download-image/route.ts +32 -0
  45. package/app/api/agents/image-status/route.ts +126 -0
  46. package/app/api/agents/route.ts +213 -0
  47. package/app/api/agents/token/route.ts +94 -0
  48. package/app/api/agents-active/route.ts +190 -0
  49. package/app/api/agents-config/route.ts +629 -0
  50. package/app/api/alerts/smoke/route.ts +26 -0
  51. package/app/api/aliases/add/route.ts +28 -0
  52. package/app/api/aliases/remove/route.ts +27 -0
  53. package/app/api/assistant/route.ts +204 -0
  54. package/app/api/auth/check/route.ts +38 -0
  55. package/app/api/auth/login/route.ts +85 -0
  56. package/app/api/auth/logout/route.ts +7 -0
  57. package/app/api/auth/status/route.ts +33 -0
  58. package/app/api/config/env/route.ts +132 -0
  59. package/app/api/config/restart/route.ts +26 -0
  60. package/app/api/containers/route.ts +75 -0
  61. package/app/api/cost-override/route.ts +46 -0
  62. package/app/api/costs/route.ts +84 -0
  63. package/app/api/credentials/[id]/reveal/route.ts +21 -0
  64. package/app/api/credentials/[id]/route.ts +52 -0
  65. package/app/api/credentials/[id]/sync/route.ts +58 -0
  66. package/app/api/credentials/detect/route.ts +246 -0
  67. package/app/api/credentials/route.ts +33 -0
  68. package/app/api/crons/[id]/route.ts +69 -0
  69. package/app/api/crons/route.ts +12 -0
  70. package/app/api/crons/runs/route.ts +31 -0
  71. package/app/api/debug/route.ts +11 -0
  72. package/app/api/envcheck/route.ts +18 -0
  73. package/app/api/events/route.ts +24 -0
  74. package/app/api/gateway/agent/route.ts +154 -0
  75. package/app/api/gateway/provider/balance/route.ts +38 -0
  76. package/app/api/gateway/provider/keys.ts +38 -0
  77. package/app/api/gateway/provider/oauth/route.ts +304 -0
  78. package/app/api/gateway/provider/route.ts +209 -0
  79. package/app/api/gateway/route.ts +223 -0
  80. package/app/api/gateway/sync.ts +189 -0
  81. package/app/api/lineage/route.ts +54 -0
  82. package/app/api/memory-context/route.ts +15 -0
  83. package/app/api/metrics/route.ts +35 -0
  84. package/app/api/models/route.ts +77 -0
  85. package/app/api/plugins/route.js +37 -0
  86. package/app/api/provider/upstream.ts +142 -0
  87. package/app/api/provider/v1/chat/completions/route.ts +146 -0
  88. package/app/api/provider/v1/models/route.ts +167 -0
  89. package/app/api/provider-usage/route.ts +629 -0
  90. package/app/api/session/route.ts +39 -0
  91. package/app/api/sessions/[id]/route.ts +38 -0
  92. package/app/api/sessions/route.ts +23 -0
  93. package/app/api/setup/agent-image/route.ts +102 -0
  94. package/app/api/setup/password/route.ts +111 -0
  95. package/app/api/setup/restart/route.ts +76 -0
  96. package/app/api/skills/delete/route.js +105 -0
  97. package/app/api/skills/promote/route.js +129 -0
  98. package/app/api/skills/route.js +203 -0
  99. package/app/api/skills/save/route.js +142 -0
  100. package/app/api/stats/route.ts +34 -0
  101. package/app/api/stats-since/route.ts +20 -0
  102. package/app/api/stream/route.ts +70 -0
  103. package/app/api/system-health/route.ts +233 -0
  104. package/app/api/tool-calls/route.ts +24 -0
  105. package/app/api/tools-config/route.ts +163 -0
  106. package/app/api/update-check/route.ts +127 -0
  107. package/app/api/version/route.ts +25 -0
  108. package/app/api/wizard/complete/route.ts +32 -0
  109. package/app/api/wizard/reset/route.ts +28 -0
  110. package/app/api/wizard/status/route.ts +28 -0
  111. package/app/api/workspace/route.ts +392 -0
  112. package/app/api/workspace/stream/route.ts +136 -0
  113. package/app/components/AppShell.tsx +33 -0
  114. package/app/components/AuthGuard.tsx +91 -0
  115. package/app/components/CostBreakdown.tsx +37 -0
  116. package/app/components/DashboardHeader.tsx +73 -0
  117. package/app/components/DashboardLayout.tsx +76 -0
  118. package/app/components/DashboardToolbar.tsx +61 -0
  119. package/app/components/FloatingActions.tsx +33 -0
  120. package/app/components/Icons.tsx +78 -0
  121. package/app/components/LineageGraphPage.tsx +142 -0
  122. package/app/components/LiveFeed.tsx +48 -0
  123. package/app/components/MobileBottomNav.tsx +84 -0
  124. package/app/components/ModelPickerModal.tsx +94 -0
  125. package/app/components/PasswordInput.tsx +86 -0
  126. package/app/components/PulseChat.tsx +362 -0
  127. package/app/components/Rev4aLoader.tsx +48 -0
  128. package/app/components/SessionDrawer.tsx +263 -0
  129. package/app/components/SessionTopology.tsx +289 -0
  130. package/app/components/Sidebar.tsx +294 -0
  131. package/app/components/Skeleton.tsx +133 -0
  132. package/app/components/SystemCockpit.tsx +169 -0
  133. package/app/components/VersionBanner.tsx +105 -0
  134. package/app/components/WizardButton.tsx +30 -0
  135. package/app/components/ui/Badge.tsx +30 -0
  136. package/app/components/ui/Button.tsx +59 -0
  137. package/app/components/ui/ConfirmModal.tsx +46 -0
  138. package/app/components/ui/FilterBar.tsx +33 -0
  139. package/app/components/ui/Input.tsx +25 -0
  140. package/app/components/ui/ItemList.tsx +83 -0
  141. package/app/components/ui/LoadingSpinner.tsx +30 -0
  142. package/app/components/ui/Metric.tsx +22 -0
  143. package/app/components/ui/Modal.tsx +42 -0
  144. package/app/components/ui/Page.tsx +18 -0
  145. package/app/components/ui/Pill.tsx +6 -0
  146. package/app/components/ui/PropertyList.tsx +24 -0
  147. package/app/components/ui/Select.tsx +26 -0
  148. package/app/components/ui/StatusCard.tsx +32 -0
  149. package/app/components/ui/Surface.tsx +14 -0
  150. package/app/components/ui/Tabs.tsx +55 -0
  151. package/app/components/ui/TemplateOption.tsx +59 -0
  152. package/app/components/ui/Toast.tsx +44 -0
  153. package/app/components/ui/index.ts +19 -0
  154. package/app/components/ui/tokens.ts +18 -0
  155. package/app/config/PageClient.tsx +293 -0
  156. package/app/config/loading.tsx +10 -0
  157. package/app/config/page.tsx +7 -0
  158. package/app/containers/ContainersClient.tsx +129 -0
  159. package/app/containers/loading.tsx +21 -0
  160. package/app/containers/page.tsx +5 -0
  161. package/app/containers/terminal/[id]/TerminalClient.tsx +313 -0
  162. package/app/containers/terminal/[id]/page.tsx +6 -0
  163. package/app/credentials/PageClient.tsx +598 -0
  164. package/app/credentials/loading.tsx +10 -0
  165. package/app/credentials/page.tsx +7 -0
  166. package/app/crons/PageClient.tsx +538 -0
  167. package/app/crons/loading.tsx +10 -0
  168. package/app/crons/page.tsx +5 -0
  169. package/app/design-system.ts +57 -0
  170. package/app/gateway/PageClient.tsx +1048 -0
  171. package/app/gateway/loading.tsx +24 -0
  172. package/app/gateway/page.tsx +5 -0
  173. package/app/globals.css +1474 -0
  174. package/app/layout.tsx +45 -0
  175. package/app/lib/models-context.tsx +41 -0
  176. package/app/lineage/loading.tsx +10 -0
  177. package/app/lineage/page.tsx +13 -0
  178. package/app/loading.tsx +16 -0
  179. package/app/login/page.tsx +160 -0
  180. package/app/memory/MemoryContextPageClient.tsx +196 -0
  181. package/app/memory/loading.tsx +10 -0
  182. package/app/memory/page.tsx +8 -0
  183. package/app/page.tsx +31 -0
  184. package/app/plugins/PageClient.tsx +296 -0
  185. package/app/plugins/loading.tsx +10 -0
  186. package/app/plugins/page.tsx +5 -0
  187. package/app/setup/PageClient.tsx +227 -0
  188. package/app/setup/loading.tsx +21 -0
  189. package/app/setup/page.tsx +7 -0
  190. package/app/skills/PageClient.tsx +499 -0
  191. package/app/skills/loading.tsx +10 -0
  192. package/app/skills/page.tsx +5 -0
  193. package/app/tools/ToolsPageClient.tsx +308 -0
  194. package/app/tools/loading.tsx +10 -0
  195. package/app/tools/page.tsx +62 -0
  196. package/app/tools/tools-catalog.ts +141 -0
  197. package/app/wizard/PageClient.tsx +485 -0
  198. package/app/wizard/icons.tsx +89 -0
  199. package/app/wizard/loading.tsx +24 -0
  200. package/app/wizard/page.tsx +7 -0
  201. package/app/wizard/storage.ts +33 -0
  202. package/app/wizard/useWizard.ts +101 -0
  203. package/app/workspace/WorkspaceClient.tsx +633 -0
  204. package/app/workspace/loading.tsx +36 -0
  205. package/app/workspace/page.tsx +8 -0
  206. package/bin/docker-entrypoint.sh +21 -0
  207. package/bin/postinstall.js +20 -0
  208. package/bin/rev4a.js +696 -0
  209. package/daemon.js +783 -0
  210. package/docs/ARCHITECTURE.md +557 -0
  211. package/docs/CONTAINER-TERMINAL.md +280 -0
  212. package/docs/DESIGN-SYSTEM.md +99 -0
  213. package/docs/FRONTEND-ARCHITECTURE.md +119 -0
  214. package/docs/REV4A.md +504 -0
  215. package/docs/dev/API-REFERENCE.md +1835 -0
  216. package/docs/dev/DATABASE.md +224 -0
  217. package/docs/dev/GATEWAY.md +300 -0
  218. package/docs/dev/PROVIDERS.md +229 -0
  219. package/docs/dev/SESSION-MAINTENANCE-PLAN.md +607 -0
  220. package/docs/dev/WORKSPACE.md +199 -0
  221. package/docs/rag/DATA-FRESHNESS.md +109 -0
  222. package/docs/rag/GLOSSARY.md +125 -0
  223. package/docs/rag/REV4A-OVERVIEW.md +135 -0
  224. package/docs/rag/WHAT-I-CAN-ANSWER.md +124 -0
  225. package/lib/agent-setup.ts +130 -0
  226. package/lib/alerts.ts +115 -0
  227. package/lib/apiFetch.ts +7 -0
  228. package/lib/auth.ts +28 -0
  229. package/lib/billing.ts +100 -0
  230. package/lib/buildAgentImage.ts +346 -0
  231. package/lib/channelManager.ts +386 -0
  232. package/lib/container.ts +60 -0
  233. package/lib/credentials/db.ts +86 -0
  234. package/lib/credentials/delivery.ts +448 -0
  235. package/lib/credentials/detect.ts +149 -0
  236. package/lib/credentials/hash.ts +9 -0
  237. package/lib/credentials/providers.ts +110 -0
  238. package/lib/credentials/vault.ts +195 -0
  239. package/lib/db-bootstrap.d.ts +3 -0
  240. package/lib/db-bootstrap.mjs +144 -0
  241. package/lib/db.ts +25 -0
  242. package/lib/docker-utils.ts +60 -0
  243. package/lib/hooks/useDashboard.ts +264 -0
  244. package/lib/hooks/useRev4aTimezone.ts +28 -0
  245. package/lib/hooks/useScreenshot.ts +30 -0
  246. package/lib/memory-context.ts +385 -0
  247. package/lib/model-catalogue.ts +131 -0
  248. package/lib/model-pricing.ts +63 -0
  249. package/lib/openclaw-cron.ts +350 -0
  250. package/lib/patterns/ApiAdapter.ts +73 -0
  251. package/lib/patterns/ApiClient.ts +65 -0
  252. package/lib/patterns/EventBus.ts +113 -0
  253. package/lib/patterns/FilterStrategy.ts +79 -0
  254. package/lib/patterns/SessionFactory.ts +117 -0
  255. package/lib/patterns/sessionPresentation.ts +117 -0
  256. package/lib/provider-balance.ts +163 -0
  257. package/lib/requireAuth.tsx +38 -0
  258. package/lib/rev4a-auth.d.ts +3 -0
  259. package/lib/rev4a-auth.js +36 -0
  260. package/lib/rev4a-paths.ts +145 -0
  261. package/lib/timezone.ts +46 -0
  262. package/lib/types/index.ts +96 -0
  263. package/lib/utils/format.ts +82 -0
  264. package/lineage.js +56 -0
  265. package/model-pricing.json +482 -0
  266. package/models.config.json +844 -0
  267. package/next-env.d.ts +6 -0
  268. package/next.config.mjs +7 -0
  269. package/package.json +82 -0
  270. package/public/apple-touch-icon.png +0 -0
  271. package/public/favicon-64.png +0 -0
  272. package/public/favicon.svg +58 -0
  273. package/public/icon-192-maskable.png +0 -0
  274. package/public/icon-192.png +0 -0
  275. package/public/icon-512-maskable.png +0 -0
  276. package/public/icon-512.png +0 -0
  277. package/public/manifest.json +38 -0
  278. package/public/rev4a-logo.png +0 -0
  279. package/public/rev4a-logo.svg +58 -0
  280. package/rev4a-rules/AGENTS.md +37 -0
  281. package/scripts/add-auth.cjs +185 -0
  282. package/scripts/backup.sh +66 -0
  283. package/scripts/check-providers.mjs +143 -0
  284. package/scripts/docker/traefik/docker-compose.yml +32 -0
  285. package/scripts/docker/traefik/dynamic/.gitkeep +18 -0
  286. package/scripts/docker/traefik/traefik.yml +37 -0
  287. package/scripts/remove-auth-profile.js +56 -0
  288. package/scripts/restore.sh +82 -0
  289. package/terminal-ws-server.js +139 -0
  290. 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.