omnigateway 0.1.4 → 0.1.6
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 +35 -1
- package/bin/omni.js +263 -105
- package/gateway.js +983 -423
- package/package.json +1 -1
- package/public/assets/{CopyValue-BhGx7Gy0.js → CopyValue-cAwgC1sU.js} +1 -1
- package/public/assets/{Modal-DOQGdhoM.js → Modal-Dqir9wBz.js} +1 -1
- package/public/assets/{Rack-DnbGnBvz.js → Rack-XtfiZ6GC.js} +1 -1
- package/public/assets/{Toggle-CP3RvAAB.js → Toggle-BhViDMm9.js} +1 -1
- package/public/assets/{_app-D83powx4.js → _app-B8lqq_ks.js} +1 -1
- package/public/assets/{_app.accounts-DR-2t9-7.js → _app.accounts-DSMHSYBF.js} +1 -1
- package/public/assets/{_app.index-DimCB0Bo.js → _app.index-DXH5sH41.js} +1 -1
- package/public/assets/{_app.keys-B7kl3CSe.js → _app.keys-DdEyVy_b.js} +1 -1
- package/public/assets/_app.logs-Camxditb.js +33 -0
- package/public/assets/_app.models-CuD-JtGS.js +144 -0
- package/public/assets/{_app.settings-DtDIhAAr.js → _app.settings-DA1aYcR4.js} +1 -1
- package/public/assets/{_app.usage-BChnSBbS.js → _app.usage-DAyYUfIi.js} +1 -1
- package/public/assets/catalog-C_OQ0icG.js +1 -0
- package/public/assets/{index-C53PiRfb.js → index-BtjyVE1i.js} +2 -2
- package/public/assets/{login-BuvJY1Qd.js → login-DXHM-Noj.js} +1 -1
- package/public/assets/{trash-2-Cq7ldH9D.js → trash-2-JF_uX2gE.js} +1 -1
- package/public/index.html +2 -2
- package/public/assets/_app.logs-BjtdzcDY.js +0 -18
- package/public/assets/_app.models-BEECjcLM.js +0 -144
- package/public/assets/catalog-DVRPlBJJ.js +0 -1
package/README.md
CHANGED
|
@@ -118,7 +118,7 @@ Everything above is also available in the browser at
|
|
|
118
118
|
| --- | --- | --- |
|
|
119
119
|
| `POST` | `/v1/messages` | Anthropic Messages API |
|
|
120
120
|
| `POST` | `/v1/chat/completions` | OpenAI Chat Completions API |
|
|
121
|
-
| `GET` | `/v1/models` |
|
|
121
|
+
| `GET` | `/v1/models` | Listing in both dialects, filtered by your key's allowlist |
|
|
122
122
|
| `GET` | `/health` | Unauthenticated liveness check |
|
|
123
123
|
|
|
124
124
|
Authenticate with either header — sending both is an error:
|
|
@@ -131,6 +131,27 @@ x-api-key: <gateway-key>
|
|
|
131
131
|
Ask for one of your virtual models by name. A bare provider model
|
|
132
132
|
(`claude-sonnet-5`, `gpt-5`) also works if an account can serve it.
|
|
133
133
|
|
|
134
|
+
`GET /v1/models` answers both client families from one listing: each entry
|
|
135
|
+
carries the OpenAI keys (`object`, `created`, `owned_by`) and the Anthropic ones
|
|
136
|
+
(`type`, `display_name`, `created_at`, `max_input_tokens`, `max_tokens`) at
|
|
137
|
+
once. `max_input_tokens` is the one worth knowing about — a client that is told
|
|
138
|
+
no context window assumes its own default, which is 200K whatever the model
|
|
139
|
+
really holds, so a 1M-context target would be used as if it were a fifth of its
|
|
140
|
+
size. The figure is the smallest window any of that model's targets can hold,
|
|
141
|
+
because failover can land on any of them.
|
|
142
|
+
|
|
143
|
+
A client reads these figures once, when it starts, and caches them — so
|
|
144
|
+
raising a limit here can take a client restart to show up.
|
|
145
|
+
|
|
146
|
+
The figures come from the published limits for the model each target names, and
|
|
147
|
+
from how the credential that would serve it signs in: an OpenAI account
|
|
148
|
+
connected by OAuth is served through the Codex backend, which takes a 272,000
|
|
149
|
+
token prompt where the API takes 922,000, so a gateway with both kinds of
|
|
150
|
+
OpenAI credential advertises the smaller. Leave the fields in the console (or
|
|
151
|
+
the CLI) empty to keep that worked out for you, and fill them in per target only
|
|
152
|
+
when your own account's limits differ. A model outside the built-in catalog with
|
|
153
|
+
nothing stated is left undescribed, and its clients keep their own defaults.
|
|
154
|
+
|
|
134
155
|
Most tools that accept a custom base URL work unchanged: set it to
|
|
135
156
|
`http://127.0.0.1:9000` and use a gateway key where the provider key goes.
|
|
136
157
|
|
|
@@ -190,6 +211,19 @@ Configuration is environment variables, read from the installation's `.env`:
|
|
|
190
211
|
| `OMNI_DB_PATH` | No | `./omnigateway.db` | SQLite database path |
|
|
191
212
|
| `OMNI_BASE_URL` | No | derived from host and port | Public origin for OAuth callbacks; set this behind a reverse proxy |
|
|
192
213
|
| `OMNI_STATIC_DIR` | No | the console shipped with the server | Serve a different console build |
|
|
214
|
+
| `OMNI_LOG_LEVEL` | No | `info` | Stdout threshold: `debug`, `info`, `warn`, or `error` |
|
|
215
|
+
|
|
216
|
+
Gateway events are written to stdout as one greppable line each. At `info`, every completed
|
|
217
|
+
request produces an access line alongside process lifecycle and error events. Use `debug` to see
|
|
218
|
+
routing decisions, failover attempts, OAuth refreshes, quota probes, and upstream HTTP timing:
|
|
219
|
+
|
|
220
|
+
```text
|
|
221
|
+
2026-08-09T04:12:03.114Z INFO request done requestId=req_9f2 surface=anthropic status=200 provider=anthropic model=claude-opus-5 attempts=1 inputTokens=1204 outputTokens=88 durationMs=2100
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Fields are a closed allowlist: logs never include request or response bodies, headers, OAuth
|
|
225
|
+
tokens, API keys, admin passwords, or encryption keys. `OMNI_LOG_LEVEL` is read once at boot;
|
|
226
|
+
an invalid value falls back to `info` and is reported in the boot log.
|
|
193
227
|
|
|
194
228
|
Routing behaviour — weights, retry limits, request deadline, log retention,
|
|
195
229
|
how often provider quota is polled — lives in the database, not the
|