feat(platform): per-user API gateway over the OmniRoute API plane - #111
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes part of #103. Adds the per-user API layer over the
bapXai/api(OmniRoute) plane.Read this first — branch lineage
This branch is based on
141b4476, notmain.141b4476is what is live on the VPS right now, and it is not an ancestor ofmain— they diverged atf7b33ca6:An earlier attempt based on
mainwould have silently reverted141b4476and dropped 5 live pages:docs/ecosystem/providers/{anthropic,google,openai,openrouter}— the whole Model providers categorydocs/guide/delegated-tasksCause:
modelProvidersand the "Model providers" group were removed fromecosystem-catalog.tsandcustomer-ecosystem.tson themainlineage. That is the UI customers use to connect the BYOK credentials this gateway depends on — shipping it would have added per-user API keys while deleting the way to attach a provider to them.Basing on the live release makes this deploy purely additive. Someone needs to decide separately whether
mainor141b4476is the intended lineage — this PR does not resolve that, it just avoids regressing production in the meantime.What this adds
apps/www/src/server/api-gateway.mjs— API key store and streaming proxyapps/www/server.mjs—api.bapx.inhost handling, session-gated key managementdocs/platform/api.md— supported contract and the BYOK boundary, wired into docs navblueprints/tooling--hostinger.md— Hostinger MCP connector (feat(connectors): add Hostinger MCP connector #105)internal-docs/— API integration assessment, agent-stack and agent-team researchSecurity properties
bapx_sk_…; only the SHA-256 hash is stored, so a leaked collection file cannot be replayed.timingSafeEqual./v1/*is exposed. The plane is single-tenant — exposing its dashboard or admin auth would hand one customer the whole appliance.Authorizationheader is never forwarded upstream; the plane is reached with its own credential.Validation
End-to-end against the running plane:
GET /v1/modelsPOST /v1/chat/completionslastUsedAtGET /dashboardwith valid keyBuild parity vs the live release: 145 pages → 146, nothing lost, one added. Admin bundle rebuilt (25 MB, 701 assets, all entry refs resolve).
Deploy (not applied — needs permission on the compose file)
/docker/traefik-vmm1/docker-compose.yml:141b4476→98f04e31(4 bind-mount occurrences)bapx-wwwenvironment:- BAPX_API_PLANE_ORIGIN=http://172.17.0.1:20130traefik.http.routers.bapx-www.rule:|| Host(`api.bapx.in`)Then
docker compose up -d. Rollback is pointing the mounts back to141b4476.Snapshot is already built at
releases/agents/98f04e31/. DNS forapi.bapx.inalready resolves to the host. The API plane runs as a separate compose project at/docker/bapx-api/— internal only, bound to loopback and the docker bridge, verified not reachable on the public IP.Never build the plane image on the VPS. It OOM-killed the host on 2026-08-13 (
global_oom, 4.68 GB RSS and climbing). Pull prebuilt images only. Seeinternal-docs/platform-api-integration.md.Summary by Sourcery
Add the customer-facing Platform control plane and secure per-business gateway over the internal OmniRoute API plane.
New Features:
Bug Fixes:
Enhancements:
Build:
Deployment:
Documentation:
Tests:
Chores: