Skip to content

7.4 billion tokens per month. 34 free LLM providers. 635 free model endpoints. All behind one /v1 endpoint, plus any custom OpenAI-compatible endpoint. Smart routing, automatic failover, encrypted keys. Personal experimentation only.

TypeScript

Add end-to-end coding-agent compatibility suite (#629)

Tashfeen19168acaa12c
diff --git a/Dockerfile b/Dockerfile
index 32594ec6..67bb9a89 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -17,6 +17,7 @@ COPY package.json package-lock.json ./
COPY shared/package.json ./shared/
COPY server/package.json ./server/
COPY client/package.json ./client/
+COPY cli/package.json ./cli/
RUN npm ci
diff --git a/README.md b/README.md
index eccb99c1..1c3b1fde 100644
--- a/README.md
+++ b/README.md
@@ -98,6 +98,7 @@ Based on public documentation, July 2026 — corrections welcome.
- **Every OpenAI surface** — `/v1/chat/completions`, `/v1/responses` (what Codex CLI needs), `/v1/completions` (editor ghost-text autocomplete), `/v1/images/generations`, `/v1/audio/speech`, `/v1/embeddings`, and `/v1/models` — streaming and non-streaming, from the official SDKs or any OpenAI-compatible client. [API reference →](docs/api.md)
- **Anthropic Messages API** — `/v1/messages` speaks Anthropic's wire format over the same router, so **Claude Code** and the official Anthropic SDKs run against your free pool. [Details →](docs/api.md#anthropic--claude-clients)
+- **Native Gemini + Ollama surfaces** — Gemini CLI can use `/v1beta` (`generateContent`, streaming, token counting, models), while opt-in Ollama emulation serves NDJSON chat/generate, tags, metadata, and embeddings for Zed, JetBrains, and other local-model clients.
- **Fusion (multi-model synthesis)** — request the virtual `fusion` model and the router fans your prompt out to a panel of diverse free models in parallel, then a judge model synthesizes one answer from the drafts. [Details →](docs/api.md#fusion-multi-model-synthesis)
- **Image generation & text-to-speech** — `/v1/images/generations` and `/v1/audio/speech` route across the providers that serve media models, including custom OpenAI-compatible media endpoints.
- **Tool calling & structured outputs** — OpenAI-style `tools` round-trip across providers (plain-text tool calls are rescued into real `tool_calls`), plus `response_format`, `seed`, `logprobs`, penalties, and the rest of the sampling params passed through per provider.
@@ -143,6 +144,27 @@ A native menu-bar app lives in [`desktop/`](./desktop): the entire router + dash
Anything that can target an OpenAI-compatible base URL works: set it to `http://localhost:3001/v1` with the unified key from the dashboard. **Claude Code**, **Codex CLI**, **Cline / Roo Code**, **Continue** (including inline autocomplete), **Aider**, **opencode**, and **Cursor** each have a short recipe in **[docs/clients.md](docs/clients.md)** — and the router doubles as an MCP server your agents can introspect mid-session.
+The fastest setup is generated from the models available on your live server:
+
+```bash
+npx freellmapi setup-claude --url http://localhost:3001
+```
+
+Every generator supports `--dry-run`, creates a timestamped backup before changing an existing file, and merges into the user's configuration. Launchers keep credentials out of config files entirely: `npx freellmapi launch` for Claude Code and `npx freellmapi launch-codex` for Codex.
+
+| Agent | Automated setup | Base URL |
+| --- | --- | --- |
+| Claude Code | `setup-claude` | root |
+| Codex CLI | `setup-codex` | `/v1` |
+| Cline | `setup-cline` | `/v1` |
+| Continue | `setup-continue` | `/v1` |
+| Aider | `setup-aider` | `/v1` |
+| OpenCode | `setup-opencode` | `/v1` |
+| Goose | `setup-goose` | `/v1` |
+| Qwen Code | `setup-qwen` | `/v1` (or native `/v1beta`) |
+| Roo / Kilo / Crush | `setup-roo` / `setup-kilo` / `setup-crush` | `/v1` |
+| Cursor | `setup-cursor` guide | public `/v1` URL |
+
FreeLLMAPI is local-first and single-user by design. Your provider keys stay in your SQLite database, encrypted at rest, and requests go from your machine to the upstream providers you enabled.
## Languages
diff --git a/cli/package.json b/cli/package.json
new file mode 100644
index 00000000..86b9d8d9
--- /dev/null
+++ b/cli/package.json
@@ -0,0 +1,46 @@
+{
+ "name": "freellmapi",
+ "version": "0.3.0",
+ "description": "Set up coding agents to use a FreeLLMAPI gateway",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/tashfeenahmed/freellmapi.git",
+ "directory": "cli"
+ },
+ "type": "module",
+ "bin": {
+ "freellmapi": "./dist/index.js"
+ },
+ "exports": {
+ ".": "./dist/index.js",
+ "./tools": "./dist/tools.js"
+ },
+ "files": [
+ "dist/index.js",
+ "dist/index.d.ts",
+ "dist/config-files.js",
+ "dist/config-files.d.ts",
+ "dist/tools.js",
+ "dist/tools.d.ts",
+ "dist/types.js",
+ "dist/types.d.ts",
+ "tools.json"
+ ],
+ "scripts": {
+ "build": "tsc",
+ "test": "vitest run",
+ "prepublishOnly": "npm run build && npm test"
+ },
+ "engines": {
+ "node": ">=20.18.0 <25.0.0"
+ },
+ "dependencies": {
+ "jsonc-parser": "^3.3.1"
+ },
+ "devDependencies": {
+ "@types/node": "^24.12.2",
+ "typescript": "~6.0.2",
+ "vitest": "^3.1.3"
+ }
+}
diff --git a/cli/src/__snapshots__/tools.test.ts.snap b/cli/src/__snapshots__/tools.test.ts.snap
new file mode 100644
index 00000000..3093adfe
--- /dev/null
+++ b/cli/src/__snapshots__/tools.test.ts.snap
@@ -0,0 +1,468 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`tool generators > setup-aider has stable golden output 1`] = `
+{
+ "files": [
+ {
+ "content": "# freellmapi:start
+openai-api-base: "http://localhost:3000/v1"
+openai-api-key: "freellmapi-test-key"
+model: "openai/fast-coder"
+# freellmapi:end
+",
+ "format": "yaml",
+ "path": "/home/tester/.aider.conf.yml",
+ "sensitive": true,
+ },
+ ],
+ "notes": [
+ "Environment-only alternative: OPENAI_API_BASE=http://localhost:3000/v1 OPENAI_API_KEY=… aider --model openai/fast-coder",
+ ],
+}
+`;
+
+exports[`tool generators > setup-claude has stable golden output 1`] = `
+{
+ "files": [
+ {
+ "format": "json",
+ "path": "/home/tester/.claude/settings.json",
+ "sensitive": true,
+ "value": {
+ "env": {
+ "ANTHROPIC_AUTH_TOKEN": "freellmapi-test-key",
+ "ANTHROPIC_BASE_URL": "http://localhost:3000",
+ "ANTHROPIC_DEFAULT_HAIKU_MODEL": "fast-coder",
+ "ANTHROPIC_DEFAULT_OPUS_MODEL": "fast-coder",
+ "ANTHROPIC_DEFAULT_SONNET_MODEL": "fast-coder",
+ "ANTHROPIC_MODEL": "fast-coder",
+ "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "131072",
+ "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1",
+ },
+ },
+ },
+ ],
+ "notes": [
+ "Claude Code will read this configuration automatically.",
+ "For zero-persistence credentials, prefer: freellmapi launch",
+ ],
+}
+`;
+
+exports[`tool generators > setup-cline has stable golden output 1`] = `
+{
+ "files": [
+ {
+ "format": "json",
+ "path": "/home/tester/.cline/data/settings/providers.json",
+ "sensitive": true,
+ "value": {
+ "lastUsedProvider": "openai-compatible",
+ "providers": {
+ "openai-compatible": {
+ "settings": {
+ "apiKey": "freellmapi-test-key",
+ "baseUrl": "http://localhost:3000/v1",
+ "capabilities": [
+ "streaming",
+ "tools",
+ ],
+ "client": "openai-compatible",
+ "contextWindow": 131072,
+ "model": "fast-coder",
+ "protocol": "openai-chat",
+ "provider": "openai-compatible",
+ },
+ "tokenSource": "manual",
+ "updatedAt": "2026-07-27T00:00:00.000Z",
+ },
+ },
+ "version": 1,
+ },
+ },
+ ],
+ "notes": [
+ "Cline will use the generated OpenAI Compatible provider immediately.",
+ ],
+}
+`;
+
+exports[`tool generators > setup-codex has stable golden output 1`] = `
+{
+ "files": [
+ {
+ "content": "# freellmapi:start
+model = "fast-coder"
+model_provider = "freellmapi"
+model_context_window = 131072
+model_auto_compact_token_limit = 117964
+tool_output_token_limit = 20000
+
+[model_providers.freellmapi]
+name = "FreeLLMAPI"
+base_url = "http://localhost:3000/v1"
+wire_api = "responses"
+env_key = "FREELLMAPI_API_KEY"
+requires_openai_auth = false
+# freellmapi:end
+",
+ "format": "toml",
+ "path": "/home/tester/.codex/config.toml",
+ },
+ ],
+ "notes": [
+ "Export FREELLMAPI_API_KEY before running codex; the key is not written to config.toml.",
+ "Selected fast-coder with a 131072 token context window.",
+ ],
+}
+`;
+
+exports[`tool generators > setup-codex with a named profile has stable golden output 1`] = `
+{
+ "files": [
+ {
+ "content": "# freellmapi:start
+[model_providers.freellmapi]
+name = "FreeLLMAPI"
+base_url = "http://localhost:3000/v1"
+wire_api = "responses"
+env_key = "FREELLMAPI_API_KEY"
+requires_openai_auth = false
+
+[profiles.work]
+model = "fast-coder"
+model_provider = "freellmapi"
+# freellmapi:end
+",
+ "format": "toml",
+ "path": "/home/tester/.codex/config.toml",
+ },
+ ],
+ "notes": [
+ "Export FREELLMAPI_API_KEY before running codex; the key is not written to config.toml.",
+ "Activate this profile with: codex --profile work",
+ "Selected fast-coder with a 131072 token context window.",
+ ],
+}
+`;
+
+exports[`tool generators > setup-continue has stable golden output 1`] = `
+{
+ "files": [
+ {
+ "content": "# freellmapi:start
+name: FreeLLMAPI
+version: 1.0.0
+schema: v1
+models:
+ - name: FreeLLMAPI
+ provider: openai
+ model: "fast-coder"
+ apiBase: "http://localhost:3000/v1"
+ apiKey: \${{ secrets.FREELLMAPI_API_KEY }}
+ capabilities:
+ - tool_use
+ defaultCompletionOptions:
+ contextLength: 131072
+# freellmapi:end
+",
+ "format": "yaml",
+ "path": "/home/tester/.continue/config.yaml",
+ },
+ ],
+ "notes": [
+ "Add FREELLMAPI_API_KEY to Continue secrets; no raw key was written.",
+ ],
+}
+`;
+
+exports[`tool generators > setup-crush has stable golden output 1`] = `
+{
+ "files": [
+ {
+ "format": "json",
+ "path": "/home/tester/.config/crush/crush.json",
+ "value": {
+ "$schema": "https://charm.land/crush.json",
+ "providers": {
+ "freellmapi": {
+ "api_key": "$FREELLMAPI_API_KEY",
+ "base_url": "http://localhost:3000/v1",
+ "models": [
+ {
+ "can_reason": false,
+ "context_window": 131072,
+ "cost_per_1m_in": 0,
+ "cost_per_1m_in_cached": 0,
+ "cost_per_1m_out": 0,
+ "cost_per_1m_out_cached": 0,
+ "default_max_tokens": 8192,
+ "id": "fast-coder",
+ "name": "Fast Coder",
+ "supports_attachments": false,
+ },
+ {
+ "can_reason": false,
+ "context_window": 262144,
+ "cost_per_1m_in": 0,
+ "cost_per_1m_in_cached": 0,
+ "cost_per_1m_out": 0,
+ "cost_per_1m_out_cached": 0,
+ "default_max_tokens": 8192,
+ "id": "reasoning-model",
+ "name": "Reasoning Model",
+ "supports_attachments": false,
+ },
+ ],
+ "name": "FreeLLMAPI",
+ "type": "openai-compat",
+ },
+ },
+ },
+ },
+ ],
+ "notes": [
+ "Export FREELLMAPI_API_KEY before starting Crush.",
+ ],
+}
+`;
+
+exports[`tool generators > setup-cursor has stable golden output 1`] = `
+{
+ "files": [],
+ "notes": [
+ "Cursor sends model traffic through its cloud service, so localhost is not reachable from Cursor.",
+ "Expose the gateway through a trusted HTTPS tunnel, then open Cursor Settings → Models, enable Override OpenAI Base URL, and enter <public-url>/v1.",
+ "Cursor only documents custom keys for standard chat models; custom base-URL overrides may not support Responses-based or built-in models.",
+ "The override affects Cursor globally while enabled, so disable it before switching back to built-in providers.",
+ "Use a separately revocable URL token if the client cannot set an Authorization header.",
+ ],
+}
+`;
+
+exports[`tool generators > setup-generic has stable golden output 1`] = `
+{
+ "files": [],
+ "notes": [
+ "OPENAI_BASE_URL=http://localhost:3000/v1",
+ "OPENAI_API_KEY=freellmapi-test-key",
+ "OPENAI_MODEL=fast-coder",
+ "curl http://localhost:3000/v1/chat/completions -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d '{"model":"fast-coder","messages":[{"role":"user","content":"Hello"}]}'",
+ ],
+}
+`;
+
+exports[`tool generators > setup-goose has stable golden output 1`] = `
+{
+ "files": [
+ {
+ "format": "json",
+ "path": "/home/tester/.config/goose/custom_providers/freellmapi.json",
+ "value": {
+ "api_key_env": "FREELLMAPI_API_KEY",
+ "base_url": "http://localhost:3000/v1",
+ "description": "FreeLLMAPI OpenAI-compatible gateway",
+ "display_name": "FreeLLMAPI",
+ "dynamic_models": false,
+ "engine": "openai",
+ "models": [
+ {
+ "context_limit": 131072,
+ "name": "fast-coder",
+ },
+ {
+ "context_limit": 262144,
+ "name": "reasoning-model",
+ },
+ ],
+ "name": "freellmapi",
+ "preserves_thinking": true,
+ "requires_auth": true,
+ "supports_streaming": true,
+ },
+ },
+ {
+ "content": "# freellmapi:start
+GOOSE_PROVIDER: freellmapi
+GOOSE_MODEL: "fast-coder"
+# freellmapi:end
+",
+ "format": "yaml",
+ "path": "/home/tester/.config/goose/config.yaml",
+ },
+ ],
+ "notes": [
+ "Export FREELLMAPI_API_KEY before starting Goose.",
+ ],
+}
+`;
+
+exports[`tool generators > setup-kilo has stable golden output 1`] = `
+{
+ "files": [
+ {
+ "format": "json",
+ "path": "/home/tester/.config/kilo/kilo.jsonc",
+ "value": {
+ "$schema": "https://app.kilo.ai/config.json",
+ "model": "openai-compatible/fast-coder",
+ "provider": {
+ "openai-compatible": {
+ "models": {
+ "fast-coder": {
+ "limit": {
+ "context": 131072,
+ "output": 8192,
+ },
+ "name": "Fast Coder",
+ "tool_call": true,
+ },
+ "reasoning-model": {
+ "limit": {
+ "context": 262144,
+ "output": 8192,
+ },
+ "name": "Reasoning Model",
+ "tool_call": true,
+ },
+ },
+ "options": {
+ "apiKey": "{env:FREELLMAPI_API_KEY}",
+ "baseURL": "http://localhost:3000/v1",
+ },
+ },
+ },
+ },
+ },
+ ],
+ "notes": [
+ "Export FREELLMAPI_API_KEY before starting Kilo; global config is trusted for {env:…} expansion.",
+ ],
+}
+`;
+
+exports[`tool generators > setup-opencode has stable golden output 1`] = `
+{
+ "files": [
+ {
+ "format": "json",
+ "path": "/home/tester/.config/opencode/opencode.json",
+ "value": {
+ "$schema": "https://opencode.ai/config.json",
+ "provider": {
+ "freellmapi": {
+ "models": {
+ "fast-coder": {
+ "limit": {
+ "context": 131072,
+ },
+ "name": "Fast Coder",
+ },
+ "reasoning-model": {
+ "limit": {
+ "context": 262144,
+ },
+ "name": "Reasoning Model",
+ },
+ },
+ "name": "FreeLLMAPI",
+ "npm": "@ai-sdk/openai-compatible",
+ "options": {
+ "apiKey": "{env:FREELLMAPI_API_KEY}",
+ "baseURL": "http://localhost:3000/v1",
+ },
+ },
+ },
+ },
+ },
+ ],
+ "notes": [
+ "Export FREELLMAPI_API_KEY before starting OpenCode.",
+ ],
+}
+`;
+
+exports[`tool generators > setup-qwen has stable golden output 1`] = `
+{
+ "files": [
+ {
+ "format": "json",
+ "path": "/home/tester/.qwen/settings.json",
+ "value": {
+ "model": {
+ "name": "fast-coder",
+ },
+ "modelProviders": {
+ "openai": {
+ "models": [
+ {
+ "baseUrl": "http://localhost:3000/v1",
+ "envKey": "FREELLMAPI_API_KEY",
+ "generationConfig": {
+ "contextWindowSize": 131072,
+ },
+ "id": "fast-coder",
+ "name": "Fast Coder",
+ },
+ {
+ "baseUrl": "http://localhost:3000/v1",
+ "envKey": "FREELLMAPI_API_KEY",
+ "generationConfig": {
+ "contextWindowSize": 262144,
+ },
+ "id": "reasoning-model",
+ "name": "Reasoning Model",
+ },
+ ],
+ "protocol": "openai",
+ },
+ },
+ "security": {
+ "auth": {
+ "selectedType": "openai",
+ },
+ },
+ },
+ },
+ {
+ "content": "FREELLMAPI_API_KEY=freellmapi-test-key
+",
+ "format": "env",
+ "path": "/home/tester/.qwen/.env",
+ "sensitive": true,
+ },
+ ],
+ "notes": [
+ "Native Gemini mode is also available at http://localhost:3000/v1beta with GEMINI_API_KEY.",
+ ],
+}
+`;
+
+exports[`tool generators > setup-roo has stable golden output 1`] = `
+{
+ "files": [
+ {
+ "format": "json",
+ "path": "/home/tester/.roo/freellmapi.json",
+ "sensitive": true,
+ "value": {
+ "globalSettings": {},
+ "providerProfiles": {
+ "apiConfigs": {
+ "freellmapi": {
+ "apiProvider": "openai",
+ "openAiApiKey": "freellmapi-test-key",
+ "openAiBaseUrl": "http://localhost:3000/v1",
+ "openAiModelId": "fast-coder",
+ },
+ },
+ "currentApiConfigName": "freellmapi",
+ },
+ },
+ },
+ ],
+ "notes": [
+ "Set Roo Code's autoImportSettingsPath to /home/tester/.roo/freellmapi.json.",
+ ],
+}
+`;
diff --git a/cli/src/config-files.test.ts b/cli/src/config-files.test.ts
new file mode 100644
index 00000000..8a63642c
--- /dev/null
+++ b/cli/src/config-files.test.ts
@@ -0,0 +1,349 @@
+import fs from 'node:fs';
+import os from 'node:os';
+import path from 'node:path';
+import { parse } from 'jsonc-parser';
+import { afterEach, describe, expect, it } from 'vitest';
+import { applyGeneratedFile, applyGeneratedFiles, renderFile } from './config-files.js';
+
+const temporary: string[] = [];
+
+afterEach(() => {
+ for (const directory of temporary.splice(0)) {
+ fs.rmSync(directory, { recursive: true, force: true });
+ }
+});
+
+describe('safe config writes', () => {
+ it('renders a fresh Continue config idempotently', () => {
+ const generated = [
+ '# freellmapi:start',
+ 'name: FreeLLMAPI',
+ 'version: 1.0.0',
+ 'schema: v1',
+ 'models:',
+ ' - name: FreeLLMAPI',
+ ' provider: openai',
+ ' model: coder',
+ '# freellmapi:end',
+ '',
+ ].join('\n');
+ const first = renderFile({
+ path: '/unused',
+ format: 'yaml',
+ content: generated,
+ });
+ const second = renderFile({
+ path: '/unused',
+ format: 'yaml',
+ content: generated,
+ }, first);
+ expect(second).toBe(first);
+ expect(first).not.toContain('freellmapi:start');
+ expect(first.match(/^models:$/gm)).toHaveLength(1);
+ });
+
+ it('deep-merges JSONC and retains inline and leading comments', () => {
+ const existing = [
+ '// user configuration',
+ '{',
+ ' // keep the chosen theme',
+ ' "theme": "dark",',
+ ' "provider": {',
+ ' /* keep the unrelated provider */',
+ ' "other": true,',
+ ' },',
+ '}',
+ '',
+ ].join('\n');
+ const rendered = renderFile({
+ path: '/unused',
+ format: 'json',
+ value: { provider: { freellmapi: true } },
+ }, existing);
+ expect(rendered).toContain('// user configuration');
+ expect(rendered).toContain('// keep the chosen theme');
+ expect(rendered).toContain('/* keep the unrelated provider */');
+ expect(parse(rendered)).toEqual({
+ theme: 'dark',
+ provider: { other: true, freellmapi: true },
+ });
+ });
+
+ it('merges Continue into an existing config without replacing other models', () => {
+ const existing = [
+ '# personal config',
+ 'name: Personal',
+ 'version: 2.0.0',
+ 'schema: v1',
+ 'models:',
+ ' - name: Existing',
+ ' provider: ollama',
+ ' model: qwen',
+ 'rules:',
+ ' - Keep this rule',
+ '',
+ ].join('\n');
+ const generated = [
+ '# freellmapi:start',
+ 'name: FreeLLMAPI',
+ 'version: 1.0.0',
+ 'schema: v1',
+ 'models:',
+ ' - name: FreeLLMAPI',
+ ' provider: openai',
+ ' model: coder',
+ '# freellmapi:end',
+ '',
+ ].join('\n');
+ const first = renderFile({
+ path: '/unused',
+ format: 'yaml',
+ content: generated,
+ }, existing);
+ const second = renderFile({
+ path: '/unused',
+ format: 'yaml',
+ content: generated,
+ }, first);
+ expect(second).toBe(first);
+ expect(first).toContain('# personal config');
+ expect(first).toContain('name: Personal');
+ expect(first).toContain(' - name: Existing');
+ expect(first).toContain(' - name: FreeLLMAPI');
+ expect(first).toContain('rules:\n - Keep this rule');
+ expect(first.match(/^models:$/gm)).toHaveLength(1);
+ });
+
+ it('upgrades a previously marked Continue block without leaving duplicate keys', () => {
+ const existing = [
+ 'name: Personal',
+ 'version: 2.0.0',
+ 'schema: v1',
+ 'models:',
+ ' - name: Existing',
+ ' provider: ollama',
+ ' model: qwen',
+ '# freellmapi:start',
+ 'models:',
+ ' - name: FreeLLMAPI',
+ ' provider: openai',
+ ' model: old',
+ '# freellmapi:end',
+ '',
+ ].join('\n');
+ const generated = [
+ '# freellmapi:start',
+ 'name: FreeLLMAPI',
+ 'version: 1.0.0',
+ 'schema: v1',
+ 'models:',
+ ' - name: FreeLLMAPI',
+ ' provider: openai',
+ ' model: current',
+ '# freellmapi:end',
+ '',
+ ].join('\n');
+ const rendered = renderFile({
+ path: '/unused',
+ format: 'yaml',
+ content: generated,
+ }, existing);
+ expect(rendered.match(/^name:/gm)).toHaveLength(1);
+ expect(rendered.match(/^version:/gm)).toHaveLength(1);
+ expect(rendered.match(/^schema:/gm)).toHaveLength(1);
+ expect(rendered.match(/^models:/gm)).toHaveLength(1);
+ expect(rendered).toContain(' - name: Existing');
+ expect(rendered).toContain(' model: current');
+ expect(rendered).not.toContain(' model: old');
+ });
+
+ it('replaces generated YAML scalar keys without creating duplicates', () => {
+ const existing = '# user config\nGOOSE_PROVIDER: old\nGOOSE_MODEL: old\nkeep: true\n';
+ const generated = [
+ '# freellmapi:start',
+ 'GOOSE_PROVIDER: freellmapi',
+ 'GOOSE_MODEL: coder',
+ '# freellmapi:end',
+ '',
+ ].join('\n');
+ const first = renderFile({
+ path: '/unused',
+ format: 'yaml',
+ content: generated,
+ }, existing);
+ const second = renderFile({
+ path: '/unused',
+ format: 'yaml',
+ content: generated,
+ }, first);
+ expect(second).toBe(first);
+ expect(first).toContain('# user config');
+ expect(first).toContain('keep: true');
+ expect(first.match(/^GOOSE_PROVIDER:/gm)).toHaveLength(1);
+ expect(first.match(/^GOOSE_MODEL:/gm)).toHaveLength(1);
+ });
+
+ it('replaces conflicting Codex TOML settings and retains unrelated tables', () => {
+ const existing = [
+ '# personal config',
+ 'model = "old"',
+ 'model_provider = "old"',
+ '',
+ '[model_providers.freellmapi]',
+ 'name = "Old"',
+ 'base_url = "https://old.invalid/v1"',
+ '',
+ '[mcp_servers.personal]',
+ 'command = "keep-me"',
+ '',
+ ].join('\n');
+ const generated = [
+ '# freellmapi:start',
+ 'model = "coder"',
+ 'model_provider = "freellmapi"',
+ '',
+ '[model_providers.freellmapi]',
+ 'name = "FreeLLMAPI"',
+ 'base_url = "http://localhost:3000/v1"',
+ '# freellmapi:end',
+ '',
+ ].join('\n');
+ const first = renderFile({
+ path: '/unused',
+ format: 'toml',
+ content: generated,
+ }, existing);
+ const second = renderFile({
+ path: '/unused',
+ format: 'toml',
+ content: generated,
+ }, first);
+ expect(second).toBe(first);
+ expect(first).toContain('# personal config');
+ expect(first).toContain('[mcp_servers.personal]\ncommand = "keep-me"');
+ expect(first.match(/^model =/gm)).toHaveLength(1);
+ expect(first.match(/^\[model_providers\.freellmapi\]$/gm)).toHaveLength(1);
+ });
+
+ it('keeps generated root TOML keys in the root region when the file ends in a table', () => {
+ const existing = [
+ '# personal config',
+ 'sandbox_mode = "workspace-write"',
+ '',
+ '[mcp_servers.personal]',
+ 'command = "keep-me"',
+ 'args = ["--serve"]',
+ '',
+ ].join('\n');
+ const generated = [
+ '# freellmapi:start',
+ 'model = "coder"',
+ 'model_provider = "freellmapi"',
+ '',
+ '[model_providers.freellmapi]',
+ 'name = "FreeLLMAPI"',
+ 'base_url = "http://localhost:3000/v1"',
+ '# freellmapi:end',
+ '',
+ ].join('\n');
+ const first = renderFile({
+ path: '/unused',
+ format: 'toml',
+ content: generated,
+ }, existing);
+ const second = renderFile({
+ path: '/unused',
+ format: 'toml',
+ content: generated,
+ }, first);
+ expect(second).toBe(first);
+
+ // Root-level keys must appear BEFORE the first table header, otherwise
+ // TOML assigns them to that table.
+ const lines = first.split('\n');
+ const firstHeader = lines.findIndex(line => /^\[[^\]]+\]$/.test(line));
+ const modelLine = lines.findIndex(line => line === 'model = "coder"');
+ const providerLine = lines.findIndex(line => line === 'model_provider = "freellmapi"');
+ expect(firstHeader).toBeGreaterThan(-1);
+ expect(modelLine).toBeGreaterThan(-1);
+ expect(modelLine).toBeLessThan(firstHeader);
+ expect(providerLine).toBeGreaterThan(-1);
+ expect(providerLine).toBeLessThan(firstHeader);
+ expect(first).toContain('sandbox_mode = "workspace-write"');
+ expect(first).toContain('[mcp_servers.personal]\ncommand = "keep-me"\nargs = ["--serve"]');
+ expect(first).toContain('[model_providers.freellmapi]');
+ });
+
+ it('only strips root TOML keys that the generated root region sets', () => {
+ const existing = [
+ 'name = "my personal codex"',
+ 'model = "old"',
+ '',
+ '[mcp_servers.personal]',
+ 'command = "keep-me"',
+ '',
+ ].join('\n');
+ const generated = [
+ '# freellmapi:start',
+ 'model = "coder"',
+ '',
+ '[model_providers.freellmapi]',
+ 'name = "FreeLLMAPI"',
+ '# freellmapi:end',
+ '',
+ ].join('\n');
+ const first = renderFile({
+ path: '/unused',
+ format: 'toml',
+ content: generated,
+ }, existing);
+ // The generated TABLE sets `name`, but the user's ROOT-level `name` is a
+ // different key and must survive.
+ expect(first).toContain('name = "my personal codex"');
+ expect(first.match(/^model =/gm)).toHaveLength(1);
+ expect(first).toContain('model = "coder"');
+ });
+
+ it('does not write any file when a later file in the batch fails to merge', () => {
+ const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'freellmapi-cli-'));
+ temporary.push(directory);
+ const good = path.join(directory, 'good.json');
+ const bad = path.join(directory, 'bad.json');
+ fs.writeFileSync(bad, '{ this is not json');
+ expect(() => applyGeneratedFiles([
+ { path: good, format: 'json', value: { enabled: true } },
+ { path: bad, format: 'json', value: { enabled: true } },
+ ], false)).toThrow('cannot be parsed safely');
+ expect(fs.existsSync(good)).toBe(false);
+ expect(fs.readFileSync(bad, 'utf8')).toBe('{ this is not json');
+ });
+
+ it('creates a timestamped backup before replacing a real file', () => {
+ const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'freellmapi-cli-'));
+ temporary.push(directory);
+ const target = path.join(directory, 'config.toml');
+ fs.writeFileSync(target, 'user_setting = true\n');
+ const result = applyGeneratedFile({
+ path: target,
+ format: 'toml',
+ content: '# freellmapi:start\nmodel = "auto"\n# freellmapi:end\n',
+ }, false);
+ expect(result.backupPath).toBeTruthy();
+ expect(fs.readFileSync(result.backupPath!, 'utf8')).toBe('user_setting = true\n');
+ expect(fs.readFileSync(target, 'utf8')).toContain('user_setting = true');
+ expect(fs.readFileSync(target, 'utf8')).toContain('model = "auto"');
+ });
+
+ it('does not write in dry-run mode', () => {
+ const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'freellmapi-cli-'));
+ temporary.push(directory);
+ const target = path.join(directory, 'new.json');
+ const result = applyGeneratedFile({
+ path: target,
+ format: 'json',
+ value: { enabled: true },
+ }, true);
+ expect(result.changed).toBe(true);
+ expect(fs.existsSync(target)).toBe(false);
+ });
+});
diff --git a/cli/src/config-files.ts b/cli/src/config-files.ts
new file mode 100644
index 00000000..31d477a3
--- /dev/null
+++ b/cli/src/config-files.ts
@@ -0,0 +1,342 @@
+import fs from 'node:fs';
+import path from 'node:path';
+import {
+ applyEdits,
+ modify,
+ parse,
+ type ParseError,
+} from 'jsonc-parser';
+import type { GeneratedFile } from './types.js';
+
+function isRecord(value: unknown): value is Record<string, unknown> {
+ return Boolean(value)
+ && typeof value === 'object'
+ && !Array.isArray(value);
+}
+
+function mergeJson(existing: string, value: Record<string, unknown>): string {
+ let rendered = existing.trim() ? existing : '{}\n';
+ const errors: ParseError[] = [];
+ const parsed = parse(rendered, errors, {
+ allowTrailingComma: true,
+ disallowComments: false,
+ });
+ if (errors.length || !isRecord(parsed)) {
+ throw new Error('Existing JSON/JSONC cannot be parsed safely');
+ }
+
+ const formattingOptions = {
+ insertSpaces: true,
+ tabSize: 2,
+ eol: '\n',
+ };
+ const applyPatch = (
+ base: Record<string, unknown>,
+ patch: Record<string, unknown>,
+ parentPath: (string | number)[] = [],
+ ) => {
+ for (const [key, next] of Object.entries(patch)) {
+ const current = base[key];
+ const propertyPath = [...parentPath, key];
+ if (isRecord(current) && isRecord(next)) {
+ applyPatch(current, next, propertyPath);
+ continue;
+ }
+ rendered = applyEdits(rendered, modify(
+ rendered,
+ propertyPath,
+ next,
+ { formattingOptions },
+ ));
+ }
+ };
+ applyPatch(parsed, value);
+ return rendered.endsWith('\n') ? rendered : `${rendered}\n`;
+}
+
+function markerPattern(): RegExp {
+ return new RegExp(
+ `^[ \\t]*(?:#|//) freellmapi:start[\\s\\S]*?^[ \\t]*(?:#|//) freellmapi:end\\s*`,
+ 'm',
+ );
+}
+
+function mergeMarked(existing: string, generated: string): string {
+ const start = generated.match(/^[ \t]*(?:#|\/\/) freellmapi:start$/m)?.[0];
+ const end = generated.match(/^[ \t]*(?:#|\/\/) freellmapi:end$/m)?.[0];
+ if (!start || !end) return generated;
+ const marked = markerPattern();
+ if (marked.test(existing)) {
+ return existing.replace(marked, `${generated.trimEnd()}\n`);
+ }
+ const separator = existing.length && !existing.endsWith('\n') ? '\n' : '';
+ return `${existing}${separator}${existing.trim() ? '\n' : ''}${generated}`;
+}
+
+function topLevelYamlKey(line: string): string | undefined {
+ return line.match(/^([A-Za-z0-9_-]+):(?:\s|$)/)?.[1];
+}
+
+function generatedYamlKeys(generated: string): Set<string> {
+ return new Set(generated.split(/\r?\n/)
+ .map(topLevelYamlKey)
+ .filter((key): key is string => Boolean(key)));
+}
+
+function removeYamlKeys(existing: string, keys: Set<string>): string {
+ const lines = existing.split(/\r?\n/);
+ const output: string[] = [];
+ for (let index = 0; index < lines.length;) {
+ const key = topLevelYamlKey(lines[index]);
+ if (!key || !keys.has(key)) {
+ output.push(lines[index]);
+ index += 1;
+ continue;
+ }
+ index += 1;
+ while (index < lines.length && !topLevelYamlKey(lines[index])) index += 1;
+ }
+ return output.join('\n').replace(/\n{3,}/g, '\n\n').trimEnd();
+}
+
+function continueModelLines(generated: string): string[] {
+ const lines = generated.split(/\r?\n/);
+ const modelsIndex = lines.findIndex(line => line === 'models:');
+ const endIndex = lines.findIndex(
+ (line, index) => index > modelsIndex && line === '# freellmapi:end',
+ );
+ return lines.slice(modelsIndex + 1, endIndex < 0 ? undefined : endIndex);
+}
+
+function mergeContinueYaml(existing: string, generated: string): string {
+ const generatedLines = generated.split(/\r?\n/);
+ const missingHeader = ['name', 'version', 'schema']
+ .filter(key => !existing.split(/\r?\n/).some(line => topLevelYamlKey(line) === key))
+ .map(key => generatedLines.find(line => topLevelYamlKey(line) === key)!)
+ .filter(Boolean);
+ let lines = existing.split(/\r?\n/);
+ const modelsIndex = lines.findIndex(line => topLevelYamlKey(line) === 'models');
+ const modelLines = continueModelLines(generated);
+
+ if (modelsIndex < 0) {
+ const prefix = missingHeader.length ? `${missingHeader.join('\n')}\n` : '';
+ const separator = existing.trim() ? '\n\n' : '';
+ return `${prefix}${existing.trimEnd()}${separator}models:\n${modelLines.join('\n')}\n`;
+ }
+
+ let modelsEnd = modelsIndex + 1;
+ while (modelsEnd < lines.length && !topLevelYamlKey(lines[modelsEnd])) modelsEnd += 1;
+ const entryStart = lines.findIndex(
+ (line, index) => index > modelsIndex
+ && index < modelsEnd
+ && /^\s{2}-\s+name:\s+["']?FreeLLMAPI["']?\s*$/.test(line),
+ );
+ if (entryStart >= 0) {
+ let entryEnd = entryStart + 1;
+ while (
+ entryEnd < modelsEnd
+ && !/^\s{2}-\s+/.test(lines[entryEnd])
+ && !topLevelYamlKey(lines[entryEnd])
+ ) {
+ entryEnd += 1;
+ }
+ lines.splice(entryStart, entryEnd - entryStart, ...modelLines);
+ } else {
+ lines.splice(modelsEnd, 0, ...modelLines);
+ }
+ if (missingHeader.length) lines = [...missingHeader, ...lines];
+ return `${lines.join('\n').replace(/\n+$/, '')}\n`;
+}
+
+function mergeYaml(existing: string, generated: string): string {
+ if (/^name: FreeLLMAPI$/m.test(generated) && /^models:$/m.test(generated)) {
+ const withoutOldBlock = existing.replace(markerPattern(), '').trimEnd();
+ return mergeContinueYaml(withoutOldBlock, generated);
+ }
+ if (!existing.trim()) return generated;
+ if (/^# freellmapi:start$/m.test(existing)) return mergeMarked(existing, generated);
+ const withoutConflicts = removeYamlKeys(existing, generatedYamlKeys(generated));
+ return mergeMarked(withoutConflicts, generated);
+}
+
+function tomlTableHeader(line: string): string | undefined {
+ return line.match(/^\[([^\]]+)\]$/)?.[1];
+}
+
+function tomlRootKey(line: string): string | undefined {
+ return line.match(/^([A-Za-z0-9_.-]+)\s*=/)?.[1];
+}
+
+function isTomlMarkerLine(line: string): boolean {
+ return /^[ \t]*# freellmapi:(?:start|end)$/.test(line);
+}
+
+function trimBlankEdges(lines: string[]): string[] {
+ let start = 0;
+ let end = lines.length;
+ while (start < end && !lines[start].trim()) start += 1;
+ while (end > start && !lines[end - 1].trim()) end -= 1;
+ return lines.slice(start, end);
+}
+
+interface TomlSections {
+ root: string[];
+ tables: string[];
+}
+
+function splitTomlSections(generated: string): TomlSections {
+ const lines = generated.split(/\r?\n/).filter(line => !isTomlMarkerLine(line));
+ const firstTable = lines.findIndex(line => tomlTableHeader(line) !== undefined);
+ if (firstTable < 0) return { root: trimBlankEdges(lines), tables: [] };
+ return {
+ root: trimBlankEdges(lines.slice(0, firstTable)),
+ tables: trimBlankEdges(lines.slice(firstTable)),
+ };
+}
+
+// TOML keys written after a `[table]` header belong to that table, so
+// generated root-level keys must be inserted BEFORE the first table header of
+// the existing file, never appended after it. Generated tables are appended at
+// the end, and only root keys that the generated ROOT REGION sets are removed
+// from the existing root region.
+function mergeToml(existing: string, generated: string): string {
+ if (!existing.trim()) return generated;
+ const { root: generatedRoot, tables: generatedTables } = splitTomlSections(generated);
+ const rootKeys = new Set(generatedRoot
+ .map(tomlRootKey)
+ .filter((key): key is string => Boolean(key)));
+ const tableNames = new Set(generatedTables
+ .map(tomlTableHeader)
+ .filter((name): name is string => Boolean(name)));
+
+ const kept: string[] = [];
+ let currentTable: string | undefined;
+ for (const line of existing.split(/\r?\n/)) {
+ if (isTomlMarkerLine(line)) continue;
+ const table = tomlTableHeader(line);
+ if (table) currentTable = table;
+ if (currentTable && tableNames.has(currentTable)) continue;
+ if (!currentTable && rootKeys.has(tomlRootKey(line) ?? '')) continue;
+ kept.push(line);
+ }
+
+ const wrap = (lines: string[]): string[] => (lines.length
+ ? ['# freellmapi:start', ...lines, '# freellmapi:end']
+ : []);
+ const firstTable = kept.findIndex(line => tomlTableHeader(line) !== undefined);
+ const head = firstTable < 0 ? kept : kept.slice(0, firstTable);
+ const tail = firstTable < 0 ? [] : kept.slice(firstTable);
+ const sections = [head, wrap(generatedRoot), tail, wrap(generatedTables)]
+ .map(lines => trimBlankEdges(lines).join('\n').replace(/\n{3,}/g, '\n\n'))
+ .filter(Boolean);
+ return `${sections.join('\n\n')}\n`;
+}
+
+function mergeEnv(existing: string, generated: string): string {
+ const replacements = new Map(
+ generated.split(/\r?\n/)
+ .filter(line => line && !line.startsWith('#') && line.includes('='))
+ .map(line => [line.slice(0, line.indexOf('=')), line]),
+ );
+ const lines = existing.split(/\r?\n/);
+ const seen = new Set<string>();
+ const output = lines.map(line => {
+ const separator = line.indexOf('=');
+ if (separator < 1 || line.trimStart().startsWith('#')) return line;
+ const key = line.slice(0, separator);
+ const replacement = replacements.get(key);
+ if (!replacement) return line;
+ seen.add(key);
+ return replacement;
+ });
+ for (const [key, line] of replacements) {
+ if (!seen.has(key)) output.push(line);
+ }
+ return `${output.filter((line, index) => line || index < output.length - 1).join('\n')}\n`;
+}
+
+export function renderFile(file: GeneratedFile, existing = ''): string {
+ if (file.format === 'json') return mergeJson(existing, file.value ?? {});
+ if (file.format === 'env') return mergeEnv(existing, file.content ?? '');
+ if (file.format === 'yaml') return mergeYaml(existing, file.content ?? '');
+ return mergeToml(existing, file.content ?? '');
+}
+
+function timestamp(): string {
+ return new Date().toISOString().replace(/[:.]/g, '-');
+}
+
+export interface ApplyResult {
+ path: string;
+ changed: boolean;
+ backupPath?: string;
+ rendered: string;
+ previous: string;
+}
+
+interface PlannedWrite extends ApplyResult {
+ file: GeneratedFile;
+ exists: boolean;
+}
+
+function planGeneratedFile(file: GeneratedFile): PlannedWrite {
+ const exists = fs.existsSync(file.path);
+ const previous = exists ? fs.readFileSync(file.path, 'utf8') : '';
+ const rendered = renderFile(file, previous);
+ return {
+ file,
+ exists,
+ path: file.path,
+ changed: rendered !== previous,
+ rendered,
+ previous,
+ };
+}
+
+function commitPlannedWrite(plan: PlannedWrite): ApplyResult {
+ const { file, exists, ...result } = plan;
+ if (!plan.changed) return result;
+ fs.mkdirSync(path.dirname(file.path), { recursive: true, mode: 0o700 });
+ let backupPath: string | undefined;
+ if (exists) {
+ backupPath = `${file.path}.backup-${timestamp()}`;
+ fs.copyFileSync(file.path, backupPath);
+ }
+ const temporary = `${file.path}.freellmapi-${process.pid}.tmp`;
+ fs.writeFileSync(temporary, plan.rendered, { mode: file.sensitive ? 0o600 : 0o644 });
+ fs.renameSync(temporary, file.path);
+ if (file.sensitive) fs.chmodSync(file.path, 0o600);
+ return { ...result, backupPath };
+}
+
+// Two-phase apply: every target file is read and merged BEFORE the first
+// write, so a merge failure on any file aborts the whole batch without
+// leaving earlier files modified.
+export function applyGeneratedFiles(
+ files: GeneratedFile[],
+ dryRun: boolean,
+): ApplyResult[] {
+ const plans = files.map(planGeneratedFile);
+ if (dryRun) return plans.map(({ file: _file, exists: _exists, ...result }) => result);
+ return plans.map(commitPlannedWrite);
+}
+
+export function applyGeneratedFile(file: GeneratedFile, dryRun: boolean): ApplyResult {
+ return applyGeneratedFiles([file], dryRun)[0];
+}
+
+export function printDryRunDiff(result: ApplyResult): string {
+ const oldLines = result.previous.split(/\r?\n/);
+ const newLines = result.rendered.split(/\r?\n/);
+ const lines = [`--- ${result.path}`, `+++ ${result.path}`];
+ if (!result.previous) {
+ lines.push(...newLines.map(line => `+${line}`));
+ return lines.join('\n');
+ }
+ const prefix = oldLines.findIndex((line, index) => line !== newLines[index]);
+ const changedAt = prefix < 0 ? 0 : prefix;
+ lines.push(`@@ line ${changedAt + 1} @@`);
+ lines.push(...oldLines.slice(changedAt).map(line => `-${line}`));
+ lines.push(...newLines.slice(changedAt).map(line => `+${line}`));
+ return lines.join('\n');
+}
diff --git a/cli/src/index.test.ts b/cli/src/index.test.ts
new file mode 100644
index 00000000..a17a6be6
--- /dev/null
+++ b/cli/src/index.test.ts
@@ -0,0 +1,123 @@
+import fs from 'node:fs';
+import os from 'node:os';
+import path from 'node:path';
+import { afterEach, describe, expect, it } from 'vitest';
+import { claudeLaunchEnv, codexArgs, parseArgs } from './index.js';
+import type { CatalogModel } from './types.js';
+
+describe('CLI arguments and launchers', () => {
+ it('parses setup options before or after the command', () => {
+ expect(parseArgs([
+ '--url',
+ 'http://localhost:3001/v1',
+ 'setup-codex',
+ '--profile=work',
+ '--dry-run',
+ ])).toMatchObject({
+ command: 'setup-codex',
+ options: {
+ url: 'http://localhost:3001/v1',
+ profile: 'work',
+ dryRun: true,
+ },
+ });
+ });
+
+ it('rejects profile names that can escape the intended config directory', () => {
+ expect(() => parseArgs(['setup-codex', '--profile', '../../outside']))
+ .toThrow('--profile must use only');
+ expect(() => parseArgs(['setup-codex', '--profile', '..']))
+ .toThrow('--profile must use only');
+ });
+
+ it('rejects a missing option value instead of consuming the next flag', () => {
+ expect(() => parseArgs(['setup-codex', '--profile', '--dry-run']))
+ .toThrow('--profile requires a value');
+ });
+
+ const models: CatalogModel[] = [
+ { id: 'auto' },
+ { id: 'fast-coder', available: true, context_window: 131072 },
+ { id: 'reasoning-model', available: true, context_window: 262144 },
+ ];
+ const baseOptions = {
+ url: 'http://localhost:3000',
+ profile: 'default',
+ dryRun: false,
+ };
+ const temporary: string[] = [];
+
+ afterEach(() => {
+ for (const directory of temporary.splice(0)) {
+ fs.rmSync(directory, { recursive: true, force: true });
+ }
+ });
+
+ it('uses --model for ANTHROPIC_MODEL and defaults to the first available model', () => {
+ const explicit = claudeLaunchEnv(
+ { ...baseOptions, model: 'reasoning-model' },
+ 'unified-key',
+ models,
+ {},
+ '/home/tester',
+ );
+ expect(explicit.ANTHROPIC_MODEL).toBe('reasoning-model');
+ expect(explicit.CLAUDE_CODE_AUTO_COMPACT_WINDOW).toBe('262144');
+
+ const fallback = claudeLaunchEnv(baseOptions, 'unified-key', models, {}, '/home/tester');
+ expect(fallback.ANTHROPIC_MODEL).toBe('fast-coder');
+ expect(fallback.ANTHROPIC_AUTH_TOKEN).toBe('unified-key');
+ expect(fallback.ANTHROPIC_BASE_URL).toBe('http://localhost:3000');
+ });
+
+ it('never uses the profile name as a model id', () => {
+ const home = fs.mkdtempSync(path.join(os.tmpdir(), 'freellmapi-cli-'));
+ temporary.push(home);
+ const profileDir = path.join(home, '.claude', 'profiles', 'work');
+ fs.mkdirSync(profileDir, { recursive: true });
+ const env = claudeLaunchEnv(
+ { ...baseOptions, profile: 'work' },
+ 'unified-key',
+ models,
+ {},
+ home,
+ );
+ expect(env.ANTHROPIC_MODEL).toBe('fast-coder');
+ expect(env.CLAUDE_CONFIG_DIR).toBe(profileDir);
+ });
+
+ it('rejects a profile whose configuration directory does not exist', () => {
+ const home = fs.mkdtempSync(path.join(os.tmpdir(), 'freellmapi-cli-'));
+ temporary.push(home);
+ expect(() => claudeLaunchEnv(
+ { ...baseOptions, profile: 'missing' },
+ 'unified-key',
+ models,
+ {},
+ home,
+ )).toThrow("freellmapi setup-claude --profile missing");
+ });
+
+ it('strips the user\'s real Anthropic credentials from the child environment', () => {
+ const env = claudeLaunchEnv(baseOptions, 'unified-key', models, {
+ ANTHROPIC_API_KEY: 'real-anthropic-key',
+ ANTHROPIC_AUTH_TOKEN: 'real-anthropic-token',
+ PATH: '/usr/bin',
+ }, '/home/tester');
+ expect(env.ANTHROPIC_API_KEY).toBeUndefined();
+ expect(env.ANTHROPIC_AUTH_TOKEN).toBe('unified-key');
+ expect(env.PATH).toBe('/usr/bin');
+ expect(JSON.stringify(env)).not.toContain('real-anthropic');
+ });
+
+ it('passes a complete Responses provider to Codex', () => {
+ const args = codexArgs('http://localhost:3001/v1/', 'coder');
+ expect(args).toContain('model_provider="freellmapi"');
+ expect(args).toContain('model="coder"');
+ expect(args).toContain('model_providers.freellmapi.name="FreeLLMAPI"');
+ expect(args).toContain(
+ 'model_providers.freellmapi.base_url="http://localhost:3001/v1"',
+ );
+ expect(args).toContain('model_providers.freellmapi.wire_api="responses"');
+ });
+});
diff --git a/cli/src/index.ts b/cli/src/index.ts
new file mode 100644
index 00000000..ee293c4e
--- /dev/null
+++ b/cli/src/index.ts
@@ -0,0 +1,326 @@
+#!/usr/bin/env node
+import os from 'node:os';
+import fs from 'node:fs';
+import path from 'node:path';
+import process from 'node:process';
+import readline from 'node:readline/promises';
+import { spawn } from 'node:child_process';
+import { Writable } from 'node:stream';
+import { fileURLToPath } from 'node:url';
+import { applyGeneratedFiles, printDryRunDiff } from './config-files.js';
+import { getTool, tools } from './tools.js';
+import type { CatalogModel, GenerateContext } from './types.js';
+
+interface CliOptions {
+ url: string;
+ apiKey?: string;
+ profile: string;
+ model?: string;
+ dryRun: boolean;
+}
+
+function rootUrl(url: string): string {
+ return url.trim().replace(/\/+$/, '').replace(/\/v1$/i, '');
+}
+
+function validateProfile(profile: string): string {
+ if (
+ !/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(profile)
+ || profile === '.'
+ || profile === '..'
+ ) {
+ throw new Error(
+ '--profile must use only letters, numbers, dots, underscores, or hyphens',
+ );
+ }
+ return profile;
+}
+
+export function parseArgs(argv: string[]): { command?: string; options: CliOptions } {
+ const options: CliOptions = {
+ url: process.env.FREELLMAPI_URL || 'http://localhost:3000',
+ apiKey: process.env.FREELLMAPI_API_KEY,
+ profile: 'default',
+ dryRun: false,
+ };
+ let command: string | undefined;
+ for (let index = 0; index < argv.length; index += 1) {
+ const arg = argv[index];
+ if (!arg.startsWith('-') && !command) {
+ command = arg;
+ continue;
+ }
+ if (arg === '--dry-run') {
+ options.dryRun = true;
+ continue;
+ }
+ const [flag, inline] = arg.split('=', 2);
+ const value = inline ?? argv[index + 1];
+ if (flag === '--url' || flag === '--api-key' || flag === '--profile' || flag === '--model') {
+ if (inline === undefined) index += 1;
+ if (!value || (inline === undefined && value.startsWith('-'))) {
+ throw new Error(`${flag} requires a value`);
+ }
+ if (flag === '--url') options.url = value;
+ else if (flag === '--api-key') options.apiKey = value;
+ else if (flag === '--profile') options.profile = validateProfile(value);
+ else options.model = value;
+ continue;
+ }
+ if (arg !== '--help' && arg !== '-h') throw new Error(`Unknown option: ${arg}`);
+ }
+ return { command, options };
+}
+
+async function promptForKey(): Promise<string> {
+ if (!process.stdin.isTTY) {
+ throw new Error(
+ 'No API key supplied. Pass --api-key or set FREELLMAPI_API_KEY.',
+ );
+ }
+ let muted = false;
+ const output = new Writable({
+ write(chunk, _encoding, callback) {
+ if (!muted) process.stderr.write(chunk);
+ callback();
+ },
+ });
+ const rl = readline.createInterface({
+ input: process.stdin,
+ output,
+ terminal: true,
+ });
+ try {
+ const answer = rl.question('FreeLLMAPI unified API key: ');
+ muted = true;
+ const value = (await answer).trim();
+ muted = false;
+ process.stderr.write('\n');
+ if (!value) throw new Error('An API key is required');
+ return value;
+ } finally {
+ muted = false;
+ rl.close();
+ }
+}
+
+async function catalog(url: string, apiKey: string): Promise<CatalogModel[]> {
+ let response: Response;
+ try {
+ response = await fetch(`${rootUrl(url)}/v1/models?available=true`, {
+ headers: { Authorization: `Bearer ${apiKey}` },
+ signal: AbortSignal.timeout(10_000),
+ });
+ } catch (error) {
+ const cause = error instanceof Error && error.cause instanceof Error
+ ? error.cause.message
+ : undefined;
+ const reason = cause ?? (error instanceof Error ? error.message : String(error));
+ throw new Error(
+ `Could not reach the FreeLLMAPI gateway at ${rootUrl(url)} (${reason}). `
+ + 'Check that the server is running, or point the CLI at it with --url or FREELLMAPI_URL.',
+ );
+ }
+ if (!response.ok) {
+ const detail = (await response.text()).slice(0, 200);
+ throw new Error(`Catalog request failed (HTTP ${response.status}): ${detail}`);
+ }
+ const body = await response.json() as { data?: CatalogModel[] };
+ const models = body.data ?? [];
+ if (!models.length) throw new Error('The live catalog returned no models');
+ return models;
+}
+
+function help(): string {
+ return [
+ 'FreeLLMAPI coding-agent setup',
+ '',
+ 'Usage:',
+ ' freellmapi <command> [--url URL] [--api-key KEY] [--profile NAME] [--model ID] [--dry-run]',
+ '',
+ 'Commands:',
+ ...tools.map(tool => ` ${tool.command.padEnd(17)} ${tool.name}`),
+ ' launch Run Claude Code with credentials injected into the child environment',
+ ' launch-codex Run Codex with provider overrides and injected credentials',
+ ' list List supported coding agents',
+ '',
+ 'Environment:',
+ ' FREELLMAPI_URL, FREELLMAPI_API_KEY',
+ ].join('\n');
+}
+
+async function setup(command: string, options: CliOptions): Promise<void> {
+ const tool = getTool(command.replace(/^setup-/, ''));
+ if (!tool) throw new Error(`Unknown setup command '${command}'`);
+ const apiKey = options.apiKey ?? await promptForKey();
+ const models = await catalog(options.url, apiKey);
+ const context: GenerateContext = {
+ url: rootUrl(options.url),
+ apiKey,
+ profile: options.profile,
+ models,
+ homeDir: os.homedir(),
+ };
+ const generation = tool.generate(context);
+
+ if (generation.files.length === 0) {
+ for (const note of generation.notes) process.stdout.write(`${note}\n`);
+ return;
+ }
+
+ const results = applyGeneratedFiles(generation.files, options.dryRun);
+ for (const result of results) {
+ if (options.dryRun && result.changed) {
+ process.stdout.write(`${printDryRunDiff(result)}\n`);
+ } else if (result.changed) {
+ process.stdout.write(`Updated ${result.path}\n`);
+ if (result.backupPath) process.stdout.write(`Backup: ${result.backupPath}\n`);
+ } else {
+ process.stdout.write(`Unchanged ${result.path}\n`);
+ }
+ }
+ for (const note of generation.notes) process.stdout.write(`\n${note}\n`);
+}
+
+// Runs an interactive child with inherited stdio. SIGINT is ignored in the
+// wrapper (the foreground child receives it from the terminal and decides
+// what to do), SIGTERM is forwarded, and the child's exit code is returned.
+function runChild(
+ command: string,
+ args: string[],
+ env: NodeJS.ProcessEnv,
+): Promise<number> {
+ const child = spawn(command, args, { stdio: 'inherit', env });
+ const ignoreSigint = (): void => {};
+ const forwardSigterm = (): void => { child.kill('SIGTERM'); };
+ process.on('SIGINT', ignoreSigint);
+ process.on('SIGTERM', forwardSigterm);
+ const cleanup = (): void => {
+ process.off('SIGINT', ignoreSigint);
+ process.off('SIGTERM', forwardSigterm);
+ };
+ return new Promise<number>((resolve, reject) => {
+ child.once('error', error => {
+ cleanup();
+ reject(error);
+ });
+ child.once('exit', (code, signal) => {
+ cleanup();
+ if (code !== null) resolve(code);
+ else if (signal) resolve(128 + (os.constants.signals[signal] ?? 0));
+ else resolve(1);
+ });
+ });
+}
+
+// `--profile` selects a CLAUDE_CONFIG_DIR generated by setup-claude and is
+// never a model id; `--model` picks the model explicitly.
+export function claudeLaunchEnv(
+ options: CliOptions,
+ apiKey: string,
+ models: CatalogModel[],
+ baseEnv: NodeJS.ProcessEnv = process.env,
+ homeDir = os.homedir(),
+): NodeJS.ProcessEnv {
+ const selected = options.model
+ ?? models.find(model => model.id !== 'auto' && model.available !== false)?.id
+ ?? 'auto';
+ const selectedModel = models.find(model => model.id === selected);
+ const contextWindow = selectedModel?.context_window
+ ?? selectedModel?.context_length
+ ?? 128_000;
+ const env: NodeJS.ProcessEnv = { ...baseEnv };
+ // Never leak the user's real Anthropic credentials to the gateway.
+ delete env.ANTHROPIC_API_KEY;
+ delete env.ANTHROPIC_AUTH_TOKEN;
+ if (options.profile !== 'default') {
+ const directory = path.join(homeDir, '.claude', 'profiles', options.profile);
+ if (!fs.existsSync(directory)) {
+ throw new Error(
+ `Claude profile '${options.profile}' has no configuration directory at ${directory}. `
+ + `Create it with: freellmapi setup-claude --profile ${options.profile}`,
+ );
+ }
+ env.CLAUDE_CONFIG_DIR = directory;
+ }
+ return Object.assign(env, {
+ ANTHROPIC_BASE_URL: rootUrl(options.url),
+ ANTHROPIC_AUTH_TOKEN: apiKey,
+ ANTHROPIC_MODEL: selected,
+ ANTHROPIC_DEFAULT_OPUS_MODEL: selected,
+ ANTHROPIC_DEFAULT_SONNET_MODEL: selected,
+ ANTHROPIC_DEFAULT_HAIKU_MODEL: selected,
+ CLAUDE_CODE_AUTO_COMPACT_WINDOW: String(contextWindow),
+ CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY: '1',
+ });
+}
+
+async function launchClaude(options: CliOptions): Promise<number> {
+ const apiKey = options.apiKey ?? await promptForKey();
+ const models = await catalog(options.url, apiKey);
+ const env = claudeLaunchEnv(options, apiKey, models);
+ return runChild('claude', [], env);
+}
+
+export function codexArgs(url: string, selected: string): string[] {
+ return [
+ '-c', 'model_provider="freellmapi"',
+ '-c', `model=${JSON.stringify(selected)}`,
+ '-c', 'model_providers.freellmapi.name="FreeLLMAPI"',
+ '-c', `model_providers.freellmapi.base_url=${JSON.stringify(`${rootUrl(url)}/v1`)}`,
+ '-c', 'model_providers.freellmapi.wire_api="responses"',
+ '-c', 'model_providers.freellmapi.env_key="FREELLMAPI_API_KEY"',
+ '-c', 'model_providers.freellmapi.requires_openai_auth=false',
+ ];
+}
+
+async function launchCodex(options: CliOptions): Promise<number> {
+ const apiKey = options.apiKey ?? await promptForKey();
+ const models = await catalog(options.url, apiKey);
+ const selected = options.model
+ ?? models.find(model => model.id !== 'auto' && model.available !== false)?.id
+ ?? 'auto';
+ const env = { ...process.env, FREELLMAPI_API_KEY: apiKey };
+ const args = codexArgs(options.url, selected);
+ return runChild('codex', args, env);
+}
+
+export async function main(argv = process.argv.slice(2)): Promise<number> {
+ const { command, options } = parseArgs(argv);
+ if (!command || command === 'help' || argv.includes('--help') || argv.includes('-h')) {
+ process.stdout.write(`${help()}\n`);
+ return 0;
+ }
+ if (command === 'list') {
+ for (const tool of tools) {
+ process.stdout.write(`${tool.id}\t${tool.protocol}\t${tool.baseUrlSupport}\n`);
+ }
+ return 0;
+ }
+ if (command.startsWith('setup-')) {
+ await setup(command, options);
+ return 0;
+ }
+ if (command === 'launch') return launchClaude(options);
+ if (command === 'launch-codex') return launchCodex(options);
+ throw new Error(`Unknown command '${command}'\n\n${help()}`);
+}
+
+function isDirectExecution(): boolean {
+ if (!process.argv[1]) return false;
+ try {
+ return fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url));
+ } catch {
+ return false;
+ }
+}
+
+if (isDirectExecution()) {
+ main().then(
+ code => { process.exitCode = code; },
+ error => {
+ process.stderr.write(`freellmapi: ${error instanceof Error ? error.message : String(error)}\n`);
+ process.exitCode = 1;
+ },
+ );
+}
diff --git a/cli/src/tools.test.ts b/cli/src/tools.test.ts
new file mode 100644
index 00000000..dc94bd96
--- /dev/null
+++ b/cli/src/tools.test.ts
@@ -0,0 +1,218 @@
+import fs from 'node:fs';
+import path from 'node:path';
+import { describe, expect, it } from 'vitest';
+import { tools } from './tools.js';
+import type { GenerateContext } from './types.js';
+
+const context: GenerateContext = {
+ url: 'http://localhost:3000',
+ apiKey: 'freellmapi-test-key',
+ profile: 'default',
+ homeDir: '/home/tester',
+ models: [
+ {
+ id: 'fast-coder',
+ name: 'Fast Coder',
+ available: true,
+ context_window: 131072,
+ },
+ {
+ id: 'reasoning-model',
+ name: 'Reasoning Model',
+ available: true,
+ context_window: 262144,
+ },
+ ],
+};
+
+describe('tool generators', () => {
+ it('defaults to auto, never fusion, when the live catalog lists virtual models first', () => {
+ const liveContext: GenerateContext = {
+ ...context,
+ models: [
+ { id: 'auto', name: 'Auto', available: true, context_window: 200_000 },
+ { id: 'fusion', name: 'Fusion', available: true, context_window: 2_000_000 },
+ ...context.models,
+ ],
+ };
+ const claude = tools.find(tool => tool.id === 'claude')!.generate(liveContext);
+ const settings = claude.files[0].value as { env: Record<string, string> };
+ expect(settings.env.ANTHROPIC_MODEL).toBe('auto');
+ const codex = tools.find(tool => tool.id === 'codex')!.generate(liveContext);
+ expect(codex.files[0].content).toContain('model = "auto"');
+ expect(codex.files[0].content).not.toContain('"fusion"');
+ });
+
+ for (const tool of tools) {
+ it(`${tool.command} has stable golden output`, () => {
+ expect(tool.generate(context)).toMatchSnapshot();
+ });
+ }
+
+ it('setup-codex with a named profile has stable golden output', () => {
+ const generation = tools.find(tool => tool.id === 'codex')!
+ .generate({ ...context, profile: 'work' });
+ expect(generation).toMatchSnapshot();
+ });
+
+ it('writes named Codex profiles as [profiles.NAME] inside config.toml', () => {
+ const generation = tools.find(tool => tool.id === 'codex')!
+ .generate({ ...context, profile: 'work' });
+ expect(generation.files).toHaveLength(1);
+ const file = generation.files[0];
+ // Codex only reads ~/.codex/config.toml; per-profile files are ignored.
+ expect(file.path).toBe('/home/tester/.codex/config.toml');
+ expect(file.content).toContain('[profiles.work]');
+ expect(file.content).toContain('model = "fast-coder"');
+ expect(file.content).toContain('model_provider = "freellmapi"');
+ expect(file.content).toContain('[model_providers.freellmapi]');
+ // A named profile must not hijack the root/default model selection.
+ expect(file.content!.split('\n').findIndex(line => line.startsWith('model =')))
+ .toBeGreaterThan(file.content!.split('\n').indexOf('[profiles.work]'));
+ expect(generation.notes.join('\n')).toContain('codex --profile work');
+ });
+
+ it('generates Cline current provider settings with repeatable selection', () => {
+ const file = tools.find(tool => tool.id === 'cline')!.generate(context).files[0];
+ const state = file.value as any;
+ expect(file.path).toBe('/home/tester/.cline/data/settings/providers.json');
+ expect(state).toMatchObject({
+ version: 1,
+ lastUsedProvider: 'openai-compatible',
+ });
+ expect(state.providers['openai-compatible']).toMatchObject({
+ settings: {
+ provider: 'openai-compatible',
+ protocol: 'openai-chat',
+ client: 'openai-compatible',
+ model: 'fast-coder',
+ baseUrl: 'http://localhost:3000/v1',
+ apiKey: 'freellmapi-test-key',
+ contextWindow: 131072,
+ capabilities: ['streaming', 'tools'],
+ },
+ tokenSource: 'manual',
+ });
+ });
+
+ it('generates a complete Continue v1 config with Agent tool support', () => {
+ const config = tools.find(tool => tool.id === 'continue')!
+ .generate(context).files[0].content!;
+ expect(config).toContain('name: FreeLLMAPI');
+ expect(config).toContain('version: 1.0.0');
+ expect(config).toContain('schema: v1');
+ expect(config).toContain(' - tool_use');
+ expect(config).toContain(' apiKey: ${{ secrets.FREELLMAPI_API_KEY }}');
+ });
+
+ it('generates Goose custom-provider registration without persisting the key', () => {
+ const generation = tools.find(tool => tool.id === 'goose')!.generate(context);
+ const provider = generation.files.find(file => file.path.endsWith('freellmapi.json'))!.value as any;
+ const selection = generation.files.find(file => file.path.endsWith('config.yaml'))!.content!;
+ expect(provider).toMatchObject({
+ name: 'freellmapi',
+ engine: 'openai',
+ api_key_env: 'FREELLMAPI_API_KEY',
+ base_url: 'http://localhost:3000/v1',
+ requires_auth: true,
+ dynamic_models: false,
+ });
+ expect(provider.models.map((model: any) => model.name)).toEqual([
+ 'fast-coder',
+ 'reasoning-model',
+ ]);
+ expect(selection).toContain('GOOSE_PROVIDER: freellmapi');
+ expect(JSON.stringify(generation)).not.toContain('freellmapi-test-key');
+ });
+
+ it('generates Qwen Code provider catalogs using a supported auth type', () => {
+ const generation = tools.find(tool => tool.id === 'qwen')!.generate(context);
+ const settings = generation.files.find(file => file.path.endsWith('settings.json'))!.value as any;
+ expect(settings.security.auth.selectedType).toBe('openai');
+ expect(settings.model).toEqual({ name: 'fast-coder' });
+ expect(settings.modelProviders.openai.protocol).toBe('openai');
+ expect(settings.modelProviders.openai.models).toHaveLength(2);
+ expect(settings.modelProviders.openai.models[0]).toMatchObject({
+ id: 'fast-coder',
+ envKey: 'FREELLMAPI_API_KEY',
+ baseUrl: 'http://localhost:3000/v1',
+ generationConfig: { contextWindowSize: 131072 },
+ });
+ expect(settings.modelProviders).not.toHaveProperty('freellmapi');
+ });
+
+ it('wraps Roo Code imports in the documented provider profile envelope', () => {
+ const config = tools.find(tool => tool.id === 'roo')!
+ .generate(context).files[0].value as any;
+ expect(config.providerProfiles.currentApiConfigName).toBe('freellmapi');
+ expect(config.providerProfiles.apiConfigs.freellmapi).toMatchObject({
+ apiProvider: 'openai',
+ openAiBaseUrl: 'http://localhost:3000/v1',
+ openAiModelId: 'fast-coder',
+ });
+ expect(config.globalSettings).toEqual({});
+ });
+
+ it('writes Kilo trusted global config with every catalog model', () => {
+ const file = tools.find(tool => tool.id === 'kilo')!.generate(context).files[0];
+ const config = file.value as any;
+ expect(file.path).toBe('/home/tester/.config/kilo/kilo.jsonc');
+ expect(config.$schema).toBe('https://app.kilo.ai/config.json');
+ expect(config.model).toBe('openai-compatible/fast-coder');
+ expect(config.provider['openai-compatible'].options).toEqual({
+ apiKey: '{env:FREELLMAPI_API_KEY}',
+ baseURL: 'http://localhost:3000/v1',
+ });
+ expect(Object.keys(config.provider['openai-compatible'].models)).toEqual([
+ 'fast-coder',
+ 'reasoning-model',
+ ]);
+ expect(config.provider['openai-compatible'].models['fast-coder']).toMatchObject({
+ tool_call: true,
+ limit: { context: 131072, output: 8192 },
+ });
+ expect(JSON.stringify(config)).not.toContain('freellmapi-test-key');
+ });
+
+ it('uses Crush openai-compat schema and lists every catalog model', () => {
+ const config = tools.find(tool => tool.id === 'crush')!
+ .generate(context).files[0].value as any;
+ expect(config.$schema).toBe('https://charm.land/crush.json');
+ expect(config.providers.freellmapi.type).toBe('openai-compat');
+ expect(config.providers.freellmapi.models.map((model: any) => model.id)).toEqual([
+ 'fast-coder',
+ 'reasoning-model',
+ ]);
+ for (const model of config.providers.freellmapi.models) {
+ expect(model).toMatchObject({
+ cost_per_1m_in: 0,
+ cost_per_1m_out: 0,
+ cost_per_1m_in_cached: 0,
+ cost_per_1m_out_cached: 0,
+ can_reason: false,
+ supports_attachments: false,
+ });
+ }
+ });
+
+ it('uses /v1 for every OpenAI-compatible generated base URL', () => {
+ for (const tool of tools.filter(entry => entry.protocol.startsWith('OpenAI'))) {
+ expect(tool.baseUrlSupport, tool.id).toBe('/v1');
+ }
+ expect(tools.find(tool => tool.id === 'claude')!.baseUrlSupport).toBe('root');
+ });
+
+ it('keeps the dashboard metadata export in sync with the tool catalog', () => {
+ const expected = tools.map(({ generate: _generate, ...tool }) => tool);
+ const packageMetadata = JSON.parse(fs.readFileSync(
+ path.resolve(import.meta.dirname, '../tools.json'),
+ 'utf8',
+ ));
+ const dashboardMetadata = JSON.parse(fs.readFileSync(
+ path.resolve(import.meta.dirname, '../../client/src/data/agent-tools.json'),
+ 'utf8',
+ ));
+ expect(packageMetadata).toEqual(expected);
+ expect(dashboardMetadata).toEqual(expected);
+ });
+});
diff --git a/cli/src/tools.ts b/cli/src/tools.ts
new file mode 100644
index 00000000..a5e95b42
--- /dev/null
+++ b/cli/src/tools.ts
@@ -0,0 +1,498 @@
+import path from 'node:path';
+import type {
+ CatalogModel,
+ GenerateContext,
+ Generation,
+ ToolDefinition,
+} from './types.js';
+
+function rootUrl(url: string): string {
+ return url.trim().replace(/\/+$/, '').replace(/\/v1$/i, '');
+}
+
+function v1Url(url: string): string {
+ return `${rootUrl(url)}/v1`;
+}
+
+function primaryModel(models: CatalogModel[]): CatalogModel {
+ // `auto` — the router picking the best model per request — is the whole
+ // point of the gateway and the right default for a generated config. Never
+ // fall back to `fusion` (multi-model fan-out) by accident.
+ return models.find(model => model.id === 'auto')
+ ?? models.find(model => model.id !== 'fusion' && model.available !== false)
+ ?? models.find(model => model.id !== 'fusion')
+ ?? { id: 'auto', name: 'Auto', context_window: 128_000 };
+}
+
+function catalogModels(models: CatalogModel[]): CatalogModel[] {
+ const available = models.filter(model => model.id !== 'auto' && model.available !== false);
+ if (available.length) return available;
+ const nonAuto = models.filter(model => model.id !== 'auto');
+ return nonAuto.length ? nonAuto : [primaryModel(models)];
+}
+
+function contextWindow(model: CatalogModel): number {
+ return model.context_window ?? model.context_length ?? 128_000;
+}
+
+function outputLimit(model: CatalogModel): number {
+ return Math.min(8192, contextWindow(model));
+}
+
+function yamlString(value: string): string {
+ return JSON.stringify(value);
+}
+
+function claude(ctx: GenerateContext): Generation {
+ const model = primaryModel(ctx.models);
+ const directory = ctx.profile === 'default'
+ ? path.join(ctx.homeDir, '.claude')
+ : path.join(ctx.homeDir, '.claude', 'profiles', ctx.profile);
+ return {
+ files: [{
+ path: path.join(directory, 'settings.json'),
+ format: 'json',
+ sensitive: true,
+ value: {
+ env: {
+ ANTHROPIC_BASE_URL: rootUrl(ctx.url),
+ ANTHROPIC_AUTH_TOKEN: ctx.apiKey,
+ ANTHROPIC_MODEL: model.id,
+ ANTHROPIC_DEFAULT_OPUS_MODEL: model.id,
+ ANTHROPIC_DEFAULT_SONNET_MODEL: model.id,
+ ANTHROPIC_DEFAULT_HAIKU_MODEL: model.id,
+ CLAUDE_CODE_AUTO_COMPACT_WINDOW: String(contextWindow(model)),
+ CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY: '1',
+ },
+ },
+ }],
+ notes: [
+ ctx.profile === 'default'
+ ? 'Claude Code will read this configuration automatically.'
+ : `Launch with CLAUDE_CONFIG_DIR=${directory} claude`,
+ 'For zero-persistence credentials, prefer: freellmapi launch',
+ ],
+ };
+}
+
+function codex(ctx: GenerateContext): Generation {
+ const model = primaryModel(ctx.models);
+ const compact = Math.max(16_000, Math.floor(contextWindow(model) * 0.9));
+ const providerTable = [
+ '[model_providers.freellmapi]',
+ 'name = "FreeLLMAPI"',
+ `base_url = ${JSON.stringify(v1Url(ctx.url))}`,
+ 'wire_api = "responses"',
+ 'env_key = "FREELLMAPI_API_KEY"',
+ 'requires_openai_auth = false',
+ ];
+ // Codex reads exactly one file, ~/.codex/config.toml. Named profiles are
+ // `[profiles.NAME]` tables in that same file, selected with
+ // `codex --profile NAME`; separate per-profile files are never read.
+ const content = ctx.profile === 'default'
+ ? [
+ '# freellmapi:start',
+ `model = ${JSON.stringify(model.id)}`,
+ 'model_provider = "freellmapi"',
+ `model_context_window = ${contextWindow(model)}`,
+ `model_auto_compact_token_limit = ${compact}`,
+ 'tool_output_token_limit = 20000',
+ '',
+ ...providerTable,
+ '# freellmapi:end',
+ '',
+ ]
+ : [
+ '# freellmapi:start',
+ ...providerTable,
+ '',
+ `[profiles.${/^[A-Za-z0-9_-]+$/.test(ctx.profile) ? ctx.profile : JSON.stringify(ctx.profile)}]`,
+ `model = ${JSON.stringify(model.id)}`,
+ 'model_provider = "freellmapi"',
+ '# freellmapi:end',
+ '',
+ ];
+ return {
+ files: [{
+ path: path.join(ctx.homeDir, '.codex', 'config.toml'),
+ format: 'toml',
+ content: content.join('\n'),
+ }],
+ notes: [
+ 'Export FREELLMAPI_API_KEY before running codex; the key is not written to config.toml.',
+ ...(ctx.profile === 'default'
+ ? []
+ : [`Activate this profile with: codex --profile ${ctx.profile}`]),
+ `Selected ${model.id} with a ${contextWindow(model)} token context window.`,
+ ],
+ };
+}
+
+function cline(ctx: GenerateContext): Generation {
+ const model = primaryModel(ctx.models);
+ return {
+ files: [{
+ path: path.join(ctx.homeDir, '.cline', 'data', 'settings', 'providers.json'),
+ format: 'json',
+ sensitive: true,
+ value: {
+ version: 1,
+ lastUsedProvider: 'openai-compatible',
+ providers: {
+ 'openai-compatible': {
+ settings: {
+ provider: 'openai-compatible',
+ protocol: 'openai-chat',
+ client: 'openai-compatible',
+ model: model.id,
+ baseUrl: v1Url(ctx.url),
+ apiKey: ctx.apiKey,
+ contextWindow: contextWindow(model),
+ capabilities: ['streaming', 'tools'],
+ },
+ // The field is required by Cline's persisted schema. Keeping it
+ // deterministic makes repeated setup runs idempotent.
+ updatedAt: '2026-07-27T00:00:00.000Z',
+ tokenSource: 'manual',
+ },
+ },
+ },
+ }],
+ notes: ['Cline will use the generated OpenAI Compatible provider immediately.'],
+ };
+}
+
+function continueDev(ctx: GenerateContext): Generation {
+ const model = primaryModel(ctx.models);
+ return {
+ files: [{
+ path: path.join(ctx.homeDir, '.continue', 'config.yaml'),
+ format: 'yaml',
+ content: [
+ '# freellmapi:start',
+ 'name: FreeLLMAPI',
+ 'version: 1.0.0',
+ 'schema: v1',
+ 'models:',
+ ' - name: FreeLLMAPI',
+ ' provider: openai',
+ ` model: ${yamlString(model.id)}`,
+ ` apiBase: ${yamlString(v1Url(ctx.url))}`,
+ ' apiKey: ${{ secrets.FREELLMAPI_API_KEY }}',
+ ' capabilities:',
+ ' - tool_use',
+ ' defaultCompletionOptions:',
+ ` contextLength: ${contextWindow(model)}`,
+ '# freellmapi:end',
+ '',
+ ].join('\n'),
+ }],
+ notes: ['Add FREELLMAPI_API_KEY to Continue secrets; no raw key was written.'],
+ };
+}
+
+function aider(ctx: GenerateContext): Generation {
+ const model = primaryModel(ctx.models);
+ return {
+ files: [{
+ path: path.join(ctx.homeDir, '.aider.conf.yml'),
+ format: 'yaml',
+ sensitive: true,
+ content: [
+ '# freellmapi:start',
+ `openai-api-base: ${yamlString(v1Url(ctx.url))}`,
+ `openai-api-key: ${yamlString(ctx.apiKey)}`,
+ `model: ${yamlString(`openai/${model.id}`)}`,
+ '# freellmapi:end',
+ '',
+ ].join('\n'),
+ }],
+ notes: [
+ `Environment-only alternative: OPENAI_API_BASE=${v1Url(ctx.url)} OPENAI_API_KEY=… aider --model openai/${model.id}`,
+ ],
+ };
+}
+
+function opencode(ctx: GenerateContext): Generation {
+ const modelEntries = Object.fromEntries(ctx.models
+ .filter(model => model.id !== 'auto')
+ .map(model => [model.id, {
+ name: model.name ?? model.id,
+ limit: { context: contextWindow(model) },
+ }]));
+ return {
+ files: [{
+ path: path.join(ctx.homeDir, '.config', 'opencode', 'opencode.json'),
+ format: 'json',
+ value: {
+ $schema: 'https://opencode.ai/config.json',
+ provider: {
+ freellmapi: {
+ npm: '@ai-sdk/openai-compatible',
+ name: 'FreeLLMAPI',
+ options: {
+ baseURL: v1Url(ctx.url),
+ apiKey: '{env:FREELLMAPI_API_KEY}',
+ },
+ models: modelEntries,
+ },
+ },
+ },
+ }],
+ notes: ['Export FREELLMAPI_API_KEY before starting OpenCode.'],
+ };
+}
+
+function goose(ctx: GenerateContext): Generation {
+ const model = primaryModel(ctx.models);
+ const models = catalogModels(ctx.models).map(entry => ({
+ name: entry.id,
+ context_limit: contextWindow(entry),
+ }));
+ return {
+ files: [
+ {
+ path: path.join(
+ ctx.homeDir,
+ '.config',
+ 'goose',
+ 'custom_providers',
+ 'freellmapi.json',
+ ),
+ format: 'json',
+ value: {
+ name: 'freellmapi',
+ engine: 'openai',
+ display_name: 'FreeLLMAPI',
+ description: 'FreeLLMAPI OpenAI-compatible gateway',
+ api_key_env: 'FREELLMAPI_API_KEY',
+ base_url: v1Url(ctx.url),
+ models,
+ supports_streaming: true,
+ requires_auth: true,
+ dynamic_models: false,
+ preserves_thinking: true,
+ },
+ },
+ {
+ path: path.join(ctx.homeDir, '.config', 'goose', 'config.yaml'),
+ format: 'yaml',
+ content: [
+ '# freellmapi:start',
+ 'GOOSE_PROVIDER: freellmapi',
+ `GOOSE_MODEL: ${yamlString(model.id)}`,
+ '# freellmapi:end',
+ '',
+ ].join('\n'),
+ },
+ ],
+ notes: ['Export FREELLMAPI_API_KEY before starting Goose.'],
+ };
+}
+
+function qwen(ctx: GenerateContext): Generation {
+ const model = primaryModel(ctx.models);
+ const dir = path.join(ctx.homeDir, '.qwen');
+ const models = catalogModels(ctx.models).map(entry => ({
+ id: entry.id,
+ name: entry.name ?? entry.id,
+ envKey: 'FREELLMAPI_API_KEY',
+ baseUrl: v1Url(ctx.url),
+ generationConfig: {
+ contextWindowSize: contextWindow(entry),
+ },
+ }));
+ return {
+ files: [
+ {
+ path: path.join(dir, 'settings.json'),
+ format: 'json',
+ value: {
+ model: { name: model.id },
+ modelProviders: {
+ openai: {
+ protocol: 'openai',
+ models,
+ },
+ },
+ security: { auth: { selectedType: 'openai' } },
+ },
+ },
+ {
+ path: path.join(dir, '.env'),
+ format: 'env',
+ sensitive: true,
+ content: `FREELLMAPI_API_KEY=${ctx.apiKey}\n`,
+ },
+ ],
+ notes: [
+ `Native Gemini mode is also available at ${rootUrl(ctx.url)}/v1beta with GEMINI_API_KEY.`,
+ ],
+ };
+}
+
+function roo(ctx: GenerateContext): Generation {
+ const model = primaryModel(ctx.models);
+ const importPath = path.join(ctx.homeDir, '.roo', 'freellmapi.json');
+ return {
+ files: [{
+ path: importPath,
+ format: 'json',
+ sensitive: true,
+ value: {
+ providerProfiles: {
+ currentApiConfigName: 'freellmapi',
+ apiConfigs: {
+ freellmapi: {
+ apiProvider: 'openai',
+ openAiBaseUrl: v1Url(ctx.url),
+ openAiApiKey: ctx.apiKey,
+ openAiModelId: model.id,
+ },
+ },
+ },
+ globalSettings: {},
+ },
+ }],
+ notes: [`Set Roo Code's autoImportSettingsPath to ${importPath}.`],
+ };
+}
+
+function kilo(ctx: GenerateContext): Generation {
+ const model = primaryModel(ctx.models);
+ const models = Object.fromEntries(catalogModels(ctx.models).map(entry => [
+ entry.id,
+ {
+ name: entry.name ?? entry.id,
+ tool_call: true,
+ limit: {
+ context: contextWindow(entry),
+ output: outputLimit(entry),
+ },
+ },
+ ]));
+ return {
+ files: [{
+ path: path.join(ctx.homeDir, '.config', 'kilo', 'kilo.jsonc'),
+ format: 'json',
+ value: {
+ $schema: 'https://app.kilo.ai/config.json',
+ model: `openai-compatible/${model.id}`,
+ provider: {
+ 'openai-compatible': {
+ options: {
+ apiKey: '{env:FREELLMAPI_API_KEY}',
+ baseURL: v1Url(ctx.url),
+ },
+ models,
+ },
+ },
+ },
+ }],
+ notes: [
+ 'Export FREELLMAPI_API_KEY before starting Kilo; global config is trusted for {env:…} expansion.',
+ ],
+ };
+}
+
+function crush(ctx: GenerateContext): Generation {
+ const models = catalogModels(ctx.models).map(entry => ({
+ id: entry.id,
+ name: entry.name ?? entry.id,
+ cost_per_1m_in: 0,
+ cost_per_1m_out: 0,
+ cost_per_1m_in_cached: 0,
+ cost_per_1m_out_cached: 0,
+ context_window: contextWindow(entry),
+ default_max_tokens: outputLimit(entry),
+ can_reason: false,
+ supports_attachments: false,
+ }));
+ return {
+ files: [{
+ path: path.join(ctx.homeDir, '.config', 'crush', 'crush.json'),
+ format: 'json',
+ value: {
+ $schema: 'https://charm.land/crush.json',
+ providers: {
+ freellmapi: {
+ name: 'FreeLLMAPI',
+ type: 'openai-compat',
+ base_url: v1Url(ctx.url),
+ api_key: '$FREELLMAPI_API_KEY',
+ models,
+ },
+ },
+ },
+ }],
+ notes: ['Export FREELLMAPI_API_KEY before starting Crush.'],
+ };
+}
+
+function cursor(ctx: GenerateContext): Generation {
+ return {
+ files: [],
+ notes: [
+ 'Cursor sends model traffic through its cloud service, so localhost is not reachable from Cursor.',
+ `Expose the gateway through a trusted HTTPS tunnel, then open Cursor Settings → Models, enable Override OpenAI Base URL, and enter <public-url>/v1.`,
+ 'Cursor only documents custom keys for standard chat models; custom base-URL overrides may not support Responses-based or built-in models.',
+ 'The override affects Cursor globally while enabled, so disable it before switching back to built-in providers.',
+ 'Use a separately revocable URL token if the client cannot set an Authorization header.',
+ ],
+ };
+}
+
+function generic(ctx: GenerateContext): Generation {
+ const model = primaryModel(ctx.models);
+ return {
+ files: [],
+ notes: [
+ `OPENAI_BASE_URL=${v1Url(ctx.url)}`,
+ `OPENAI_API_KEY=${ctx.apiKey || '<unified-key>'}`,
+ `OPENAI_MODEL=${model.id}`,
+ `curl ${v1Url(ctx.url)}/chat/completions -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d '{"model":"${model.id}","messages":[{"role":"user","content":"Hello"}]}'`,
+ ],
+ };
+}
+
+const metadata = [
+ ['claude', 'Claude Code', 'code', 'file', 'Anthropic Messages', 'root', 'setup-claude', 'https://docs.anthropic.com/en/docs/claude-code', claude],
+ ['codex', 'Codex CLI', 'code', 'file', 'OpenAI Responses', '/v1', 'setup-codex', 'https://developers.openai.com/codex', codex],
+ ['cline', 'Cline', 'code', 'file', 'OpenAI Chat', '/v1', 'setup-cline', 'https://docs.cline.bot', cline],
+ ['continue', 'Continue', 'code', 'file', 'OpenAI Chat', '/v1', 'setup-continue', 'https://docs.continue.dev', continueDev],
+ ['aider', 'Aider', 'code', 'file', 'OpenAI Chat', '/v1', 'setup-aider', 'https://aider.chat/docs', aider],
+ ['opencode', 'OpenCode', 'code', 'file', 'OpenAI Chat', '/v1', 'setup-opencode', 'https://opencode.ai/docs', opencode],
+ ['goose', 'Goose', 'agent', 'file', 'OpenAI Chat', '/v1', 'setup-goose', 'https://block.github.io/goose', goose],
+ ['qwen', 'Qwen Code', 'code', 'file', 'OpenAI or Gemini', '/v1', 'setup-qwen', 'https://qwenlm.github.io/qwen-code-docs', qwen],
+ ['roo', 'Roo Code', 'code', 'file', 'OpenAI Chat', '/v1', 'setup-roo', 'https://docs.roocode.com', roo],
+ ['kilo', 'Kilo Code', 'code', 'file', 'OpenAI Chat', '/v1', 'setup-kilo', 'https://kilocode.ai/docs', kilo],
+ ['crush', 'Crush', 'code', 'file', 'OpenAI Chat', '/v1', 'setup-crush', 'https://github.com/charmbracelet/crush', crush],
+ ['cursor', 'Cursor', 'code', 'guide', 'OpenAI Chat', '/v1', 'setup-cursor', 'https://docs.cursor.com', cursor],
+ ['generic', 'Generic OpenAI client', 'agent', 'guide', 'OpenAI Chat', '/v1', 'setup-generic', 'https://github.com/tashfeenahmed/freellmapi', generic],
+] as const;
+
+export const tools: ToolDefinition[] = metadata.map(([
+ id,
+ name,
+ category,
+ configType,
+ protocol,
+ baseUrlSupport,
+ command,
+ docsUrl,
+ generate,
+]) => ({
+ id,
+ name,
+ category,
+ configType,
+ protocol,
+ baseUrlSupport,
+ command,
+ docsUrl,
+ generate,
+}));
+
+export function getTool(id: string): ToolDefinition | undefined {
+ return tools.find(tool => tool.id === id);
+}
diff --git a/cli/src/types.ts b/cli/src/types.ts
new file mode 100644
index 00000000..60542524
--- /dev/null
+++ b/cli/src/types.ts
@@ -0,0 +1,40 @@
+export interface CatalogModel {
+ id: string;
+ name?: string;
+ context_window?: number | null;
+ context_length?: number | null;
+ available?: boolean;
+}
+
+export interface GeneratedFile {
+ path: string;
+ format: 'json' | 'toml' | 'yaml' | 'env';
+ value?: Record<string, unknown>;
+ content?: string;
+ sensitive?: boolean;
+}
+
+export interface GenerateContext {
+ url: string;
+ apiKey: string;
+ profile: string;
+ models: CatalogModel[];
+ homeDir: string;
+}
+
+export interface Generation {
+ files: GeneratedFile[];
+ notes: string[];
+}
+
+export interface ToolDefinition {
+ id: string;
+ name: string;
+ category: 'code' | 'agent';
+ configType: 'env' | 'file' | 'guide';
+ protocol: string;
+ baseUrlSupport: 'root' | '/v1';
+ command: string;
+ docsUrl: string;
+ generate(ctx: GenerateContext): Generation;
+}
diff --git a/cli/tools.json b/cli/tools.json
new file mode 100644
index 00000000..c035b0ec
--- /dev/null
+++ b/cli/tools.json
@@ -0,0 +1,15 @@
+[
+ {"id":"claude","name":"Claude Code","category":"code","configType":"file","protocol":"Anthropic Messages","baseUrlSupport":"root","command":"setup-claude","docsUrl":"https://docs.anthropic.com/en/docs/claude-code"},
+ {"id":"codex","name":"Codex CLI","category":"code","configType":"file","protocol":"OpenAI Responses","baseUrlSupport":"/v1","command":"setup-codex","docsUrl":"https://developers.openai.com/codex"},
+ {"id":"cline","name":"Cline","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-cline","docsUrl":"https://docs.cline.bot"},
+ {"id":"continue","name":"Continue","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-continue","docsUrl":"https://docs.continue.dev"},
+ {"id":"aider","name":"Aider","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-aider","docsUrl":"https://aider.chat/docs"},
+ {"id":"opencode","name":"OpenCode","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-opencode","docsUrl":"https://opencode.ai/docs"},
+ {"id":"goose","name":"Goose","category":"agent","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-goose","docsUrl":"https://block.github.io/goose"},
+ {"id":"qwen","name":"Qwen Code","category":"code","configType":"file","protocol":"OpenAI or Gemini","baseUrlSupport":"/v1","command":"setup-qwen","docsUrl":"https://qwenlm.github.io/qwen-code-docs"},
+ {"id":"roo","name":"Roo Code","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-roo","docsUrl":"https://docs.roocode.com"},
+ {"id":"kilo","name":"Kilo Code","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-kilo","docsUrl":"https://kilocode.ai/docs"},
+ {"id":"crush","name":"Crush","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-crush","docsUrl":"https://github.com/charmbracelet/crush"},
+ {"id":"cursor","name":"Cursor","category":"code","configType":"guide","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-cursor","docsUrl":"https://docs.cursor.com"},
+ {"id":"generic","name":"Generic OpenAI client","category":"agent","configType":"guide","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-generic","docsUrl":"https://github.com/tashfeenahmed/freellmapi"}
+]
diff --git a/cli/tsconfig.json b/cli/tsconfig.json
new file mode 100644
index 00000000..9bc941e4
--- /dev/null
+++ b/cli/tsconfig.json
@@ -0,0 +1,17 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "NodeNext",
+ "moduleResolution": "NodeNext",
+ "outDir": "dist",
+ "rootDir": "src",
+ "strict": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "resolveJsonModule": true,
+ "declaration": true,
+ "types": ["node"]
+ },
+ "include": ["src/**/*.ts"],
+ "exclude": ["src/**/*.test.ts", "src/**/__snapshots__/**"]
+}
diff --git a/client/src/App.tsx b/client/src/App.tsx
index 2ef5add7..b20e5f28 100644
--- a/client/src/App.tsx
+++ b/client/src/App.tsx
@@ -38,6 +38,7 @@ import EmbeddingDetailPage from '@/pages/EmbeddingDetailPage'
import AnalyticsPage from '@/pages/AnalyticsPage'
import PremiumPage from '@/pages/PremiumPage'
import NotFoundPage from '@/pages/NotFoundPage'
+import AgentsPage from '@/pages/AgentsPage'
// Every failed mutation surfaces as an error toast, so no action fails
// silently. A page that already shows the failure inline can opt out with
@@ -55,6 +56,7 @@ const navItems = [
{ to: '/models', labelKey: 'nav.models' },
{ to: '/playground', labelKey: 'nav.playground' },
{ to: '/keys', labelKey: 'nav.keys' },
+ { to: '/agents', labelKey: 'nav.agents' },
{ to: '/analytics', labelKey: 'nav.analytics' },
{ to: '/premium', labelKey: 'nav.premium' },
]
@@ -329,6 +331,7 @@ function App() {
<Route path="/models/transcription/:id" element={<MediaDetailPage modality="transcription" />} />
<Route path="/playground" element={<PlaygroundPage />} />
<Route path="/keys" element={<KeysPage />} />
+ <Route path="/agents" element={<AgentsPage />} />
<Route path="/fallback" element={<Navigate to="/models/chat" replace />} />
<Route path="/analytics" element={<AnalyticsPage />} />
<Route path="/premium" element={<PremiumPage />} />
diff --git a/client/src/components/command-palette.tsx b/client/src/components/command-palette.tsx
index 56ecdcf3..6d3e9290 100644
--- a/client/src/components/command-palette.tsx
+++ b/client/src/components/command-palette.tsx
@@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom'
import { useQuery } from '@tanstack/react-query'
import {
AudioLines,
+ Bot,
Boxes,
ChartColumn,
Copy,
@@ -102,6 +103,7 @@ export function CommandPalette() {
{ id: 'p-fusion', group: 'pages', label: t('models.fusionTab'), keywords: 'models fusion synthesis panel judge', icon: Zap, run: go('/models/fusion') },
{ id: 'p-playground', group: 'pages', label: t('nav.playground'), keywords: 'playground test chat try', icon: SquareTerminal, run: go('/playground') },
{ id: 'p-keys', group: 'pages', label: t('nav.keys'), keywords: 'keys providers api tokens', icon: KeyRound, run: go('/keys') },
+ { id: 'p-agents', group: 'pages', label: t('nav.agents'), keywords: 'agents claude codex cline ollama gemini', icon: Bot, run: go('/agents') },
{ id: 'p-analytics', group: 'pages', label: t('nav.analytics'), keywords: 'analytics usage stats savings latency', icon: ChartColumn, run: go('/analytics') },
{ id: 'p-premium', group: 'pages', label: t('nav.premium'), keywords: 'premium catalog license subscription', icon: Sparkles, run: go('/premium') },
]
diff --git a/client/src/components/keys/agent-compatibility-section.tsx b/client/src/components/keys/agent-compatibility-section.tsx
new file mode 100644
index 00000000..551ac91a
--- /dev/null
+++ b/client/src/components/keys/agent-compatibility-section.tsx
@@ -0,0 +1,233 @@
+import { useState } from 'react'
+import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
+import { apiFetch } from '@/lib/api'
+import { useI18n } from '@/i18n'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
+import { Switch } from '@/components/ui/switch'
+import { CopyButton } from '@/components/copy-button'
+
+type GeminiFamily = 'default' | 'pro' | 'flash' | 'flashLite'
+type GeminiMap = Record<GeminiFamily, string>
+type OllamaMode = 'off' | 'open-loopback' | 'key-required'
+
+interface Compatibility {
+ ollamaEmulation: OllamaMode
+ exposeClaudeDiscoveryAliases: boolean
+}
+
+interface MappableModel {
+ modelId: string
+ displayName: string
+ enabled: boolean
+}
+
+interface UrlToken {
+ id: number
+ label: string
+ tokenPrefix: string
+ createdAt: string
+ lastUsedAt: string | null
+ revokedAt: string | null
+ token?: string
+}
+
+const families: Array<{ key: GeminiFamily; labelKey: string }> = [
+ { key: 'default', labelKey: 'keys.familyDefault' },
+ { key: 'pro', labelKey: 'keys.familyGeminiPro' },
+ { key: 'flash', labelKey: 'keys.familyGeminiFlash' },
+ { key: 'flashLite', labelKey: 'keys.familyGeminiFlashLite' },
+]
+
+export function AgentCompatibilitySection() {
+ const { t } = useI18n()
+ const queryClient = useQueryClient()
+ const [tokenLabel, setTokenLabel] = useState('')
+ const [newToken, setNewToken] = useState<string | null>(null)
+ const { data: mapData } = useQuery<{ map: GeminiMap }>({
+ queryKey: ['gemini-map'],
+ queryFn: () => apiFetch('/api/settings/gemini-map'),
+ })
+ const { data: compatibility } = useQuery<Compatibility>({
+ queryKey: ['agent-compatibility'],
+ queryFn: () => apiFetch('/api/settings/agent-compatibility'),
+ })
+ const { data: models = [] } = useQuery<MappableModel[]>({
+ queryKey: ['fallback'],
+ queryFn: () => apiFetch('/api/fallback'),
+ })
+ const { data: tokenData } = useQuery<{ tokens: UrlToken[] }>({
+ queryKey: ['url-tokens'],
+ queryFn: () => apiFetch('/api/settings/url-tokens'),
+ })
+ const [mapDraft, setMapDraft] = useState<GeminiMap | null>(null)
+ const displayedMap = mapDraft ?? mapData?.map ?? null
+
+ const saveMap = useMutation({
+ mutationFn: (map: GeminiMap) => apiFetch('/api/settings/gemini-map', {
+ method: 'PUT',
+ body: JSON.stringify(map),
+ }),
+ onSuccess: () => {
+ setMapDraft(null)
+ queryClient.invalidateQueries({ queryKey: ['gemini-map'] })
+ },
+ })
+ const saveCompatibility = useMutation({
+ mutationFn: (patch: Partial<Compatibility>) => apiFetch('/api/settings/agent-compatibility', {
+ method: 'PUT',
+ body: JSON.stringify(patch),
+ }),
+ onSuccess: () => queryClient.invalidateQueries({ queryKey: ['agent-compatibility'] }),
+ })
+ const createToken = useMutation({
+ mutationFn: () => apiFetch<UrlToken>('/api/settings/url-tokens', {
+ method: 'POST',
+ body: JSON.stringify({ label: tokenLabel }),
+ }),
+ onSuccess: token => {
+ setNewToken(token.token ?? null)
+ setTokenLabel('')
+ queryClient.invalidateQueries({ queryKey: ['url-tokens'] })
+ },
+ })
+ const revokeToken = useMutation({
+ mutationFn: (id: number) => apiFetch<void>(`/api/settings/url-tokens/${id}`, {
+ method: 'DELETE',
+ }),
+ onSuccess: () => queryClient.invalidateQueries({ queryKey: ['url-tokens'] }),
+ })
+ const options = Array.from(new Map(
+ models.filter(model => model.enabled).map(model => [model.modelId, model]),
+ ).values()).sort((a, b) => a.displayName.localeCompare(b.displayName))
+ const mapDirty = !!mapDraft && !!mapData
+ && JSON.stringify(mapDraft) !== JSON.stringify(mapData.map)
+
+ return (
+ <div className="space-y-6">
+ <section className="rounded-3xl border bg-card p-5">
+ <div className="mb-4 flex items-start justify-between gap-4">
+ <div>
+ <h2 className="text-sm font-medium">{t('keys.geminiTitle')}</h2>
+ <p className="mt-0.5 max-w-prose text-xs text-muted-foreground">{t('keys.geminiDesc')}</p>
+ </div>
+ <Button
+ size="sm"
+ disabled={!mapDirty || saveMap.isPending}
+ onClick={() => mapDraft && saveMap.mutate(mapDraft)}
+ >
+ {t('common.save')}
+ </Button>
+ </div>
+ <div className="space-y-2">
+ {families.map(family => (
+ <div key={family.key} className="flex items-center gap-3">
+ <span className="w-40 shrink-0 text-xs font-medium">{t(family.labelKey)}</span>
+ <Select
+ value={displayedMap?.[family.key] ?? 'auto'}
+ onValueChange={value => setMapDraft(current =>
+ ({ ...(current ?? displayedMap ?? {
+ default: 'auto',
+ pro: 'auto',
+ flash: 'auto',
+ flashLite: 'auto',
+ }), [family.key]: value }))}
+ >
+ <SelectTrigger className="w-[320px] max-w-full"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="auto">{t('keys.anthropicAuto')}</SelectItem>
+ {options.map(model => (
+ <SelectItem key={model.modelId} value={model.modelId}>{model.displayName}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ ))}
+ </div>
+ </section>
+
+ <section className="rounded-3xl border bg-card p-5">
+ <h2 className="text-sm font-medium">{t('keys.compatibilityTitle')}</h2>
+ <p className="mt-0.5 mb-4 max-w-prose text-xs text-muted-foreground">{t('keys.compatibilityDesc')}</p>
+ <div className="space-y-4">
+ <div className="flex items-center justify-between gap-4">
+ <div>
+ <p className="text-xs font-medium">{t('keys.ollamaMode')}</p>
+ <p className="text-xs text-muted-foreground">{t('keys.ollamaModeHint')}</p>
+ </div>
+ <Select
+ value={compatibility?.ollamaEmulation ?? 'off'}
+ onValueChange={value => saveCompatibility.mutate({ ollamaEmulation: value as OllamaMode })}
+ >
+ <SelectTrigger className="w-44"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="off">{t('keys.ollamaOff')}</SelectItem>
+ <SelectItem value="open-loopback">{t('keys.ollamaLoopback')}</SelectItem>
+ <SelectItem value="key-required">{t('keys.ollamaKeyRequired')}</SelectItem>
+ </SelectContent>
+ </Select>
+ </div>
+ <div className="flex items-center justify-between gap-4">
+ <div>
+ <p className="text-xs font-medium">{t('keys.claudeAliases')}</p>
+ <p className="text-xs text-muted-foreground">{t('keys.claudeAliasesHint')}</p>
+ </div>
+ <Switch
+ checked={compatibility?.exposeClaudeDiscoveryAliases ?? false}
+ onCheckedChange={checked =>
+ saveCompatibility.mutate({ exposeClaudeDiscoveryAliases: checked })}
+ />
+ </div>
+ </div>
+ </section>
+
+ <section className="rounded-3xl border bg-card p-5">
+ <h2 className="text-sm font-medium">{t('keys.urlTokensTitle')}</h2>
+ <p className="mt-0.5 max-w-prose text-xs text-muted-foreground">{t('keys.urlTokensDesc')}</p>
+ <div className="my-4 flex gap-2">
+ <Input
+ value={tokenLabel}
+ onChange={event => setTokenLabel(event.target.value)}
+ placeholder={t('keys.urlTokenLabel')}
+ className="max-w-xs"
+ />
+ <Button size="sm" onClick={() => createToken.mutate()} disabled={createToken.isPending}>
+ {t('keys.createUrlToken')}
+ </Button>
+ </div>
+ {newToken && (
+ <div className="mb-4 rounded-xl border border-amber-500/30 bg-amber-500/5 p-3">
+ <p className="mb-2 text-xs text-muted-foreground">{t('keys.urlTokenOnce')}</p>
+ <div className="flex items-center gap-2">
+ <code className="min-w-0 flex-1 break-all font-mono text-xs">{newToken}</code>
+ <CopyButton text={newToken} className="size-7 shrink-0" label={t('common.copy')} />
+ </div>
+ </div>
+ )}
+ <div className="space-y-2">
+ {(tokenData?.tokens ?? []).map(token => (
+ <div key={token.id} className="flex items-center justify-between gap-3 rounded-xl bg-muted/40 px-3 py-2">
+ <div>
+ <p className="text-xs font-medium">{token.label || token.tokenPrefix}</p>
+ <p className="font-mono text-[11px] text-muted-foreground">{token.tokenPrefix}</p>
+ </div>
+ {token.revokedAt ? (
+ <span className="text-xs text-muted-foreground">{t('keys.revoked')}</span>
+ ) : (
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={revokeToken.isPending}
+ onClick={() => revokeToken.mutate(token.id)}
+ >
+ {t('keys.revoke')}
+ </Button>
+ )}
+ </div>
+ ))}
+ </div>
+ </section>
+ </div>
+ )
+}
diff --git a/client/src/data/agent-tools.json b/client/src/data/agent-tools.json
new file mode 100644
index 00000000..c035b0ec
--- /dev/null
+++ b/client/src/data/agent-tools.json
@@ -0,0 +1,15 @@
+[
+ {"id":"claude","name":"Claude Code","category":"code","configType":"file","protocol":"Anthropic Messages","baseUrlSupport":"root","command":"setup-claude","docsUrl":"https://docs.anthropic.com/en/docs/claude-code"},
+ {"id":"codex","name":"Codex CLI","category":"code","configType":"file","protocol":"OpenAI Responses","baseUrlSupport":"/v1","command":"setup-codex","docsUrl":"https://developers.openai.com/codex"},
+ {"id":"cline","name":"Cline","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-cline","docsUrl":"https://docs.cline.bot"},
+ {"id":"continue","name":"Continue","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-continue","docsUrl":"https://docs.continue.dev"},
+ {"id":"aider","name":"Aider","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-aider","docsUrl":"https://aider.chat/docs"},
+ {"id":"opencode","name":"OpenCode","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-opencode","docsUrl":"https://opencode.ai/docs"},
+ {"id":"goose","name":"Goose","category":"agent","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-goose","docsUrl":"https://block.github.io/goose"},
+ {"id":"qwen","name":"Qwen Code","category":"code","configType":"file","protocol":"OpenAI or Gemini","baseUrlSupport":"/v1","command":"setup-qwen","docsUrl":"https://qwenlm.github.io/qwen-code-docs"},
+ {"id":"roo","name":"Roo Code","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-roo","docsUrl":"https://docs.roocode.com"},
+ {"id":"kilo","name":"Kilo Code","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-kilo","docsUrl":"https://kilocode.ai/docs"},
+ {"id":"crush","name":"Crush","category":"code","configType":"file","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-crush","docsUrl":"https://github.com/charmbracelet/crush"},
+ {"id":"cursor","name":"Cursor","category":"code","configType":"guide","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-cursor","docsUrl":"https://docs.cursor.com"},
+ {"id":"generic","name":"Generic OpenAI client","category":"agent","configType":"guide","protocol":"OpenAI Chat","baseUrlSupport":"/v1","command":"setup-generic","docsUrl":"https://github.com/tashfeenahmed/freellmapi"}
+]
diff --git a/client/src/i18n/locales/am.json b/client/src/i18n/locales/am.json
index 098e7dc3..9d9dd564 100644
--- a/client/src/i18n/locales/am.json
+++ b/client/src/i18n/locales/am.json
@@ -13,7 +13,8 @@
"switchDark": "ወደ ጨለማ ገጽታ ቀይር",
"switchToChinese": "ወደ ቻይንኛ ቀይር",
"switchToEnglish": "ወደ እንግሊዝኛ ቀይር",
- "modelsMenu": "የሞዴል አይነቶችን ያስሱ"
+ "modelsMenu": "የሞዴል አይነቶችን ያስሱ",
+ "agents": "ወኪሎች"
},
"auth": {
"createYourAccount": "መለያዎን ይፍጠሩ",
@@ -375,7 +376,29 @@
"quotaLimit": "ገደብ",
"quotaRemaining": "የቀረው",
"quotaReset": "ዳግም አስጀምር",
- "quotaObserved": "ተስተውሏል"
+ "quotaObserved": "ተስተውሏል",
+ "tabAgents": "ወኪሎች",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "የGemini ሞዴል ማዛመድ",
+ "geminiDesc": "የGemini Pro፣ Flash እና Flash-Lite ስሞችን ወደ Auto ወይም ወደ ተወሰነ የካታሎግ ሞዴል ያዛምዱ።",
+ "compatibilityTitle": "የወኪል ተኳሃኝነት",
+ "compatibilityDesc": "በምርጫ የሚነቁ የተኳሃኝነት ገጽታዎችን እና የClaude Code ሞዴል ፍለጋን ይቆጣጠሩ።",
+ "ollamaMode": "የOllama ማስመሰል",
+ "ollamaModeHint": "በloopback ላይ ክፍት የሆነው ሁነታ ያልተረጋገጠ የLAN ትራፊክን በጭራሽ አይቀበልም።",
+ "ollamaOff": "ጠፍቷል",
+ "ollamaLoopback": "በloopback ላይ ክፍት",
+ "ollamaKeyRequired": "የAPI ቁልፍ ያስፈልጋል",
+ "claudeAliases": "የClaude Code ፍለጋ ተለዋጭ ስሞች",
+ "claudeAliasesHint": "የጌትዌዩ ሞዴል መራጭ ካታሎጉን መዘርዘር እንዲችል የclaude/<model> ተለዋጭ ስሞችን ይክፈቱ።",
+ "urlTokensTitle": "ሊሻሩ የሚችሉ የURL ቶከኖች",
+ "urlTokensDesc": "ራስጌ ለሌላቸው ደንበኞች ብቻ። የURL ቶከኖች ወደ ታሪክ እና ምዝግብ ማስታወሻዎች ሊፈሱ ይችላሉ፣ ስለዚህ በማያስፈልጉበት ጊዜ ይሽሯቸው።",
+ "urlTokenLabel": "የቶከን መለያ",
+ "createUrlToken": "ቶከን ፍጠር",
+ "urlTokenOnce": "ይህን ቶከን አሁን ይቅዱ። ዳግም አይታይም።",
+ "revoked": "ተሽሯል",
+ "revoke": "ሻር"
},
"status": {
"healthy": "ጤናማ",
@@ -454,7 +477,8 @@
"keyOrdinal": "ቁልፍ #{n}",
"attemptTimingHint": "ከጥያቄ ጅምር ማካካሻ ጀምር · የሙከራ ጊዜ",
"requestedModel": "የተጠየቀው ሞዴል",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "ጥያቄዎች በወኪል"
},
"playground": {
"title": "የመጫወቻ ሜዳ",
@@ -674,5 +698,15 @@
"url": "የሚሰራ URL ያስገቡ http:// ወይንም https://",
"email": "ትክክለኛ ኢሜል ያስገቡ",
"passwordMin": "ቢያንስ {min} ቁምፊዎች"
+ },
+ "agents": {
+ "title": "የኮድ አጻጻፍ ወኪሎች",
+ "description": "የኮድ አጻጻፍ መሣሪያዎችን በተፈጠረ እና ምትኬን በሚጠብቅ ውቅር ወደ አንድ የነፃ ሞዴል ጌትዌይ ያገናኙ።",
+ "apiKey": "የAPI ቁልፍ",
+ "quickstart": "ፈጣኑ መንገድ፦ Claude Codeን ከቀጥታ ካታሎግ ያዋቅሩ።",
+ "currentKey": "አሁናዊ የተዋሃደ ቁልፍ፦",
+ "seenRecently": "በቅርቡ ታይቷል",
+ "endpoint": "የመዳረሻ ነጥብ",
+ "documentation": "ሰነዶች"
}
}
diff --git a/client/src/i18n/locales/ar.json b/client/src/i18n/locales/ar.json
index d6a08f2d..d0ff2f55 100644
--- a/client/src/i18n/locales/ar.json
+++ b/client/src/i18n/locales/ar.json
@@ -13,7 +13,8 @@
"switchDark": "التبديل إلى المظهر الداكن",
"switchToChinese": "التبديل إلى الصينية",
"switchToEnglish": "التبديل إلى اللغة الإنجليزية",
- "modelsMenu": "تصفح أنواع النماذج"
+ "modelsMenu": "تصفح أنواع النماذج",
+ "agents": "الوكلاء"
},
"auth": {
"createYourAccount": "أنشئ حسابك",
@@ -375,7 +376,29 @@
"quotaLimit": "الحد",
"quotaRemaining": "المتبقي",
"quotaReset": "إعادة تعيين",
- "quotaObserved": "لوحظ"
+ "quotaObserved": "لوحظ",
+ "tabAgents": "الوكلاء",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "تعيين نماذج Gemini",
+ "geminiDesc": "عيّن أسماء Gemini Pro وFlash وFlash-Lite إلى Auto أو إلى نموذج محدد من الكتالوج.",
+ "compatibilityTitle": "توافق الوكلاء",
+ "compatibilityDesc": "تحكم في واجهات التوافق الاختيارية واكتشاف نماذج Claude Code.",
+ "ollamaMode": "محاكاة Ollama",
+ "ollamaModeHint": "الوضع المفتوح على loopback لا يقبل أبدًا حركة مرور LAN غير مصادق عليها.",
+ "ollamaOff": "إيقاف",
+ "ollamaLoopback": "مفتوح على loopback",
+ "ollamaKeyRequired": "مفتاح API مطلوب",
+ "claudeAliases": "أسماء بديلة لاكتشاف Claude Code",
+ "claudeAliasesHint": "اعرض أسماء بديلة بصيغة claude/<model> ليتمكن منتقي النماذج في البوابة من عرض الكتالوج.",
+ "urlTokensTitle": "رموز URL قابلة للإلغاء",
+ "urlTokensDesc": "للعملاء بدون ترويسات فقط. قد تتسرب رموز URL إلى المحفوظات والسجلات، لذا ألغِها عندما لا تعود هناك حاجة إليها.",
+ "urlTokenLabel": "تسمية الرمز",
+ "createUrlToken": "إنشاء رمز",
+ "urlTokenOnce": "انسخ هذا الرمز الآن. لن يتم عرضه مرة أخرى.",
+ "revoked": "مُلغى",
+ "revoke": "إلغاء"
},
"status": {
"healthy": "صحي",
@@ -454,7 +477,8 @@
"keyOrdinal": "المفتاح #{n}",
"attemptTimingHint": "بداية الإزاحة من بداية الطلب · مدة المحاولة",
"requestedModel": "النموذج المطلوب",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "الطلبات حسب الوكيل"
},
"playground": {
"title": "ملعب",
@@ -674,5 +698,15 @@
"url": "أدخل URL صالحًا يبدأ بـ http:// أو https://",
"email": "أدخل عنوان بريد إلكتروني صالحًا",
"passwordMin": "أحرف {min} على الأقل"
+ },
+ "agents": {
+ "title": "وكلاء البرمجة",
+ "description": "اربط أدوات البرمجة ببوابة واحدة للنماذج المجانية مع تكوين مُنشأ تلقائيًا وآمن للنسخ الاحتياطي.",
+ "apiKey": "مفتاح API",
+ "quickstart": "أسرع طريقة: قم بتكوين Claude Code من الكتالوج المباشر.",
+ "currentKey": "المفتاح الموحد الحالي:",
+ "seenRecently": "شوهد مؤخرًا",
+ "endpoint": "نقطة النهاية",
+ "documentation": "التوثيق"
}
}
diff --git a/client/src/i18n/locales/az.json b/client/src/i18n/locales/az.json
index 45e9f4db..d089517e 100644
--- a/client/src/i18n/locales/az.json
+++ b/client/src/i18n/locales/az.json
@@ -13,7 +13,8 @@
"switchDark": "Qaranlıq mövzuya keçid",
"switchToChinese": "Çin dilinə keçid",
"switchToEnglish": "İngiliscəyə keçid",
- "modelsMenu": "Model tiplərinə baxın"
+ "modelsMenu": "Model tiplərinə baxın",
+ "agents": "Agentlər"
},
"auth": {
"createYourAccount": "Hesabınızı yaradın",
@@ -375,7 +376,29 @@
"quotaLimit": "Limit",
"quotaRemaining": "Qalanlar",
"quotaReset": "Reset",
- "quotaObserved": "Müşahidə olunanlar"
+ "quotaObserved": "Müşahidə olunanlar",
+ "tabAgents": "Agentlər",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini model uyğunlaşdırması",
+ "geminiDesc": "Gemini Pro, Flash və Flash-Lite adlarını Auto-ya və ya konkret kataloq modelinə uyğunlaşdırın.",
+ "compatibilityTitle": "Agent uyğunluğu",
+ "compatibilityDesc": "Könüllü uyğunluq interfeyslərini və Claude Code model aşkarlamasını idarə edin.",
+ "ollamaMode": "Ollama emulyasiyası",
+ "ollamaModeHint": "Açıq loopback heç vaxt autentifikasiya olunmamış LAN trafikini qəbul etmir.",
+ "ollamaOff": "Söndürülüb",
+ "ollamaLoopback": "Loopback-də açıq",
+ "ollamaKeyRequired": "API açarı tələb olunur",
+ "claudeAliases": "Claude Code aşkarlama aliasları",
+ "claudeAliasesHint": "Şlüzün model seçicisi kataloqu göstərə bilsin deyə claude/<model> aliaslarını açın.",
+ "urlTokensTitle": "Ləğv edilə bilən URL tokenləri",
+ "urlTokensDesc": "Yalnız başlıqsız müştərilər üçün. URL tokenləri tarixçəyə və loqlara sıza bilər, ona görə də artıq lazım olmadıqda onları ləğv edin.",
+ "urlTokenLabel": "Token etiketi",
+ "createUrlToken": "Token yarat",
+ "urlTokenOnce": "Bu tokeni indi kopyalayın. O, bir daha göstərilməyəcək.",
+ "revoked": "Ləğv edilib",
+ "revoke": "Ləğv et"
},
"status": {
"healthy": "sağlam",
@@ -454,7 +477,8 @@
"keyOrdinal": "Əsas #{n}",
"attemptTimingHint": "Sorğu başlanğıcından ofset · Cəhd müddəti",
"requestedModel": "Tələb olunan model",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Agent üzrə sorğular"
},
"playground": {
"title": "Uşaq meydançası",
@@ -674,5 +698,15 @@
"url": "http:// və ya https:// ilə başlayan etibarlı URL daxil edin",
"email": "Etibarlı e-poçt ünvanı daxil edin",
"passwordMin": "Ən azı {min} personaj"
+ },
+ "agents": {
+ "title": "Kodlaşdırma agentləri",
+ "description": "Kodlaşdırma alətlərini generasiya olunmuş, ehtiyat nüsxə üçün təhlükəsiz konfiqurasiya ilə vahid pulsuz model şlüzünə qoşun.",
+ "apiKey": "API açarı",
+ "quickstart": "Ən sürətli yol: Claude Code-u canlı kataloqdan konfiqurasiya edin.",
+ "currentKey": "Cari vahid açar:",
+ "seenRecently": "Bu yaxınlarda görülüb",
+ "endpoint": "Endpoint",
+ "documentation": "Sənədlər"
}
}
diff --git a/client/src/i18n/locales/bg.json b/client/src/i18n/locales/bg.json
index 5b93952a..1ec21c84 100644
--- a/client/src/i18n/locales/bg.json
+++ b/client/src/i18n/locales/bg.json
@@ -13,7 +13,8 @@
"switchDark": "Премини към тъмна тема",
"switchToChinese": "Преход към китайски",
"switchToEnglish": "Преход към английски",
- "modelsMenu": "Видове модели за разглеждане"
+ "modelsMenu": "Видове модели за разглеждане",
+ "agents": "Агенти"
},
"auth": {
"createYourAccount": "Създайте свой акаунт",
@@ -375,7 +376,29 @@
"quotaLimit": "Граница",
"quotaRemaining": "Останали",
"quotaReset": "Нулиране",
- "quotaObserved": "Наблюдавано"
+ "quotaObserved": "Наблюдавано",
+ "tabAgents": "Агенти",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Съответствие на Gemini модели",
+ "geminiDesc": "Съпоставете имената Gemini Pro, Flash и Flash-Lite с Auto или с конкретен модел от каталога.",
+ "compatibilityTitle": "Съвместимост с агенти",
+ "compatibilityDesc": "Управлявайте незадължителните повърхности за съвместимост и откриването на модели от Claude Code.",
+ "ollamaMode": "Ollama емулация",
+ "ollamaModeHint": "Отвореният loopback никога не приема неавтентикиран LAN трафик.",
+ "ollamaOff": "Изключено",
+ "ollamaLoopback": "Отворено на loopback",
+ "ollamaKeyRequired": "Изисква се API ключ",
+ "claudeAliases": "Псевдоними за откриване на Claude Code",
+ "claudeAliasesHint": "Изложете псевдоними claude/<model>, за да може селекторът на модели на шлюза да покаже каталога.",
+ "urlTokensTitle": "Отменяеми URL токени",
+ "urlTokensDesc": "Само за клиенти без хедъри. URL токените могат да изтекат в историята и логовете, затова ги отменяйте, когато вече не са нужни.",
+ "urlTokenLabel": "Етикет на токена",
+ "createUrlToken": "Създай токен",
+ "urlTokenOnce": "Копирайте този токен сега. Той няма да бъде показан отново.",
+ "revoked": "Отменен",
+ "revoke": "Отмени"
},
"status": {
"healthy": "здравословно",
@@ -454,7 +477,8 @@
"keyOrdinal": "Ключови #{n}",
"attemptTimingHint": "Изместване на старта от заявката за старт · Продължителност на опита",
"requestedModel": "Поискан модел",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Заявки по агент"
},
"playground": {
"title": "Детска площадка",
@@ -674,5 +698,15 @@
"url": "Въведете валиден URL, започващ с http:// или https://",
"email": "Въведете валиден имейл адрес",
"passwordMin": "Поне {min} герои"
+ },
+ "agents": {
+ "title": "Агенти за програмиране",
+ "description": "Свържете инструменти за програмиране към един шлюз за безплатни модели с генерирана конфигурация и безопасно архивиране.",
+ "apiKey": "API ключ",
+ "quickstart": "Най-бързият път: конфигурирайте Claude Code от каталога на живо.",
+ "currentKey": "Текущ унифициран ключ:",
+ "seenRecently": "Видян наскоро",
+ "endpoint": "Крайна точка",
+ "documentation": "Документация"
}
}
diff --git a/client/src/i18n/locales/bn.json b/client/src/i18n/locales/bn.json
index 9cc69d0a..9dc7f093 100644
--- a/client/src/i18n/locales/bn.json
+++ b/client/src/i18n/locales/bn.json
@@ -13,7 +13,8 @@
"switchDark": "অন্ধকার থিমে স্যুইচ করুন",
"switchToChinese": "চাইনিজ এ স্যুইচ করুন",
"switchToEnglish": "ইংরেজিতে স্যুইচ করুন",
- "modelsMenu": "মডেলের ধরন ব্রাউজ করুন"
+ "modelsMenu": "মডেলের ধরন ব্রাউজ করুন",
+ "agents": "এজেন্ট"
},
"auth": {
"createYourAccount": "আপনার অ্যাকাউন্ট তৈরি করুন",
@@ -375,7 +376,29 @@
"quotaLimit": "সীমা",
"quotaRemaining": "অবশিষ্ট",
"quotaReset": "রিসেট করুন",
- "quotaObserved": "পর্যবেক্ষণ করা হয়েছে"
+ "quotaObserved": "পর্যবেক্ষণ করা হয়েছে",
+ "tabAgents": "এজেন্ট",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini মডেল ম্যাপিং",
+ "geminiDesc": "Gemini Pro, Flash এবং Flash-Lite নামগুলি Auto বা ক্যাটালগের একটি নির্দিষ্ট মডেলে ম্যাপ করুন।",
+ "compatibilityTitle": "এজেন্ট সামঞ্জস্য",
+ "compatibilityDesc": "ঐচ্ছিক সামঞ্জস্য পৃষ্ঠতল এবং Claude Code মডেল আবিষ্কার নিয়ন্ত্রণ করুন।",
+ "ollamaMode": "Ollama এমুলেশন",
+ "ollamaModeHint": "লুপব্যাকে খোলা মোড কখনও প্রমাণীকরণবিহীন LAN ট্র্যাফিক গ্রহণ করে না।",
+ "ollamaOff": "বন্ধ",
+ "ollamaLoopback": "লুপব্যাকে খোলা",
+ "ollamaKeyRequired": "API কী প্রয়োজন",
+ "claudeAliases": "Claude Code আবিষ্কারের অ্যালিয়াস",
+ "claudeAliasesHint": "গেটওয়ের মডেল নির্বাচক যাতে ক্যাটালগ তালিকাভুক্ত করতে পারে সেজন্য claude/<model> অ্যালিয়াস উন্মুক্ত করুন।",
+ "urlTokensTitle": "প্রত্যাহারযোগ্য URL টোকেন",
+ "urlTokensDesc": "শুধুমাত্র হেডারবিহীন ক্লায়েন্টদের জন্য। URL টোকেন ইতিহাস এবং লগে ফাঁস হতে পারে, তাই আর প্রয়োজন না হলে সেগুলি প্রত্যাহার করুন।",
+ "urlTokenLabel": "টোকেন লেবেল",
+ "createUrlToken": "টোকেন তৈরি করুন",
+ "urlTokenOnce": "এই টোকেনটি এখনই কপি করুন। এটি আর দেখানো হবে না।",
+ "revoked": "প্রত্যাহার করা হয়েছে",
+ "revoke": "প্রত্যাহার করুন"
},
"status": {
"healthy": "সুস্থ",
@@ -454,7 +477,8 @@
"keyOrdinal": "কী #{n}",
"attemptTimingHint": "অনুরোধ শুরু থেকে অফসেট শুরু করুন · প্রচেষ্টার সময়কাল",
"requestedModel": "অনুরোধ করা মডেল",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "এজেন্ট অনুযায়ী অনুরোধ"
},
"playground": {
"title": "খেলার মাঠ",
@@ -674,5 +698,15 @@
"url": "http:// বা https:// দিয়ে শুরু করে একটি বৈধ URL লিখুন",
"email": "একটি বৈধ ইমেল ঠিকানা লিখুন",
"passwordMin": "অন্তত {min} অক্ষর"
+ },
+ "agents": {
+ "title": "কোডিং এজেন্ট",
+ "description": "জেনারেট করা, ব্যাকআপ-নিরাপদ কনফিগারেশন সহ কোডিং টুলগুলিকে একটি ফ্রি-মডেল গেটওয়েতে সংযুক্ত করুন।",
+ "apiKey": "API কী",
+ "quickstart": "দ্রুততম পথ: লাইভ ক্যাটালগ থেকে Claude Code কনফিগার করুন।",
+ "currentKey": "বর্তমান একীভূত কী:",
+ "seenRecently": "সম্প্রতি দেখা গেছে",
+ "endpoint": "এন্ডপয়েন্ট",
+ "documentation": "ডকুমেন্টেশন"
}
}
diff --git a/client/src/i18n/locales/cs.json b/client/src/i18n/locales/cs.json
index 808e6817..328f1b6c 100644
--- a/client/src/i18n/locales/cs.json
+++ b/client/src/i18n/locales/cs.json
@@ -13,7 +13,8 @@
"switchDark": "Přepnout na temné téma",
"switchToChinese": "Přechod na čínštinu",
"switchToEnglish": "Přechod na angličtinu",
- "modelsMenu": "Procházet typy modelů"
+ "modelsMenu": "Procházet typy modelů",
+ "agents": "Agenti"
},
"auth": {
"createYourAccount": "Vytvořte si účet",
@@ -375,7 +376,29 @@
"quotaLimit": "Limit",
"quotaRemaining": "Zbývající",
"quotaReset": "Reset",
- "quotaObserved": "Pozorováno"
+ "quotaObserved": "Pozorováno",
+ "tabAgents": "Agenti",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Mapování modelů Gemini",
+ "geminiDesc": "Namapujte názvy Gemini Pro, Flash a Flash-Lite na Auto nebo konkrétní model z katalogu.",
+ "compatibilityTitle": "Kompatibilita agentů",
+ "compatibilityDesc": "Ovládejte volitelné vrstvy kompatibility a zjišťování modelů pro Claude Code.",
+ "ollamaMode": "Emulace Ollama",
+ "ollamaModeHint": "Otevřený loopback nikdy nepřijímá neověřený provoz z LAN.",
+ "ollamaOff": "Vypnuto",
+ "ollamaLoopback": "Otevřeno na loopbacku",
+ "ollamaKeyRequired": "Vyžadován API klíč",
+ "claudeAliases": "Aliasy zjišťování pro Claude Code",
+ "claudeAliasesHint": "Zpřístupněte aliasy claude/<model>, aby výběr modelů brány mohl vypsat katalog.",
+ "urlTokensTitle": "Odvolatelné URL tokeny",
+ "urlTokensDesc": "Pouze pro klienty bez hlaviček. URL tokeny mohou uniknout do historie a logů, proto je odvolejte, jakmile je nepotřebujete.",
+ "urlTokenLabel": "Popisek tokenu",
+ "createUrlToken": "Vytvořit token",
+ "urlTokenOnce": "Zkopírujte tento token nyní. Znovu se již nezobrazí.",
+ "revoked": "Odvoláno",
+ "revoke": "Odvolat"
},
"status": {
"healthy": "zdravé",
@@ -454,7 +477,8 @@
"keyOrdinal": "Klíčové #{n}",
"attemptTimingHint": "Začít offset od začátku požadavku · Doba trvání pokusu",
"requestedModel": "Požadovaný model",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Požadavky podle agenta"
},
"playground": {
"title": "Hřiště",
@@ -674,5 +698,15 @@
"url": "Zadejte platný URL začínající na http:// nebo https://",
"email": "Zadejte platnou e-mailovou adresu",
"passwordMin": "Alespoň {min} postavy"
+ },
+ "agents": {
+ "title": "Agenti pro kódování",
+ "description": "Připojte kódovací nástroje k jedné bráně bezplatných modelů s generovanou konfigurací a bezpečným zálohováním.",
+ "apiKey": "API klíč",
+ "quickstart": "Nejrychlejší cesta: nakonfigurujte Claude Code z živého katalogu.",
+ "currentKey": "Aktuální jednotný klíč:",
+ "seenRecently": "Nedávno aktivní",
+ "endpoint": "Endpoint",
+ "documentation": "Dokumentace"
}
}
diff --git a/client/src/i18n/locales/da.json b/client/src/i18n/locales/da.json
index 39b5894d..33c32dff 100644
--- a/client/src/i18n/locales/da.json
+++ b/client/src/i18n/locales/da.json
@@ -13,7 +13,8 @@
"switchDark": "Skift til mørkt tema",
"switchToChinese": "Skift til kinesisk",
"switchToEnglish": "Skift til engelsk",
- "modelsMenu": "Gennemse modeltyper"
+ "modelsMenu": "Gennemse modeltyper",
+ "agents": "Agenter"
},
"auth": {
"createYourAccount": "Opret din konto",
@@ -375,7 +376,29 @@
"quotaLimit": "Grænse",
"quotaRemaining": "Resterende",
"quotaReset": "Nulstil",
- "quotaObserved": "Observeret"
+ "quotaObserved": "Observeret",
+ "tabAgents": "Agenter",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini-modelmapping",
+ "geminiDesc": "Map Gemini Pro-, Flash- og Flash-Lite-navne til Auto eller en bestemt katalogmodel.",
+ "compatibilityTitle": "Agentkompatibilitet",
+ "compatibilityDesc": "Styr tilvalgte kompatibilitetsflader og Claude Codes modelopdagelse.",
+ "ollamaMode": "Ollama-emulering",
+ "ollamaModeHint": "Åben loopback accepterer aldrig uautentificeret LAN-trafik.",
+ "ollamaOff": "Fra",
+ "ollamaLoopback": "Åben på loopback",
+ "ollamaKeyRequired": "API-nøgle påkrævet",
+ "claudeAliases": "Claude Code-opdagelsesaliasser",
+ "claudeAliasesHint": "Eksponér claude/<model>-aliasser, så gatewayens modelvælger kan vise kataloget.",
+ "urlTokensTitle": "Tilbagekaldelige URL-tokens",
+ "urlTokensDesc": "Kun til klienter uden headers. URL-tokens kan lække til historik og logs, så tilbagekald dem, når de ikke længere er nødvendige.",
+ "urlTokenLabel": "Token-etiket",
+ "createUrlToken": "Opret token",
+ "urlTokenOnce": "Kopiér dette token nu. Det vises ikke igen.",
+ "revoked": "Tilbagekaldt",
+ "revoke": "Tilbagekald"
},
"status": {
"healthy": "sundt",
@@ -454,7 +477,8 @@
"keyOrdinal": "Nøgle #{n}",
"attemptTimingHint": "Startforskydning fra anmodningsstart · Forsøgsvarighed",
"requestedModel": "Efterspurgt model",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Anmodninger pr. agent"
},
"playground": {
"title": "Legeplads",
@@ -674,5 +698,15 @@
"url": "Indtast en gyldig URL, der starter med http:// eller https://",
"email": "Indtast en gyldig e-mailadresse",
"passwordMin": "I det mindste {min} karakterer"
+ },
+ "agents": {
+ "title": "Kodningsagenter",
+ "description": "Forbind kodningsværktøjer til én gateway for gratis modeller med genereret, backup-sikker konfiguration.",
+ "apiKey": "API-nøgle",
+ "quickstart": "Hurtigste vej: konfigurér Claude Code fra live-kataloget.",
+ "currentKey": "Nuværende samlede nøgle:",
+ "seenRecently": "Set for nylig",
+ "endpoint": "Endpoint",
+ "documentation": "Dokumentation"
}
}
diff --git a/client/src/i18n/locales/de.json b/client/src/i18n/locales/de.json
index 068b66ed..ec324a5f 100644
--- a/client/src/i18n/locales/de.json
+++ b/client/src/i18n/locales/de.json
@@ -13,7 +13,8 @@
"switchDark": "Wechseln Sie zum dunklen Thema",
"switchToChinese": "Wechseln Sie zu Chinesisch",
"switchToEnglish": "Wechseln Sie zu Englisch",
- "modelsMenu": "Durchsuchen Sie Modelltypen"
+ "modelsMenu": "Durchsuchen Sie Modelltypen",
+ "agents": "Agenten"
},
"auth": {
"createYourAccount": "Erstellen Sie Ihr Konto",
@@ -375,7 +376,29 @@
"quotaLimit": "Begrenzen",
"quotaRemaining": "Übrig",
"quotaReset": "Zurücksetzen",
- "quotaObserved": "Beobachtet"
+ "quotaObserved": "Beobachtet",
+ "tabAgents": "Agenten",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini-Modell-Zuordnung",
+ "geminiDesc": "Ordnen Sie die Namen Gemini Pro, Flash und Flash-Lite Auto oder einem bestimmten Katalogmodell zu.",
+ "compatibilityTitle": "Agent-Kompatibilität",
+ "compatibilityDesc": "Steuern Sie optionale Kompatibilitätsschnittstellen und die Modellerkennung von Claude Code.",
+ "ollamaMode": "Ollama-Emulation",
+ "ollamaModeHint": "Open-Loopback akzeptiert niemals nicht authentifizierten LAN-Verkehr.",
+ "ollamaOff": "Aus",
+ "ollamaLoopback": "Offen auf Loopback",
+ "ollamaKeyRequired": "API-Schlüssel erforderlich",
+ "claudeAliases": "Claude-Code-Erkennungsaliase",
+ "claudeAliasesHint": "Stellen Sie claude/<model>-Aliase bereit, damit die Modellauswahl des Gateways den Katalog auflisten kann.",
+ "urlTokensTitle": "Widerrufbare URL-Tokens",
+ "urlTokensDesc": "Nur für Clients ohne Header. URL-Tokens können in Verlauf und Protokolle gelangen. Widerrufen Sie sie daher, wenn sie nicht mehr benötigt werden.",
+ "urlTokenLabel": "Token-Bezeichnung",
+ "createUrlToken": "Token erstellen",
+ "urlTokenOnce": "Kopieren Sie dieses Token jetzt. Es wird nicht erneut angezeigt.",
+ "revoked": "Widerrufen",
+ "revoke": "Widerrufen"
},
"status": {
"healthy": "gesund",
@@ -454,7 +477,8 @@
"keyOrdinal": "Schlüssel #{n}",
"attemptTimingHint": "Startoffset vom Anforderungsstart · Versuchsdauer",
"requestedModel": "Angefragtes Modell",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Anfragen nach Agent"
},
"playground": {
"title": "Spielplatz",
@@ -674,5 +698,15 @@
"url": "Geben Sie ein gültiges URL ein, beginnend mit http:// oder https://",
"email": "Geben Sie eine gültige E-Mail-Adresse ein",
"passwordMin": "Mindestens {min} Zeichen"
+ },
+ "agents": {
+ "title": "Coding-Agenten",
+ "description": "Verbinden Sie Coding-Tools mit einem einzigen Gateway für kostenlose Modelle – mit generierter, backupsicherer Konfiguration.",
+ "apiKey": "API-Schlüssel",
+ "quickstart": "Schnellster Weg: Konfigurieren Sie Claude Code aus dem Live-Katalog.",
+ "currentKey": "Aktueller einheitlicher Schlüssel:",
+ "seenRecently": "Kürzlich gesehen",
+ "endpoint": "Endpunkt",
+ "documentation": "Dokumentation"
}
}
diff --git a/client/src/i18n/locales/el.json b/client/src/i18n/locales/el.json
index 287e9a42..818639f2 100644
--- a/client/src/i18n/locales/el.json
+++ b/client/src/i18n/locales/el.json
@@ -13,7 +13,8 @@
"switchDark": "Μετάβαση σε σκούρο θέμα",
"switchToChinese": "Μετάβαση στα Κινέζικα",
"switchToEnglish": "Μετάβαση στα Αγγλικά",
- "modelsMenu": "Αναζήτηση τύπων μοντέλων"
+ "modelsMenu": "Αναζήτηση τύπων μοντέλων",
+ "agents": "Πράκτορες"
},
"auth": {
"createYourAccount": "Δημιουργήστε τον λογαριασμό σας",
@@ -375,7 +376,29 @@
"quotaLimit": "Όριο",
"quotaRemaining": "Υπόλοιπο",
"quotaReset": "Επαναφορά",
- "quotaObserved": "Παρατηρήθηκε"
+ "quotaObserved": "Παρατηρήθηκε",
+ "tabAgents": "Πράκτορες",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Αντιστοίχιση μοντέλων Gemini",
+ "geminiDesc": "Αντιστοιχίστε τα ονόματα Gemini Pro, Flash και Flash-Lite στο Auto ή σε συγκεκριμένο μοντέλο του καταλόγου.",
+ "compatibilityTitle": "Συμβατότητα πρακτόρων",
+ "compatibilityDesc": "Ελέγξτε τις προαιρετικές επιφάνειες συμβατότητας και την ανακάλυψη μοντέλων του Claude Code.",
+ "ollamaMode": "Εξομοίωση Ollama",
+ "ollamaModeHint": "Το ανοιχτό loopback δεν δέχεται ποτέ μη πιστοποιημένη κίνηση LAN.",
+ "ollamaOff": "Ανενεργό",
+ "ollamaLoopback": "Ανοιχτό στο loopback",
+ "ollamaKeyRequired": "Απαιτείται κλειδί API",
+ "claudeAliases": "Ψευδώνυμα ανακάλυψης Claude Code",
+ "claudeAliasesHint": "Εκθέστε ψευδώνυμα claude/<model> ώστε ο επιλογέας μοντέλων της πύλης να εμφανίζει τον κατάλογο.",
+ "urlTokensTitle": "Ανακλητά token URL",
+ "urlTokensDesc": "Μόνο για πελάτες χωρίς κεφαλίδες. Τα token URL μπορούν να διαρρεύσουν στο ιστορικό και στα αρχεία καταγραφής, γι' αυτό ανακαλέστε τα όταν δεν χρειάζονται πια.",
+ "urlTokenLabel": "Ετικέτα token",
+ "createUrlToken": "Δημιουργία token",
+ "urlTokenOnce": "Αντιγράψτε αυτό το token τώρα. Δεν θα εμφανιστεί ξανά.",
+ "revoked": "Ανακλήθηκε",
+ "revoke": "Ανάκληση"
},
"status": {
"healthy": "υγιής",
@@ -454,7 +477,8 @@
"keyOrdinal": "Βασικά #{n}",
"attemptTimingHint": "Μετατόπιση έναρξης από την έναρξη αιτήματος · Διάρκεια προσπάθειας",
"requestedModel": "Ζητούμενο μοντέλο",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Αιτήματα ανά πράκτορα"
},
"playground": {
"title": "Παιδική χαρά",
@@ -674,5 +698,15 @@
"url": "Εισαγάγετε μια έγκυρη URL ξεκινώντας με http:// ή https://",
"email": "Εισαγάγετε μια έγκυρη διεύθυνση email",
"passwordMin": "Τουλάχιστον {min} χαρακτήρες"
+ },
+ "agents": {
+ "title": "Πράκτορες προγραμματισμού",
+ "description": "Συνδέστε εργαλεία προγραμματισμού σε μία πύλη δωρεάν μοντέλων με παραγόμενη διαμόρφωση που προστατεύει τα αντίγραφα ασφαλείας.",
+ "apiKey": "Κλειδί API",
+ "quickstart": "Ο γρηγορότερος δρόμος: διαμορφώστε το Claude Code από τον ζωντανό κατάλογο.",
+ "currentKey": "Τρέχον ενοποιημένο κλειδί:",
+ "seenRecently": "Εμφανίστηκε πρόσφατα",
+ "endpoint": "Τελικό σημείο",
+ "documentation": "Τεκμηρίωση"
}
}
diff --git a/client/src/i18n/locales/en.json b/client/src/i18n/locales/en.json
index d35007ff..957934b5 100644
--- a/client/src/i18n/locales/en.json
+++ b/client/src/i18n/locales/en.json
@@ -3,6 +3,7 @@
"models": "Models",
"playground": "Playground",
"keys": "Keys",
+ "agents": "Agents",
"analytics": "Analytics",
"premium": "Premium",
"upgrade": "Upgrade",
@@ -234,6 +235,7 @@
"tabQuotaSignals": "Quota signals",
"tabApiKey": "Unified API key",
"tabAnthropic": "Anthropic",
+ "tabAgents": "Agents",
"unifiedKey": "Your unified API key",
"regenerate": "Regenerate",
"showKey": "Show",
@@ -259,6 +261,27 @@
"familyOpus": "Opus",
"familySonnet": "Sonnet",
"familyHaiku": "Haiku",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini model mapping",
+ "geminiDesc": "Map Gemini Pro, Flash, and Flash-Lite names to Auto or a specific catalog model.",
+ "compatibilityTitle": "Agent compatibility",
+ "compatibilityDesc": "Control opt-in compatibility surfaces and Claude Code model discovery.",
+ "ollamaMode": "Ollama emulation",
+ "ollamaModeHint": "Open-loopback never accepts unauthenticated LAN traffic.",
+ "ollamaOff": "Off",
+ "ollamaLoopback": "Open on loopback",
+ "ollamaKeyRequired": "API key required",
+ "claudeAliases": "Claude Code discovery aliases",
+ "claudeAliasesHint": "Expose claude/<model> aliases so the gateway model picker can list the catalog.",
+ "urlTokensTitle": "Revocable URL tokens",
+ "urlTokensDesc": "For headerless clients only. URL tokens can leak into history and logs, so revoke them when no longer needed.",
+ "urlTokenLabel": "Token label",
+ "createUrlToken": "Create token",
+ "urlTokenOnce": "Copy this token now. It will not be shown again.",
+ "revoked": "Revoked",
+ "revoke": "Revoke",
"selectPlatform": "Select a provider",
"addKey": "Add key",
"keyAdded": "Key added",
@@ -384,6 +407,16 @@
"error": "error",
"unchecked": "unchecked"
},
+ "agents": {
+ "title": "Coding agents",
+ "description": "Connect coding tools to one free-model gateway with generated, backup-safe configuration.",
+ "apiKey": "API key",
+ "quickstart": "Fastest path: configure Claude Code from the live catalog.",
+ "currentKey": "Current unified key:",
+ "seenRecently": "Seen recently",
+ "endpoint": "Endpoint",
+ "documentation": "Documentation"
+ },
"analytics": {
"title": "Analytics",
"description": "Request volume, latency, token usage, and failures.",
@@ -400,6 +433,7 @@
"avgTtft": "Avg TTFT",
"estSavings": "Est. savings",
"requestsByProvider": "Requests by provider",
+ "requestsByAgent": "Requests by agent",
"avgLatencyByProvider": "Avg latency by provider",
"ttftByProvider": "Time to first token by provider",
"ttftEmpty": "No time to first token recorded yet.",
diff --git a/client/src/i18n/locales/es.json b/client/src/i18n/locales/es.json
index f63c2d6b..e18cec42 100644
--- a/client/src/i18n/locales/es.json
+++ b/client/src/i18n/locales/es.json
@@ -13,7 +13,8 @@
"switchDark": "Cambiar al tema oscuro",
"switchToChinese": "Cambiar a chino",
"switchToEnglish": "Cambiar a inglés",
- "modelsMenu": "Explorar tipos de modelos"
+ "modelsMenu": "Explorar tipos de modelos",
+ "agents": "Agentes"
},
"auth": {
"createYourAccount": "Crea tu cuenta",
@@ -375,7 +376,29 @@
"quotaLimit": "Límite",
"quotaRemaining": "Restante",
"quotaReset": "Reinicio",
- "quotaObserved": "Observado"
+ "quotaObserved": "Observado",
+ "tabAgents": "Agentes",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Asignación de modelos Gemini",
+ "geminiDesc": "Asigna los nombres de Gemini Pro, Flash y Flash-Lite a Auto o a un modelo concreto del catálogo.",
+ "compatibilityTitle": "Compatibilidad de agentes",
+ "compatibilityDesc": "Controla las superficies de compatibilidad opcionales y la detección de modelos de Claude Code.",
+ "ollamaMode": "Emulación de Ollama",
+ "ollamaModeHint": "El modo abierto en loopback nunca acepta tráfico LAN sin autenticar.",
+ "ollamaOff": "Desactivado",
+ "ollamaLoopback": "Abierto en loopback",
+ "ollamaKeyRequired": "Se requiere clave de API",
+ "claudeAliases": "Alias de detección de Claude Code",
+ "claudeAliasesHint": "Expón alias claude/<model> para que el selector de modelos del gateway pueda listar el catálogo.",
+ "urlTokensTitle": "Tokens de URL revocables",
+ "urlTokensDesc": "Solo para clientes sin cabeceras. Los tokens de URL pueden filtrarse al historial y a los registros, así que revócalos cuando ya no los necesites.",
+ "urlTokenLabel": "Etiqueta del token",
+ "createUrlToken": "Crear token",
+ "urlTokenOnce": "Copia este token ahora. No se volverá a mostrar.",
+ "revoked": "Revocado",
+ "revoke": "Revocar"
},
"status": {
"healthy": "correcto",
@@ -454,7 +477,8 @@
"keyOrdinal": "clave #{n}",
"attemptTimingHint": "Desfase desde el inicio de la solicitud · duración del intento",
"requestedModel": "Modelo solicitado",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Solicitudes por agente"
},
"playground": {
"title": "Entorno de pruebas",
@@ -674,5 +698,15 @@
"url": "Introduce una URL válida que empiece por http:// o https://",
"email": "Introduce una dirección de correo válida",
"passwordMin": "Al menos {min} caracteres"
+ },
+ "agents": {
+ "title": "Agentes de programación",
+ "description": "Conecta herramientas de programación a un único gateway de modelos gratuitos con configuración generada y respaldo seguro.",
+ "apiKey": "Clave de API",
+ "quickstart": "La vía más rápida: configura Claude Code desde el catálogo en vivo.",
+ "currentKey": "Clave unificada actual:",
+ "seenRecently": "Visto recientemente",
+ "endpoint": "Endpoint",
+ "documentation": "Documentación"
}
}
diff --git a/client/src/i18n/locales/fa.json b/client/src/i18n/locales/fa.json
index dd3bd4e1..fa7d0d61 100644
--- a/client/src/i18n/locales/fa.json
+++ b/client/src/i18n/locales/fa.json
@@ -13,7 +13,8 @@
"switchDark": "به طرح زمینه تیره بروید",
"switchToChinese": "به چینی تغییر دهید",
"switchToEnglish": "به انگلیسی تغییر دهید",
- "modelsMenu": "انواع مدل ها را مرور کنید"
+ "modelsMenu": "انواع مدل ها را مرور کنید",
+ "agents": "عامل ها"
},
"auth": {
"createYourAccount": "حساب کاربری خود را ایجاد کنید",
@@ -375,7 +376,29 @@
"quotaLimit": "محدود کنید",
"quotaRemaining": "باقی مانده است",
"quotaReset": "بازنشانی کنید",
- "quotaObserved": "مشاهده شد"
+ "quotaObserved": "مشاهده شد",
+ "tabAgents": "عامل ها",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "نگاشت مدل های Gemini",
+ "geminiDesc": "نام های Gemini Pro، Flash و Flash-Lite را به Auto یا یک مدل مشخص از کاتالوگ نگاشت کنید.",
+ "compatibilityTitle": "سازگاری عامل ها",
+ "compatibilityDesc": "سطوح سازگاری اختیاری و کشف مدل Claude Code را کنترل کنید.",
+ "ollamaMode": "شبیه سازی Ollama",
+ "ollamaModeHint": "حالت باز روی loopback هرگز ترافیک LAN احراز هویت نشده را نمی پذیرد.",
+ "ollamaOff": "خاموش",
+ "ollamaLoopback": "باز روی loopback",
+ "ollamaKeyRequired": "کلید API لازم است",
+ "claudeAliases": "نام های مستعار کشف Claude Code",
+ "claudeAliasesHint": "نام های مستعار claude/<model> را در دسترس قرار دهید تا انتخابگر مدل دروازه بتواند کاتالوگ را فهرست کند.",
+ "urlTokensTitle": "توکن های URL قابل لغو",
+ "urlTokensDesc": "فقط برای کلاینت های بدون هدر. توکن های URL ممکن است به تاریخچه و لاگ ها نشت کنند، پس وقتی دیگر لازم نیستند آنها را لغو کنید.",
+ "urlTokenLabel": "برچسب توکن",
+ "createUrlToken": "ایجاد توکن",
+ "urlTokenOnce": "این توکن را همین حالا کپی کنید. دوباره نمایش داده نخواهد شد.",
+ "revoked": "لغو شده",
+ "revoke": "لغو"
},
"status": {
"healthy": "سالم",
@@ -454,7 +477,8 @@
"keyOrdinal": "کلید #{n}",
"attemptTimingHint": "شروع افست از شروع درخواست · مدت زمان تلاش",
"requestedModel": "مدل درخواستی",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "درخواستها بر اساس عامل"
},
"playground": {
"title": "زمین بازی",
@@ -674,5 +698,15 @@
"url": "یک URL معتبر وارد کنید که با http:// یا https:// شروع می شود",
"email": "یک آدرس ایمیل معتبر وارد کنید",
"passwordMin": "حداقل کاراکتر {min}"
+ },
+ "agents": {
+ "title": "عامل های کدنویسی",
+ "description": "ابزارهای کدنویسی را با پیکربندی تولیدشده و دارای پشتیبان گیری امن به یک دروازه مدل های رایگان متصل کنید.",
+ "apiKey": "کلید API",
+ "quickstart": "سریع ترین راه: Claude Code را از کاتالوگ زنده پیکربندی کنید.",
+ "currentKey": "کلید یکپارچه فعلی:",
+ "seenRecently": "به تازگی دیده شده",
+ "endpoint": "نقطه پایانی",
+ "documentation": "مستندات"
}
}
diff --git a/client/src/i18n/locales/fi.json b/client/src/i18n/locales/fi.json
index b7bcb87b..ad59b34d 100644
--- a/client/src/i18n/locales/fi.json
+++ b/client/src/i18n/locales/fi.json
@@ -13,7 +13,8 @@
"switchDark": "Vaihda tummaan teemaan",
"switchToChinese": "Siirtyminen kiinaan",
"switchToEnglish": "Siirtyminen englanniksi",
- "modelsMenu": "Selaa mallityyppejä"
+ "modelsMenu": "Selaa mallityyppejä",
+ "agents": "Agentit"
},
"auth": {
"createYourAccount": "Luo tilisi",
@@ -375,7 +376,29 @@
"quotaLimit": "Rajoitus",
"quotaRemaining": "Jäljelle jääminen",
"quotaReset": "Nollaus",
- "quotaObserved": "Havaittu"
+ "quotaObserved": "Havaittu",
+ "tabAgents": "Agentit",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini-mallien määritys",
+ "geminiDesc": "Yhdistä Gemini Pro-, Flash- ja Flash-Lite-nimet Autoon tai tiettyyn katalogin malliin.",
+ "compatibilityTitle": "Agenttien yhteensopivuus",
+ "compatibilityDesc": "Hallitse valinnaisia yhteensopivuusrajapintoja ja Claude Coden mallien löytämistä.",
+ "ollamaMode": "Ollama-emulointi",
+ "ollamaModeHint": "Avoin loopback ei koskaan hyväksy todentamatonta LAN-liikennettä.",
+ "ollamaOff": "Pois",
+ "ollamaLoopback": "Avoin loopbackissa",
+ "ollamaKeyRequired": "API-avain vaaditaan",
+ "claudeAliases": "Claude Coden löytämisaliakset",
+ "claudeAliasesHint": "Julkaise claude/<model>-aliakset, jotta yhdyskäytävän mallivalitsin voi listata katalogin.",
+ "urlTokensTitle": "Peruutettavat URL-tokenit",
+ "urlTokensDesc": "Vain otsikottomille asiakkaille. URL-tokenit voivat vuotaa historiaan ja lokeihin, joten peruuta ne, kun niitä ei enää tarvita.",
+ "urlTokenLabel": "Tokenin nimi",
+ "createUrlToken": "Luo token",
+ "urlTokenOnce": "Kopioi tämä token nyt. Sitä ei näytetä uudelleen.",
+ "revoked": "Peruutettu",
+ "revoke": "Peruuta"
},
"status": {
"healthy": "terve",
@@ -454,7 +477,8 @@
"keyOrdinal": "Keskeiset #{n}",
"attemptTimingHint": "Aloita siirtymä pyynnön alusta · Yrityksen kesto",
"requestedModel": "Pyydetty malli",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Pyynnöt agenteittain"
},
"playground": {
"title": "Leikkipaikka",
@@ -674,5 +698,15 @@
"url": "Syötä kelvollinen URL, joka alkaa http:// tai https://",
"email": "Syötä kelvollinen sähköpostiosoite",
"passwordMin": "Vähintään {min} hahmoa"
+ },
+ "agents": {
+ "title": "Koodausagentit",
+ "description": "Yhdistä koodaustyökalut yhteen ilmaisten mallien yhdyskäytävään generoidulla, varmuuskopiot turvaavalla kokoonpanolla.",
+ "apiKey": "API-avain",
+ "quickstart": "Nopein tapa: määritä Claude Code live-katalogista.",
+ "currentKey": "Nykyinen yhtenäinen avain:",
+ "seenRecently": "Nähty äskettäin",
+ "endpoint": "Päätepiste",
+ "documentation": "Dokumentaatio"
}
}
diff --git a/client/src/i18n/locales/fr.json b/client/src/i18n/locales/fr.json
index 15b97477..36efb294 100644
--- a/client/src/i18n/locales/fr.json
+++ b/client/src/i18n/locales/fr.json
@@ -13,7 +13,8 @@
"switchDark": "Passer au thème sombre",
"switchToChinese": "Passer au chinois",
"switchToEnglish": "Passer à l'anglais",
- "modelsMenu": "Parcourir les types de modèles"
+ "modelsMenu": "Parcourir les types de modèles",
+ "agents": "Agents"
},
"auth": {
"createYourAccount": "Créez votre compte",
@@ -375,7 +376,29 @@
"quotaLimit": "Limite",
"quotaRemaining": "Restant",
"quotaReset": "Réinitialisation",
- "quotaObserved": "Observé"
+ "quotaObserved": "Observé",
+ "tabAgents": "Agents",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Correspondance des modèles Gemini",
+ "geminiDesc": "Associez les noms Gemini Pro, Flash et Flash-Lite à Auto ou à un modèle précis du catalogue.",
+ "compatibilityTitle": "Compatibilité des agents",
+ "compatibilityDesc": "Contrôlez les surfaces de compatibilité en opt-in et la découverte des modèles par Claude Code.",
+ "ollamaMode": "Émulation Ollama",
+ "ollamaModeHint": "Le mode ouvert en loopback n'accepte jamais de trafic LAN non authentifié.",
+ "ollamaOff": "Désactivé",
+ "ollamaLoopback": "Ouvert en loopback",
+ "ollamaKeyRequired": "Clé API requise",
+ "claudeAliases": "Alias de découverte Claude Code",
+ "claudeAliasesHint": "Exposez des alias claude/<model> pour que le sélecteur de modèles de la passerelle puisse lister le catalogue.",
+ "urlTokensTitle": "Tokens d'URL révocables",
+ "urlTokensDesc": "Réservé aux clients sans en-têtes. Les tokens d'URL peuvent fuiter dans l'historique et les journaux ; révoquez-les dès qu'ils ne sont plus nécessaires.",
+ "urlTokenLabel": "Libellé du token",
+ "createUrlToken": "Créer un token",
+ "urlTokenOnce": "Copiez ce token maintenant. Il ne sera plus affiché.",
+ "revoked": "Révoqué",
+ "revoke": "Révoquer"
},
"status": {
"healthy": "sain",
@@ -454,7 +477,8 @@
"keyOrdinal": "clé #{n}",
"attemptTimingHint": "Décalage depuis le début de la requête · durée de la tentative",
"requestedModel": "Modèle demandé",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Requêtes par agent"
},
"playground": {
"title": "Bac à sable",
@@ -674,5 +698,15 @@
"url": "Saisissez une URL valide commençant par http:// ou https://",
"email": "Saisissez une adresse e-mail valide",
"passwordMin": "Au moins {min} caractères"
+ },
+ "agents": {
+ "title": "Agents de codage",
+ "description": "Connectez vos outils de codage à une passerelle unique de modèles gratuits, avec une configuration générée et sans risque pour vos sauvegardes.",
+ "apiKey": "Clé API",
+ "quickstart": "Le plus rapide : configurez Claude Code depuis le catalogue en direct.",
+ "currentKey": "Clé unifiée actuelle :",
+ "seenRecently": "Vu récemment",
+ "endpoint": "Endpoint",
+ "documentation": "Documentation"
}
}
diff --git a/client/src/i18n/locales/gu.json b/client/src/i18n/locales/gu.json
index a706362f..f6d098dc 100644
--- a/client/src/i18n/locales/gu.json
+++ b/client/src/i18n/locales/gu.json
@@ -13,7 +13,8 @@
"switchDark": "ડાર્ક થીમ પર સ્વિચ કરો",
"switchToChinese": "ચાઇનીઝ પર સ્વિચ કરો",
"switchToEnglish": "અંગ્રેજી પર સ્વિચ કરો",
- "modelsMenu": "મોડેલ પ્રકારો બ્રાઉઝ કરો"
+ "modelsMenu": "મોડેલ પ્રકારો બ્રાઉઝ કરો",
+ "agents": "એજન્ટ્સ"
},
"auth": {
"createYourAccount": "તમારું એકાઉન્ટ બનાવો",
@@ -375,7 +376,29 @@
"quotaLimit": "મર્યાદા",
"quotaRemaining": "બાકી",
"quotaReset": "રીસેટ કરો",
- "quotaObserved": "અવલોકન કર્યું"
+ "quotaObserved": "અવલોકન કર્યું",
+ "tabAgents": "એજન્ટ્સ",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini મોડેલ મેપિંગ",
+ "geminiDesc": "Gemini Pro, Flash અને Flash-Lite નામોને Auto અથવા કેટલોગના ચોક્કસ મોડેલ સાથે મેપ કરો.",
+ "compatibilityTitle": "એજન્ટ સુસંગતતા",
+ "compatibilityDesc": "વૈકલ્પિક સુસંગતતા સપાટીઓ અને Claude Code મોડેલ શોધ નિયંત્રિત કરો.",
+ "ollamaMode": "Ollama એમ્યુલેશન",
+ "ollamaModeHint": "લૂપબેક પર ખુલ્લો મોડ ક્યારેય અપ્રમાણિત LAN ટ્રાફિક સ્વીકારતો નથી.",
+ "ollamaOff": "બંધ",
+ "ollamaLoopback": "લૂપબેક પર ખુલ્લું",
+ "ollamaKeyRequired": "API કી જરૂરી છે",
+ "claudeAliases": "Claude Code શોધ ઉપનામો",
+ "claudeAliasesHint": "ગેટવેનું મોડેલ પસંદગીકાર કેટલોગની યાદી બતાવી શકે તે માટે claude/<model> ઉપનામો ખુલ્લા કરો.",
+ "urlTokensTitle": "રદ કરી શકાય તેવા URL ટોકન્સ",
+ "urlTokensDesc": "ફક્ત હેડર વગરના ક્લાયન્ટ્સ માટે. URL ટોકન્સ ઇતિહાસ અને લોગમાં લીક થઈ શકે છે, તેથી જ્યારે જરૂર ન રહે ત્યારે તેમને રદ કરો.",
+ "urlTokenLabel": "ટોકન લેબલ",
+ "createUrlToken": "ટોકન બનાવો",
+ "urlTokenOnce": "આ ટોકન હમણાં કૉપિ કરો. તે ફરીથી બતાવવામાં આવશે નહીં.",
+ "revoked": "રદ કરેલ",
+ "revoke": "રદ કરો"
},
"status": {
"healthy": "સ્વસ્થ",
@@ -454,7 +477,8 @@
"keyOrdinal": "કી #{n}",
"attemptTimingHint": "વિનંતીથી ઓફસેટ શરૂ કરો પ્રારંભ · પ્રયાસ અવધિ",
"requestedModel": "વિનંતી કરેલ મોડેલ",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "એજન્ટ પ્રમાણે વિનંતીઓ"
},
"playground": {
"title": "રમતનું મેદાન",
@@ -674,5 +698,15 @@
"url": "http:// અથવા https:// થી શરૂ થતો માન્ય URL દાખલ કરો",
"email": "માન્ય ઇમેઇલ સરનામું દાખલ કરો",
"passwordMin": "ઓછામાં ઓછા {min} અક્ષરો"
+ },
+ "agents": {
+ "title": "કોડિંગ એજન્ટ્સ",
+ "description": "જનરેટ કરેલી, બેકઅપ-સુરક્ષિત ગોઠવણી સાથે કોડિંગ ટૂલ્સને એક ફ્રી-મોડેલ ગેટવે સાથે જોડો.",
+ "apiKey": "API કી",
+ "quickstart": "સૌથી ઝડપી રસ્તો: લાઇવ કેટલોગમાંથી Claude Code ગોઠવો.",
+ "currentKey": "વર્તમાન એકીકૃત કી:",
+ "seenRecently": "તાજેતરમાં જોવાયું",
+ "endpoint": "એન્ડપોઇન્ટ",
+ "documentation": "દસ્તાવેજીકરણ"
}
}
diff --git a/client/src/i18n/locales/ha.json b/client/src/i18n/locales/ha.json
index fc34c225..98b5a8a4 100644
--- a/client/src/i18n/locales/ha.json
+++ b/client/src/i18n/locales/ha.json
@@ -13,7 +13,8 @@
"switchDark": "Canja zuwa jigon duhu",
"switchToChinese": "Canja zuwa Sinanci",
"switchToEnglish": "Canja zuwa Turanci",
- "modelsMenu": "Bincika nau'ikan samfuri"
+ "modelsMenu": "Bincika nau'ikan samfuri",
+ "agents": "Wakilai"
},
"auth": {
"createYourAccount": "Ƙirƙiri asusun ku",
@@ -375,7 +376,29 @@
"quotaLimit": "Iyaka",
"quotaRemaining": "Ya rage",
"quotaReset": "Sake saiti",
- "quotaObserved": "An lura"
+ "quotaObserved": "An lura",
+ "tabAgents": "Wakilai",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Taswirar samfuran Gemini",
+ "geminiDesc": "Haɗa sunayen Gemini Pro, Flash da Flash-Lite zuwa Auto ko wani takamaiman samfurin kundin.",
+ "compatibilityTitle": "Dacewar wakilai",
+ "compatibilityDesc": "Sarrafa wuraren dacewa na zaɓi da gano samfuran Claude Code.",
+ "ollamaMode": "Kwaikwayon Ollama",
+ "ollamaModeHint": "Buɗewa a loopback ba ya taɓa karɓar zirga-zirgar LAN da ba a tantance ba.",
+ "ollamaOff": "A kashe",
+ "ollamaLoopback": "A buɗe a loopback",
+ "ollamaKeyRequired": "Ana buƙatar maɓallin API",
+ "claudeAliases": "Sunayen gano na Claude Code",
+ "claudeAliasesHint": "Fitar da sunayen claude/<model> domin mazaɓin samfura na gateway ya iya lissafa kundin.",
+ "urlTokensTitle": "Alamomin URL masu sokewa",
+ "urlTokensDesc": "Don abokan ciniki marasa header kawai. Alamomin URL na iya zuba cikin tarihi da rajistan ayyuka, don haka soke su idan ba a buƙatarsu.",
+ "urlTokenLabel": "Lakabin alama",
+ "createUrlToken": "Ƙirƙiri alama",
+ "urlTokenOnce": "Kwafi wannan alamar yanzu. Ba za a sake nuna ta ba.",
+ "revoked": "An soke",
+ "revoke": "Soke"
},
"status": {
"healthy": "lafiya",
@@ -454,7 +477,8 @@
"keyOrdinal": "makullin #{n}",
"attemptTimingHint": "Fara biya daga farkon buƙatun · lokacin ƙoƙarin",
"requestedModel": "Samfurin da ake nema",
- "ttft": "Saukewa: TTFT"
+ "ttft": "Saukewa: TTFT",
+ "requestsByAgent": "Bukatu ta kowane wakili"
},
"playground": {
"title": "filin wasa",
@@ -674,5 +698,15 @@
"url": "Shigar da ingantaccen URL farawa da http:// ko https://",
"email": "Shigar da ingantaccen adireshin imel",
"passwordMin": "Akalla haruffa {min}"
+ },
+ "agents": {
+ "title": "Wakilan rubuta kod",
+ "description": "Haɗa kayan aikin rubuta kod zuwa gateway ɗaya na samfura kyauta tare da saitin da aka ƙirƙira, mai kiyaye madadin.",
+ "apiKey": "Maɓallin API",
+ "quickstart": "Hanya mafi sauri: saita Claude Code daga kundin kai tsaye.",
+ "currentKey": "Maɓallin haɗaɗɗe na yanzu:",
+ "seenRecently": "An gan shi kwanan nan",
+ "endpoint": "Endpoint",
+ "documentation": "Takardun bayani"
}
}
diff --git a/client/src/i18n/locales/he.json b/client/src/i18n/locales/he.json
index e1001656..3f0d6413 100644
--- a/client/src/i18n/locales/he.json
+++ b/client/src/i18n/locales/he.json
@@ -13,7 +13,8 @@
"switchDark": "מעבר לנושא כהה",
"switchToChinese": "מעבר לסינית",
"switchToEnglish": "מעבר לאנגלית",
- "modelsMenu": "דפדוף בסוגי דגמים"
+ "modelsMenu": "דפדוף בסוגי דגמים",
+ "agents": "סוכנים"
},
"auth": {
"createYourAccount": "צור את החשבון שלך",
@@ -375,7 +376,29 @@
"quotaLimit": "גבול",
"quotaRemaining": "נותר",
"quotaReset": "איפוס",
- "quotaObserved": "נצפה"
+ "quotaObserved": "נצפה",
+ "tabAgents": "סוכנים",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "מיפוי מודלי Gemini",
+ "geminiDesc": "מפה את השמות Gemini Pro, Flash ו-Flash-Lite לאוטו או למודל ספציפי מהקטלוג.",
+ "compatibilityTitle": "תאימות סוכנים",
+ "compatibilityDesc": "שלוט במשטחי תאימות בהסכמה מפורשת ובגילוי מודלים של Claude Code.",
+ "ollamaMode": "אמולציית Ollama",
+ "ollamaModeHint": "מצב loopback פתוח לעולם אינו מקבל תעבורת LAN לא מאומתת.",
+ "ollamaOff": "כבוי",
+ "ollamaLoopback": "פתוח ב-loopback",
+ "ollamaKeyRequired": "נדרש מפתח API",
+ "claudeAliases": "כינויי גילוי של Claude Code",
+ "claudeAliasesHint": "חשוף כינויי claude/<model> כדי שבורר המודלים של השער יוכל להציג את הקטלוג.",
+ "urlTokensTitle": "טוקני URL ניתנים לביטול",
+ "urlTokensDesc": "ללקוחות ללא כותרות בלבד. טוקני URL עלולים לדלוף להיסטוריה וליומנים, לכן בטל אותם כשאינם נחוצים עוד.",
+ "urlTokenLabel": "תווית טוקן",
+ "createUrlToken": "צור טוקן",
+ "urlTokenOnce": "העתק את הטוקן עכשיו. הוא לא יוצג שוב.",
+ "revoked": "בוטל",
+ "revoke": "בטל"
},
"status": {
"healthy": "בריא",
@@ -454,7 +477,8 @@
"keyOrdinal": "מפתח #{n}",
"attemptTimingHint": "התחל הזזה מהבקשה · משך הניסיון",
"requestedModel": "מודל מבוקש",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "בקשות לפי סוכן"
},
"playground": {
"title": "מגרש משחקים",
@@ -674,5 +698,15 @@
"url": "הזן URL תקף שמתחיל ב-http:// או https://",
"email": "הזן כתובת אימייל תקפה",
"passwordMin": "לפחות {min} דמויות"
+ },
+ "agents": {
+ "title": "סוכני קוד",
+ "description": "חבר כלי תכנות לשער אחד של מודלים חינמיים עם תצורה שנוצרת אוטומטית ובטוחה לגיבוי.",
+ "apiKey": "מפתח API",
+ "quickstart": "המסלול המהיר ביותר: הגדר את Claude Code מהקטלוג החי.",
+ "currentKey": "מפתח מאוחד נוכחי:",
+ "seenRecently": "נראה לאחרונה",
+ "endpoint": "נקודת קצה",
+ "documentation": "תיעוד"
}
}
diff --git a/client/src/i18n/locales/hi.json b/client/src/i18n/locales/hi.json
index 91ad2d82..a6023491 100644
--- a/client/src/i18n/locales/hi.json
+++ b/client/src/i18n/locales/hi.json
@@ -13,7 +13,8 @@
"switchDark": "डार्क थीम पर स्विच करें",
"switchToChinese": "चीनी पर स्विच करें",
"switchToEnglish": "अंग्रेजी पर स्विच करें",
- "modelsMenu": "मॉडल प्रकार ब्राउज़ करें"
+ "modelsMenu": "मॉडल प्रकार ब्राउज़ करें",
+ "agents": "एजेंट"
},
"auth": {
"createYourAccount": "अपना खाता बनाएं",
@@ -375,7 +376,29 @@
"quotaLimit": "सीमा",
"quotaRemaining": "शेष",
"quotaReset": "रीसेट करें",
- "quotaObserved": "अवलोकन किया"
+ "quotaObserved": "अवलोकन किया",
+ "tabAgents": "एजेंट",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini मॉडल मैपिंग",
+ "geminiDesc": "Gemini Pro, Flash और Flash-Lite नामों को ऑटो या किसी विशिष्ट कैटलॉग मॉडल पर मैप करें।",
+ "compatibilityTitle": "एजेंट संगतता",
+ "compatibilityDesc": "ऑप्ट-इन संगतता सतहों और Claude Code मॉडल खोज को नियंत्रित करें।",
+ "ollamaMode": "Ollama अनुकरण",
+ "ollamaModeHint": "ओपन-लूपबैक कभी भी अप्रमाणित LAN ट्रैफ़िक स्वीकार नहीं करता।",
+ "ollamaOff": "बंद",
+ "ollamaLoopback": "लूपबैक पर खुला",
+ "ollamaKeyRequired": "API कुंजी आवश्यक",
+ "claudeAliases": "Claude Code खोज उपनाम",
+ "claudeAliasesHint": "claude/<model> उपनाम उजागर करें ताकि गेटवे मॉडल चयनकर्ता कैटलॉग सूचीबद्ध कर सके।",
+ "urlTokensTitle": "रद्द करने योग्य URL टोकन",
+ "urlTokensDesc": "केवल हेडर-रहित क्लाइंट के लिए। URL टोकन इतिहास और लॉग में लीक हो सकते हैं, इसलिए ज़रूरत न रहने पर उन्हें रद्द कर दें।",
+ "urlTokenLabel": "टोकन लेबल",
+ "createUrlToken": "टोकन बनाएँ",
+ "urlTokenOnce": "यह टोकन अभी कॉपी करें। यह दोबारा नहीं दिखाया जाएगा।",
+ "revoked": "रद्द किया गया",
+ "revoke": "रद्द करें"
},
"status": {
"healthy": "स्वस्थ",
@@ -454,7 +477,8 @@
"keyOrdinal": "कुंजी #{n}",
"attemptTimingHint": "अनुरोध प्रारंभ · प्रयास अवधि से प्रारंभ ऑफसेट",
"requestedModel": "अनुरोधित मॉडल",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "एजेंट के अनुसार अनुरोध"
},
"playground": {
"title": "खेल का मैदान",
@@ -674,5 +698,15 @@
"url": "http:// या https:// से शुरू होने वाला वैध URL दर्ज करें",
"email": "एक वैध ईमेल पता दर्ज करें",
"passwordMin": "कम से कम {min} अक्षर"
+ },
+ "agents": {
+ "title": "कोडिंग एजेंट",
+ "description": "कोडिंग टूल को एक फ्री-मॉडल गेटवे से जोड़ें, जनरेट की गई और बैकअप-सुरक्षित कॉन्फ़िगरेशन के साथ।",
+ "apiKey": "API कुंजी",
+ "quickstart": "सबसे तेज़ रास्ता: लाइव कैटलॉग से Claude Code कॉन्फ़िगर करें।",
+ "currentKey": "वर्तमान एकीकृत कुंजी:",
+ "seenRecently": "हाल ही में देखा गया",
+ "endpoint": "समापन बिंदु",
+ "documentation": "दस्तावेज़ीकरण"
}
}
diff --git a/client/src/i18n/locales/hr.json b/client/src/i18n/locales/hr.json
index 20c5c1b8..74d89eb8 100644
--- a/client/src/i18n/locales/hr.json
+++ b/client/src/i18n/locales/hr.json
@@ -13,7 +13,8 @@
"switchDark": "Prebaci na tamnu temu",
"switchToChinese": "Prijelaz na kineski",
"switchToEnglish": "Prijelaz na engleski",
- "modelsMenu": "Pregledajte vrste modela"
+ "modelsMenu": "Pregledajte vrste modela",
+ "agents": "Agenti"
},
"auth": {
"createYourAccount": "Kreirajte svoj račun",
@@ -375,7 +376,29 @@
"quotaLimit": "Ograničenje",
"quotaRemaining": "Preostali",
"quotaReset": "Reset",
- "quotaObserved": "Opaženo"
+ "quotaObserved": "Opaženo",
+ "tabAgents": "Agenti",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Mapiranje Gemini modela",
+ "geminiDesc": "Mapirajte nazive Gemini Pro, Flash i Flash-Lite na Auto ili određeni model iz kataloga.",
+ "compatibilityTitle": "Kompatibilnost agenata",
+ "compatibilityDesc": "Upravljajte opcionalnim sučeljima kompatibilnosti i otkrivanjem modela za Claude Code.",
+ "ollamaMode": "Ollama emulacija",
+ "ollamaModeHint": "Otvoreni loopback nikada ne prihvaća neautentificirani LAN promet.",
+ "ollamaOff": "Isključeno",
+ "ollamaLoopback": "Otvoreno na loopbacku",
+ "ollamaKeyRequired": "Potreban API ključ",
+ "claudeAliases": "Aliasi za otkrivanje Claude Codea",
+ "claudeAliasesHint": "Izložite claude/<model> aliase kako bi birač modela gatewaya mogao izlistati katalog.",
+ "urlTokensTitle": "Opozivi URL tokeni",
+ "urlTokensDesc": "Samo za klijente bez zaglavlja. URL tokeni mogu procuriti u povijest i logove, pa ih opozovite kad više nisu potrebni.",
+ "urlTokenLabel": "Oznaka tokena",
+ "createUrlToken": "Stvori token",
+ "urlTokenOnce": "Kopirajte ovaj token sada. Neće se ponovno prikazati.",
+ "revoked": "Opozvano",
+ "revoke": "Opozovi"
},
"status": {
"healthy": "Zdravo",
@@ -454,7 +477,8 @@
"keyOrdinal": "Ključne #{n}",
"attemptTimingHint": "Početak offseta od početka zahtjeva · Trajanje pokušaja",
"requestedModel": "Traženi model",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Zahtjevi po agentu"
},
"playground": {
"title": "Igralište",
@@ -674,5 +698,15 @@
"url": "Unesite valjani URL koji počinje s http:// ili https://",
"email": "Unesite valjanu e-mail adresu",
"passwordMin": "Barem {min} likova"
+ },
+ "agents": {
+ "title": "Agenti za kodiranje",
+ "description": "Povežite alate za kodiranje s jednim gatewayem besplatnih modela uz generiranu konfiguraciju sigurnu za backup.",
+ "apiKey": "API ključ",
+ "quickstart": "Najbrži put: konfigurirajte Claude Code iz live kataloga.",
+ "currentKey": "Trenutni objedinjeni ključ:",
+ "seenRecently": "Nedavno viđeno",
+ "endpoint": "Krajnja točka",
+ "documentation": "Dokumentacija"
}
}
diff --git a/client/src/i18n/locales/hu.json b/client/src/i18n/locales/hu.json
index 309597e2..bbb4b2b7 100644
--- a/client/src/i18n/locales/hu.json
+++ b/client/src/i18n/locales/hu.json
@@ -13,7 +13,8 @@
"switchDark": "Áttérés sötét témára",
"switchToChinese": "Átállás kínaira",
"switchToEnglish": "Átállás angolra",
- "modelsMenu": "Böngészés modelltípusok"
+ "modelsMenu": "Böngészés modelltípusok",
+ "agents": "Ügynökök"
},
"auth": {
"createYourAccount": "Hozza létre a fiókot",
@@ -375,7 +376,29 @@
"quotaLimit": "Határ",
"quotaRemaining": "Maradék",
"quotaReset": "Reset",
- "quotaObserved": "Megfigyelve"
+ "quotaObserved": "Megfigyelve",
+ "tabAgents": "Ügynökök",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini modellek leképezése",
+ "geminiDesc": "Rendeld a Gemini Pro, Flash és Flash-Lite neveket az Auto-hoz vagy egy adott katalógusmodellhez.",
+ "compatibilityTitle": "Ügynök-kompatibilitás",
+ "compatibilityDesc": "Szabályozd az opcionális kompatibilitási felületeket és a Claude Code modellfelderítést.",
+ "ollamaMode": "Ollama emuláció",
+ "ollamaModeHint": "A nyitott loopback soha nem fogad hitelesítetlen LAN forgalmat.",
+ "ollamaOff": "Ki",
+ "ollamaLoopback": "Nyitva a loopbacken",
+ "ollamaKeyRequired": "API kulcs szükséges",
+ "claudeAliases": "Claude Code felderítési aliasok",
+ "claudeAliasesHint": "Tedd elérhetővé a claude/<model> aliasokat, hogy az átjáró modellválasztója listázhassa a katalógust.",
+ "urlTokensTitle": "Visszavonható URL tokenek",
+ "urlTokensDesc": "Csak fejléc nélküli kliensekhez. Az URL tokenek kiszivároghatnak az előzményekbe és a naplókba, ezért vond vissza őket, ha már nincs rájuk szükség.",
+ "urlTokenLabel": "Token címke",
+ "createUrlToken": "Token létrehozása",
+ "urlTokenOnce": "Másold ki ezt a tokent most. Többé nem jelenik meg.",
+ "revoked": "Visszavonva",
+ "revoke": "Visszavonás"
},
"status": {
"healthy": "egészséges",
@@ -454,7 +477,8 @@
"keyOrdinal": "Kulcsfontosságú #{n}",
"attemptTimingHint": "A kérelmű elejétől kezdj el · Próbálkozás időtartama",
"requestedModel": "Kért modell",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Kérések ügynökönként"
},
"playground": {
"title": "Játszótér",
@@ -674,5 +698,15 @@
"url": "Írj be egy érvényes URL http://-vel vagy https://",
"email": "Írj meg érvényes e-mail címet",
"passwordMin": "Legalább {min} karakter"
+ },
+ "agents": {
+ "title": "Kódoló ügynökök",
+ "description": "Kösd össze a kódolóeszközöket egyetlen ingyenes modellátjáróval, generált, mentésbiztos konfigurációval.",
+ "apiKey": "API kulcs",
+ "quickstart": "A leggyorsabb út: állítsd be a Claude Code-ot az élő katalógusból.",
+ "currentKey": "Jelenlegi egységes kulcs:",
+ "seenRecently": "Nemrég látott",
+ "endpoint": "Végpont",
+ "documentation": "Dokumentáció"
}
}
diff --git a/client/src/i18n/locales/id.json b/client/src/i18n/locales/id.json
index bfb7f71a..f1c40623 100644
--- a/client/src/i18n/locales/id.json
+++ b/client/src/i18n/locales/id.json
@@ -13,7 +13,8 @@
"switchDark": "Beralih ke tema gelap",
"switchToChinese": "Beralih ke bahasa Cina",
"switchToEnglish": "Beralih ke bahasa Inggris",
- "modelsMenu": "Telusuri jenis model"
+ "modelsMenu": "Telusuri jenis model",
+ "agents": "Agen"
},
"auth": {
"createYourAccount": "Buat akun Anda",
@@ -375,7 +376,29 @@
"quotaLimit": "Batasi",
"quotaRemaining": "Tersisa",
"quotaReset": "Setel ulang",
- "quotaObserved": "Diamati"
+ "quotaObserved": "Diamati",
+ "tabAgents": "Agen",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Pemetaan model Gemini",
+ "geminiDesc": "Petakan nama Gemini Pro, Flash, dan Flash-Lite ke Otomatis atau model katalog tertentu.",
+ "compatibilityTitle": "Kompatibilitas agen",
+ "compatibilityDesc": "Kontrol permukaan kompatibilitas opt-in dan penemuan model Claude Code.",
+ "ollamaMode": "Emulasi Ollama",
+ "ollamaModeHint": "Loopback terbuka tidak pernah menerima lalu lintas LAN tanpa autentikasi.",
+ "ollamaOff": "Mati",
+ "ollamaLoopback": "Terbuka di loopback",
+ "ollamaKeyRequired": "Perlu kunci API",
+ "claudeAliases": "Alias penemuan Claude Code",
+ "claudeAliasesHint": "Ekspos alias claude/<model> agar pemilih model gateway dapat menampilkan daftar katalog.",
+ "urlTokensTitle": "Token URL yang dapat dicabut",
+ "urlTokensDesc": "Hanya untuk klien tanpa header. Token URL bisa bocor ke riwayat dan log, jadi cabut jika sudah tidak diperlukan.",
+ "urlTokenLabel": "Label token",
+ "createUrlToken": "Buat token",
+ "urlTokenOnce": "Salin token ini sekarang. Token tidak akan ditampilkan lagi.",
+ "revoked": "Dicabut",
+ "revoke": "Cabut"
},
"status": {
"healthy": "sehat",
@@ -454,7 +477,8 @@
"keyOrdinal": "kunci #{n}",
"attemptTimingHint": "Mulai offset dari awal permintaan · durasi upaya",
"requestedModel": "Model yang diminta",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Permintaan per agen"
},
"playground": {
"title": "Taman bermain",
@@ -674,5 +698,15 @@
"url": "Masukkan URL yang valid dimulai dengan http:// atau https://",
"email": "Masukkan alamat email yang valid",
"passwordMin": "Setidaknya karakter {min}"
+ },
+ "agents": {
+ "title": "Agen coding",
+ "description": "Hubungkan alat coding ke satu gateway model gratis dengan konfigurasi yang dihasilkan otomatis dan aman untuk dicadangkan.",
+ "apiKey": "Kunci API",
+ "quickstart": "Jalur tercepat: konfigurasikan Claude Code dari katalog langsung.",
+ "currentKey": "Kunci terpadu saat ini:",
+ "seenRecently": "Terlihat baru-baru ini",
+ "endpoint": "Titik akhir",
+ "documentation": "Dokumentasi"
}
}
diff --git a/client/src/i18n/locales/ig.json b/client/src/i18n/locales/ig.json
index 33847d7b..b48291c1 100644
--- a/client/src/i18n/locales/ig.json
+++ b/client/src/i18n/locales/ig.json
@@ -13,7 +13,8 @@
"switchDark": "Banye na isiokwu gbara ọchịchịrị",
"switchToChinese": "Banye na Chinese",
"switchToEnglish": "Banye na bekee",
- "modelsMenu": "Chọgharịa ụdị nlereanya"
+ "modelsMenu": "Chọgharịa ụdị nlereanya",
+ "agents": "Ndị ejenti"
},
"auth": {
"createYourAccount": "Mepụta akaụntụ gị",
@@ -375,7 +376,29 @@
"quotaLimit": "Oke",
"quotaRemaining": "Nke fọdụrụ",
"quotaReset": "Tọgharia",
- "quotaObserved": "Ahụrụ"
+ "quotaObserved": "Ahụrụ",
+ "tabAgents": "Ndị ejenti",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Maapụ ụdị Gemini",
+ "geminiDesc": "Maapụ aha Gemini Pro, Flash, na Flash-Lite na Auto ma ọ bụ otu ụdị katalọgụ akọwapụtara.",
+ "compatibilityTitle": "Ndakọrịta ejenti",
+ "compatibilityDesc": "Chịkwaa elu ndakọrịta nke nhọrọ yana nchọpụta ụdị Claude Code.",
+ "ollamaMode": "Iṅomi Ollama",
+ "ollamaModeHint": "Loopback mepere emepe anaghị anabata okporo ụzọ LAN na-enweghị nkwenye.",
+ "ollamaOff": "Gbanyụọ",
+ "ollamaLoopback": "Mepee na loopback",
+ "ollamaKeyRequired": "Achọrọ igodo API",
+ "claudeAliases": "Aha ọzọ nchọpụta Claude Code",
+ "claudeAliasesHint": "Gosipụta aha ọzọ claude/<model> ka onye nhọrọ ụdị nke ọnụ ụzọ nwee ike depụta katalọgụ.",
+ "urlTokensTitle": "Akara URL enwere ike ịkagbu",
+ "urlTokensDesc": "Naanị maka ndị ahịa na-enweghị nkụnye eji isi mee. Akara URL nwere ike ịbanye na akụkọ ihe mere eme na ndekọ, ya mere kagbuo ha mgbe achọghịzi ha.",
+ "urlTokenLabel": "Labelụ akara",
+ "createUrlToken": "Mepụta akara",
+ "urlTokenOnce": "Detuo akara a ugbu a. A gaghị egosi ya ọzọ.",
+ "revoked": "Akagbuola",
+ "revoke": "Kagbuo"
},
"status": {
"healthy": "ahụike",
@@ -454,7 +477,8 @@
"keyOrdinal": "igodo #{n}",
"attemptTimingHint": "Malite nkwụsị site na mmalite arịrịọ · Ogologo oge nwaa",
"requestedModel": "Ihe nlereanya achọrọ",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Arịrịọ site na ejenti"
},
"playground": {
"title": "Ebe egwuregwu",
@@ -674,5 +698,15 @@
"url": "Tinye ezigbo URL malite na http:// ma ọ bụ https://",
"email": "Tinye adreesị ozi-e bara uru",
"passwordMin": "Opekempe mkpụrụedemede {min}"
+ },
+ "agents": {
+ "title": "Ndị ejenti koodu",
+ "description": "Jikọọ ngwaọrụ koodu na otu ọnụ ụzọ ụdị n'efu nwere nhazi emepụtara nke dị mma maka ndabere.",
+ "apiKey": "Igodo API",
+ "quickstart": "Ụzọ kachasị ọsọ: hazie Claude Code site na katalọgụ dị ndụ.",
+ "currentKey": "Igodo jikọtara ọnụ ugbu a:",
+ "seenRecently": "A hụrụ ya nso nso a",
+ "endpoint": "Njedebe",
+ "documentation": "Akwụkwọ ntuziaka"
}
}
diff --git a/client/src/i18n/locales/it.json b/client/src/i18n/locales/it.json
index 3830e2d6..f7cf581b 100644
--- a/client/src/i18n/locales/it.json
+++ b/client/src/i18n/locales/it.json
@@ -13,7 +13,8 @@
"switchDark": "Passa al tema scuro",
"switchToChinese": "Passa al cinese",
"switchToEnglish": "Passa all'inglese",
- "modelsMenu": "Sfoglia i tipi di modello"
+ "modelsMenu": "Sfoglia i tipi di modello",
+ "agents": "Agenti"
},
"auth": {
"createYourAccount": "Crea il tuo account",
@@ -375,7 +376,29 @@
"quotaLimit": "Limite",
"quotaRemaining": "Rimanente",
"quotaReset": "Reset",
- "quotaObserved": "Osservato"
+ "quotaObserved": "Osservato",
+ "tabAgents": "Agenti",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Mappatura modelli Gemini",
+ "geminiDesc": "Mappa i nomi Gemini Pro, Flash e Flash-Lite su Auto o su un modello specifico del catalogo.",
+ "compatibilityTitle": "Compatibilità agenti",
+ "compatibilityDesc": "Controlla le superfici di compatibilità opzionali e la scoperta dei modelli di Claude Code.",
+ "ollamaMode": "Emulazione Ollama",
+ "ollamaModeHint": "Il loopback aperto non accetta mai traffico LAN non autenticato.",
+ "ollamaOff": "Disattivata",
+ "ollamaLoopback": "Aperta su loopback",
+ "ollamaKeyRequired": "Chiave API richiesta",
+ "claudeAliases": "Alias di scoperta per Claude Code",
+ "claudeAliasesHint": "Esponi gli alias claude/<model> così il selettore di modelli del gateway può elencare il catalogo.",
+ "urlTokensTitle": "Token URL revocabili",
+ "urlTokensDesc": "Solo per client senza header. I token URL possono finire nella cronologia e nei log, quindi revocali quando non servono più.",
+ "urlTokenLabel": "Etichetta del token",
+ "createUrlToken": "Crea token",
+ "urlTokenOnce": "Copia questo token ora. Non verrà mostrato di nuovo.",
+ "revoked": "Revocato",
+ "revoke": "Revoca"
},
"status": {
"healthy": "funzionante",
@@ -454,7 +477,8 @@
"keyOrdinal": "chiave #{n}",
"attemptTimingHint": "Offset dall'inizio della richiesta · durata del tentativo",
"requestedModel": "Modello richiesto",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Richieste per agente"
},
"playground": {
"title": "Playground",
@@ -674,5 +698,15 @@
"url": "Inserisci un URL valido che inizi con http:// o https://",
"email": "Inserisci un indirizzo email valido",
"passwordMin": "Almeno {min} caratteri"
+ },
+ "agents": {
+ "title": "Agenti di coding",
+ "description": "Collega gli strumenti di coding a un unico gateway di modelli gratuiti con configurazione generata e sicura per il backup.",
+ "apiKey": "Chiave API",
+ "quickstart": "La via più rapida: configura Claude Code dal catalogo live.",
+ "currentKey": "Chiave unificata attuale:",
+ "seenRecently": "Visto di recente",
+ "endpoint": "Endpoint",
+ "documentation": "Documentazione"
}
}
diff --git a/client/src/i18n/locales/ja.json b/client/src/i18n/locales/ja.json
index efac9c84..3b33685f 100644
--- a/client/src/i18n/locales/ja.json
+++ b/client/src/i18n/locales/ja.json
@@ -13,7 +13,8 @@
"switchDark": "ダークテーマに切り替える",
"switchToChinese": "中国語に切り替える",
"switchToEnglish": "英語に切り替える",
- "modelsMenu": "モデルタイプを参照する"
+ "modelsMenu": "モデルタイプを参照する",
+ "agents": "エージェント"
},
"auth": {
"createYourAccount": "アカウントを作成する",
@@ -375,7 +376,29 @@
"quotaLimit": "限界",
"quotaRemaining": "残り",
"quotaReset": "リセット",
- "quotaObserved": "観察された"
+ "quotaObserved": "観察された",
+ "tabAgents": "エージェント",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini モデルマッピング",
+ "geminiDesc": "Gemini Pro、Flash、Flash-Lite の名前を Auto または特定のカタログモデルにマッピングします。",
+ "compatibilityTitle": "エージェント互換性",
+ "compatibilityDesc": "オプトインの互換サーフェスと Claude Code のモデル検出を制御します。",
+ "ollamaMode": "Ollama エミュレーション",
+ "ollamaModeHint": "オープンループバックは、未認証の LAN トラフィックを決して受け付けません。",
+ "ollamaOff": "オフ",
+ "ollamaLoopback": "ループバックで開放",
+ "ollamaKeyRequired": "API キーが必要",
+ "claudeAliases": "Claude Code 検出エイリアス",
+ "claudeAliasesHint": "claude/<model> エイリアスを公開して、ゲートウェイのモデルピッカーがカタログを一覧表示できるようにします。",
+ "urlTokensTitle": "取り消し可能な URL トークン",
+ "urlTokensDesc": "ヘッダーを使えないクライアント専用です。URL トークンは履歴やログに漏れる可能性があるため、不要になったら取り消してください。",
+ "urlTokenLabel": "トークンラベル",
+ "createUrlToken": "トークンを作成",
+ "urlTokenOnce": "このトークンを今すぐコピーしてください。二度と表示されません。",
+ "revoked": "取り消し済み",
+ "revoke": "取り消す"
},
"status": {
"healthy": "健康な",
@@ -454,7 +477,8 @@
"keyOrdinal": "キー #{n}",
"attemptTimingHint": "リクエスト開始からの開始オフセット · 試行期間",
"requestedModel": "要求されたモデル",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "エージェント別リクエスト"
},
"playground": {
"title": "遊び場",
@@ -674,5 +698,15 @@
"url": "http:// または https:// で始まる有効な URL を入力してください",
"email": "有効なメールアドレスを入力してください",
"passwordMin": "少なくとも {min} 文字"
+ },
+ "agents": {
+ "title": "コーディングエージェント",
+ "description": "コーディングツールを 1 つの無料モデルゲートウェイに接続します。設定は自動生成され、バックアップも安全です。",
+ "apiKey": "API キー",
+ "quickstart": "最速の方法: ライブカタログから Claude Code を設定します。",
+ "currentKey": "現在の統合キー:",
+ "seenRecently": "最近確認済み",
+ "endpoint": "エンドポイント",
+ "documentation": "ドキュメント"
}
}
diff --git a/client/src/i18n/locales/ka.json b/client/src/i18n/locales/ka.json
index 2014b7f3..6e1b89ed 100644
--- a/client/src/i18n/locales/ka.json
+++ b/client/src/i18n/locales/ka.json
@@ -13,7 +13,8 @@
"switchDark": "ბნელ თემაზე გადართვა",
"switchToChinese": "ჩინურზე გადართვა",
"switchToEnglish": "ინგლისურზე გადართვა",
- "modelsMenu": "მოდელის ტიპების დათვალიერება"
+ "modelsMenu": "მოდელის ტიპების დათვალიერება",
+ "agents": "აგენტები"
},
"auth": {
"createYourAccount": "შექმენით თქვენი ანგარიში",
@@ -375,7 +376,29 @@
"quotaLimit": "ლიმიტი",
"quotaRemaining": "დარჩენილი",
"quotaReset": "გადატვირთვა",
- "quotaObserved": "დააკვირდა"
+ "quotaObserved": "დააკვირდა",
+ "tabAgents": "აგენტები",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini მოდელების მაპინგი",
+ "geminiDesc": "მიაბით Gemini Pro, Flash და Flash-Lite სახელები Auto-ს ან კონკრეტულ კატალოგის მოდელს.",
+ "compatibilityTitle": "აგენტების თავსებადობა",
+ "compatibilityDesc": "მართეთ არჩევითი თავსებადობის ზედაპირები და Claude Code მოდელების აღმოჩენა.",
+ "ollamaMode": "Ollama ემულაცია",
+ "ollamaModeHint": "ღია loopback არასოდეს იღებს არაავტორიზებულ LAN ტრაფიკს.",
+ "ollamaOff": "გამორთული",
+ "ollamaLoopback": "ღია loopback-ზე",
+ "ollamaKeyRequired": "საჭიროა API გასაღები",
+ "claudeAliases": "Claude Code აღმოჩენის ალიასები",
+ "claudeAliasesHint": "გამოაჩინეთ claude/<model> ალიასები, რომ გეითვეის მოდელის ამრჩევმა შეძლოს კატალოგის ჩამოთვლა.",
+ "urlTokensTitle": "გაუქმებადი URL ტოკენები",
+ "urlTokensDesc": "მხოლოდ ჰედერების გარეშე კლიენტებისთვის. URL ტოკენები შეიძლება მოხვდეს ისტორიასა და ჟურნალებში, ამიტომ გააუქმეთ ისინი, როცა აღარ გჭირდებათ.",
+ "urlTokenLabel": "ტოკენის ლეიბლი",
+ "createUrlToken": "ტოკენის შექმნა",
+ "urlTokenOnce": "დააკოპირეთ ეს ტოკენი ახლავე. ის აღარ გამოჩნდება.",
+ "revoked": "გაუქმებულია",
+ "revoke": "გაუქმება"
},
"status": {
"healthy": "ჯანსაღი",
@@ -454,7 +477,8 @@
"keyOrdinal": "გასაღები #{n}",
"attemptTimingHint": "ოფსეტის დაწყება მოთხოვნის დაწყებიდან · მცდელობის ხანგრძლივობა",
"requestedModel": "მოთხოვნილი მოდელი",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "მოთხოვნები აგენტების მიხედვით"
},
"playground": {
"title": "სათამაშო მოედანი",
@@ -674,5 +698,15 @@
"url": "შეიყვანეთ სწორი URL დაწყებული http:// ან https://-ით",
"email": "შეიყვანეთ სწორი ელფოსტის მისამართი",
"passwordMin": "მინიმუმ {min} სიმბოლო"
+ },
+ "agents": {
+ "title": "კოდირების აგენტები",
+ "description": "დააკავშირეთ კოდირების ხელსაწყოები ერთ უფასო მოდელების გეითვეისთან გენერირებული, სარეზერვო ასლისთვის უსაფრთხო კონფიგურაციით.",
+ "apiKey": "API გასაღები",
+ "quickstart": "ყველაზე სწრაფი გზა: დააკონფიგურირეთ Claude Code ცოცხალი კატალოგიდან.",
+ "currentKey": "მიმდინარე ერთიანი გასაღები:",
+ "seenRecently": "ბოლოს ნანახი",
+ "endpoint": "საბოლოო წერტილი",
+ "documentation": "დოკუმენტაცია"
}
}
diff --git a/client/src/i18n/locales/km.json b/client/src/i18n/locales/km.json
index a51bb1c4..7d6e4605 100644
--- a/client/src/i18n/locales/km.json
+++ b/client/src/i18n/locales/km.json
@@ -13,7 +13,8 @@
"switchDark": "ប្ដូរទៅប្រធានបទងងឹត",
"switchToChinese": "ប្ដូរទៅភាសាចិន",
"switchToEnglish": "ប្ដូរទៅភាសាអង់គ្លេស",
- "modelsMenu": "រុករកប្រភេទម៉ូដែល"
+ "modelsMenu": "រុករកប្រភេទម៉ូដែល",
+ "agents": "ភ្នាក់ងារ"
},
"auth": {
"createYourAccount": "បង្កើតគណនីរបស់អ្នក",
@@ -375,7 +376,29 @@
"quotaLimit": "ដែនកំណត់",
"quotaRemaining": "នៅសល់",
"quotaReset": "កំណត់ឡើងវិញ",
- "quotaObserved": "បានសង្កេត"
+ "quotaObserved": "បានសង្កេត",
+ "tabAgents": "ភ្នាក់ងារ",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "ការផ្គូផ្គងម៉ូដែល Gemini",
+ "geminiDesc": "ផ្គូផ្គងឈ្មោះ Gemini Pro, Flash និង Flash-Lite ទៅ Auto ឬម៉ូដែលកាតាឡុកជាក់លាក់មួយ។",
+ "compatibilityTitle": "ភាពឆបគ្នារបស់ភ្នាក់ងារ",
+ "compatibilityDesc": "គ្រប់គ្រងផ្ទៃភាពឆបគ្នាតាមជម្រើស និងការរកឃើញម៉ូដែល Claude Code។",
+ "ollamaMode": "ការត្រាប់តាម Ollama",
+ "ollamaModeHint": "Loopback បើកចំហ មិនដែលទទួលយកចរាចរណ៍ LAN ដែលមិនបានផ្ទៀងផ្ទាត់ទេ។",
+ "ollamaOff": "បិទ",
+ "ollamaLoopback": "បើកនៅលើ loopback",
+ "ollamaKeyRequired": "ត្រូវការកូនសោ API",
+ "claudeAliases": "ឈ្មោះក្លែងសម្រាប់ការរកឃើញ Claude Code",
+ "claudeAliasesHint": "បង្ហាញឈ្មោះក្លែង claude/<model> ដើម្បីឱ្យឧបករណ៍ជ្រើសរើសម៉ូដែលរបស់ gateway អាចរាយកាតាឡុកបាន។",
+ "urlTokensTitle": "Token URL ដែលអាចដកហូតបាន",
+ "urlTokensDesc": "សម្រាប់តែ client ដែលគ្មាន header ប៉ុណ្ណោះ។ Token URL អាចលេចធ្លាយចូលទៅក្នុងប្រវត្តិ និងកំណត់ហេតុ ដូច្នេះដកហូតវានៅពេលលែងត្រូវការ។",
+ "urlTokenLabel": "ស្លាក token",
+ "createUrlToken": "បង្កើត token",
+ "urlTokenOnce": "ចម្លង token នេះឥឡូវនេះ។ វានឹងមិនបង្ហាញម្តងទៀតទេ។",
+ "revoked": "បានដកហូត",
+ "revoke": "ដកហូត"
},
"status": {
"healthy": "មានសុខភាពល្អ",
@@ -454,7 +477,8 @@
"keyOrdinal": "#{n}",
"attemptTimingHint": "ចាប់ផ្តើមពីចំណុចចាប់ផ្តើម · រយៈពេលព្យាយាម",
"requestedModel": "ម៉ូដែលដែលបានស្នើសុំ",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "សំណើតាមភ្នាក់ងារ"
},
"playground": {
"title": "កន្លែងលេងក្មេង",
@@ -674,5 +698,15 @@
"url": "បញ្ចូល URL ដែលមានសុពលភាពចាប់ផ្តើមដោយ http:// ឬ https://",
"email": "បញ្ចូលអាសយដ្ឋានអ៊ីមែលត្រឹមត្រូវ",
"passwordMin": "យ៉ាងហោចណាស់ {min} តួអក្សរ"
+ },
+ "agents": {
+ "title": "ភ្នាក់ងារសរសេរកូដ",
+ "description": "ភ្ជាប់ឧបករណ៍សរសេរកូដទៅ gateway ម៉ូដែលឥតគិតថ្លៃតែមួយ ជាមួយការកំណត់រចនាសម្ព័ន្ធដែលបង្កើតដោយស្វ័យប្រវត្តិ និងមានសុវត្ថិភាពសម្រាប់ការបម្រុងទុក។",
+ "apiKey": "កូនសោ API",
+ "quickstart": "ផ្លូវលឿនបំផុត៖ កំណត់រចនាសម្ព័ន្ធ Claude Code ពីកាតាឡុកផ្ទាល់។",
+ "currentKey": "កូនសោរួមបច្ចុប្បន្ន៖",
+ "seenRecently": "បានឃើញថ្មីៗនេះ",
+ "endpoint": "ចំណុចបញ្ចប់",
+ "documentation": "ឯកសារ"
}
}
diff --git a/client/src/i18n/locales/kn.json b/client/src/i18n/locales/kn.json
index dd78f6cd..18e2a6b8 100644
--- a/client/src/i18n/locales/kn.json
+++ b/client/src/i18n/locales/kn.json
@@ -13,7 +13,8 @@
"switchDark": "ಡಾರ್ಕ್ ಥೀಮ್‌ಗೆ ಬದಲಿಸಿ",
"switchToChinese": "ಚೈನೀಸ್‌ಗೆ ಬದಲಿಸಿ",
"switchToEnglish": "ಇಂಗ್ಲಿಷ್‌ಗೆ ಬದಲಿಸಿ",
- "modelsMenu": "ಮಾದರಿ ಪ್ರಕಾರಗಳನ್ನು ಬ್ರೌಸ್ ಮಾಡಿ"
+ "modelsMenu": "ಮಾದರಿ ಪ್ರಕಾರಗಳನ್ನು ಬ್ರೌಸ್ ಮಾಡಿ",
+ "agents": "ಏಜೆಂಟ್‌ಗಳು"
},
"auth": {
"createYourAccount": "ನಿಮ್ಮ ಖಾತೆಯನ್ನು ರಚಿಸಿ",
@@ -375,7 +376,29 @@
"quotaLimit": "ಮಿತಿ",
"quotaRemaining": "ಉಳಿದಿದೆ",
"quotaReset": "ಮರುಹೊಂದಿಸಿ",
- "quotaObserved": "ಗಮನಿಸಿದೆ"
+ "quotaObserved": "ಗಮನಿಸಿದೆ",
+ "tabAgents": "ಏಜೆಂಟ್‌ಗಳು",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini ಮಾದರಿ ಮ್ಯಾಪಿಂಗ್",
+ "geminiDesc": "Gemini Pro, Flash ಮತ್ತು Flash-Lite ಹೆಸರುಗಳನ್ನು ಆಟೋ ಅಥವಾ ನಿರ್ದಿಷ್ಟ ಕ್ಯಾಟಲಾಗ್ ಮಾದರಿಗೆ ಮ್ಯಾಪ್ ಮಾಡಿ.",
+ "compatibilityTitle": "ಏಜೆಂಟ್ ಹೊಂದಾಣಿಕೆ",
+ "compatibilityDesc": "ಆಪ್ಟ್-ಇನ್ ಹೊಂದಾಣಿಕೆ ಮೇಲ್ಮೈಗಳು ಮತ್ತು Claude Code ಮಾದರಿ ಅನ್ವೇಷಣೆಯನ್ನು ನಿಯಂತ್ರಿಸಿ.",
+ "ollamaMode": "Ollama ಅನುಕರಣೆ",
+ "ollamaModeHint": "ತೆರೆದ ಲೂಪ್‌ಬ್ಯಾಕ್ ಎಂದಿಗೂ ದೃಢೀಕರಿಸದ LAN ಟ್ರಾಫಿಕ್ ಅನ್ನು ಸ್ವೀಕರಿಸುವುದಿಲ್ಲ.",
+ "ollamaOff": "ಆಫ್",
+ "ollamaLoopback": "ಲೂಪ್‌ಬ್ಯಾಕ್‌ನಲ್ಲಿ ತೆರೆದಿದೆ",
+ "ollamaKeyRequired": "API ಕೀ ಅಗತ್ಯವಿದೆ",
+ "claudeAliases": "Claude Code ಅನ್ವೇಷಣೆ ಅಲಿಯಾಸ್‌ಗಳು",
+ "claudeAliasesHint": "ಗೇಟ್‌ವೇ ಮಾದರಿ ಆಯ್ಕೆಗಾರ ಕ್ಯಾಟಲಾಗ್ ಅನ್ನು ಪಟ್ಟಿ ಮಾಡಲು claude/<model> ಅಲಿಯಾಸ್‌ಗಳನ್ನು ಬಹಿರಂಗಪಡಿಸಿ.",
+ "urlTokensTitle": "ಹಿಂಪಡೆಯಬಹುದಾದ URL ಟೋಕನ್‌ಗಳು",
+ "urlTokensDesc": "ಹೆಡರ್ ಇಲ್ಲದ ಕ್ಲೈಂಟ್‌ಗಳಿಗೆ ಮಾತ್ರ. URL ಟೋಕನ್‌ಗಳು ಇತಿಹಾಸ ಮತ್ತು ಲಾಗ್‌ಗಳಿಗೆ ಸೋರಿಕೆಯಾಗಬಹುದು, ಆದ್ದರಿಂದ ಅಗತ್ಯವಿಲ್ಲದಾಗ ಅವುಗಳನ್ನು ಹಿಂಪಡೆಯಿರಿ.",
+ "urlTokenLabel": "ಟೋಕನ್ ಲೇಬಲ್",
+ "createUrlToken": "ಟೋಕನ್ ರಚಿಸಿ",
+ "urlTokenOnce": "ಈ ಟೋಕನ್ ಅನ್ನು ಈಗಲೇ ನಕಲಿಸಿ. ಇದನ್ನು ಮತ್ತೆ ತೋರಿಸಲಾಗುವುದಿಲ್ಲ.",
+ "revoked": "ಹಿಂಪಡೆಯಲಾಗಿದೆ",
+ "revoke": "ಹಿಂಪಡೆಯಿರಿ"
},
"status": {
"healthy": "ಆರೋಗ್ಯಕರ",
@@ -454,7 +477,8 @@
"keyOrdinal": "ಕೀ #{n}",
"attemptTimingHint": "ವಿನಂತಿಯ ಪ್ರಾರಂಭದಿಂದ ಆಫ್‌ಸೆಟ್ ಪ್ರಾರಂಭಿಸಿ · ಪ್ರಯತ್ನದ ಅವಧಿ",
"requestedModel": "ವಿನಂತಿಸಿದ ಮಾದರಿ",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "ಏಜೆಂಟ್ ಪ್ರಕಾರ ವಿನಂತಿಗಳು"
},
"playground": {
"title": "ಆಟದ ಮೈದಾನ",
@@ -674,5 +698,15 @@
"url": "http:// ಅಥವಾ https:// ನೊಂದಿಗೆ ಪ್ರಾರಂಭವಾಗುವ ಮಾನ್ಯವಾದ URL ಅನ್ನು ನಮೂದಿಸಿ",
"email": "ಮಾನ್ಯವಾದ ಇಮೇಲ್ ವಿಳಾಸವನ್ನು ನಮೂದಿಸಿ",
"passwordMin": "ಕನಿಷ್ಠ {min} ಅಕ್ಷರಗಳು"
+ },
+ "agents": {
+ "title": "ಕೋಡಿಂಗ್ ಏಜೆಂಟ್‌ಗಳು",
+ "description": "ರಚಿಸಲಾದ, ಬ್ಯಾಕಪ್-ಸುರಕ್ಷಿತ ಕಾನ್ಫಿಗರೇಶನ್‌ನೊಂದಿಗೆ ಕೋಡಿಂಗ್ ಉಪಕರಣಗಳನ್ನು ಒಂದು ಉಚಿತ-ಮಾದರಿ ಗೇಟ್‌ವೇಗೆ ಸಂಪರ್ಕಿಸಿ.",
+ "apiKey": "API ಕೀ",
+ "quickstart": "ಅತಿ ವೇಗದ ಮಾರ್ಗ: ಲೈವ್ ಕ್ಯಾಟಲಾಗ್‌ನಿಂದ Claude Code ಅನ್ನು ಕಾನ್ಫಿಗರ್ ಮಾಡಿ.",
+ "currentKey": "ಪ್ರಸ್ತುತ ಏಕೀಕೃತ ಕೀ:",
+ "seenRecently": "ಇತ್ತೀಚೆಗೆ ಕಂಡುಬಂದಿದೆ",
+ "endpoint": "ಅಂತಿಮ ಬಿಂದು",
+ "documentation": "ದಾಖಲಾತಿ"
}
}
diff --git a/client/src/i18n/locales/ko.json b/client/src/i18n/locales/ko.json
index f89373de..c007b260 100644
--- a/client/src/i18n/locales/ko.json
+++ b/client/src/i18n/locales/ko.json
@@ -13,7 +13,8 @@
"switchDark": "어두운 테마로 전환",
"switchToChinese": "중국어로 전환",
"switchToEnglish": "영어로 전환",
- "modelsMenu": "모델 유형 찾아보기"
+ "modelsMenu": "모델 유형 찾아보기",
+ "agents": "에이전트"
},
"auth": {
"createYourAccount": "계정 만들기",
@@ -375,7 +376,29 @@
"quotaLimit": "한도",
"quotaRemaining": "남은",
"quotaReset": "재설정",
- "quotaObserved": "관찰됨"
+ "quotaObserved": "관찰됨",
+ "tabAgents": "에이전트",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini 모델 매핑",
+ "geminiDesc": "Gemini Pro, Flash, Flash-Lite 이름을 자동 또는 특정 카탈로그 모델에 매핑합니다.",
+ "compatibilityTitle": "에이전트 호환성",
+ "compatibilityDesc": "옵트인 호환성 표면과 Claude Code 모델 검색을 제어합니다.",
+ "ollamaMode": "Ollama 에뮬레이션",
+ "ollamaModeHint": "오픈 루프백은 인증되지 않은 LAN 트래픽을 절대 허용하지 않습니다.",
+ "ollamaOff": "끄기",
+ "ollamaLoopback": "루프백에서 열기",
+ "ollamaKeyRequired": "API 키 필요",
+ "claudeAliases": "Claude Code 검색 별칭",
+ "claudeAliasesHint": "claude/<model> 별칭을 노출하여 게이트웨이 모델 선택기가 카탈로그를 나열할 수 있게 합니다.",
+ "urlTokensTitle": "취소 가능한 URL 토큰",
+ "urlTokensDesc": "헤더를 쓸 수 없는 클라이언트 전용입니다. URL 토큰은 기록과 로그에 유출될 수 있으므로 더 이상 필요하지 않으면 취소하세요.",
+ "urlTokenLabel": "토큰 라벨",
+ "createUrlToken": "토큰 생성",
+ "urlTokenOnce": "이 토큰을 지금 복사하세요. 다시 표시되지 않습니다.",
+ "revoked": "취소됨",
+ "revoke": "취소"
},
"status": {
"healthy": "건강한",
@@ -454,7 +477,8 @@
"keyOrdinal": "키 #{n}",
"attemptTimingHint": "요청 시작부터 시작 오프셋 · 시도 기간",
"requestedModel": "요청 모델",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "에이전트별 요청"
},
"playground": {
"title": "놀이터",
@@ -674,5 +698,15 @@
"url": "http:// 또는 https://로 시작하는 유효한 URL를 입력하세요.",
"email": "유효한 이메일 주소를 입력하세요.",
"passwordMin": "{min}자 이상"
+ },
+ "agents": {
+ "title": "코딩 에이전트",
+ "description": "자동 생성되고 백업에 안전한 구성으로 코딩 도구를 하나의 무료 모델 게이트웨이에 연결하세요.",
+ "apiKey": "API 키",
+ "quickstart": "가장 빠른 방법: 라이브 카탈로그에서 Claude Code를 구성하세요.",
+ "currentKey": "현재 통합 키:",
+ "seenRecently": "최근 확인됨",
+ "endpoint": "엔드포인트",
+ "documentation": "문서"
}
}
diff --git a/client/src/i18n/locales/lt.json b/client/src/i18n/locales/lt.json
index 3db5e09d..60b5084f 100644
--- a/client/src/i18n/locales/lt.json
+++ b/client/src/i18n/locales/lt.json
@@ -13,7 +13,8 @@
"switchDark": "Pereikite prie tamsios temos",
"switchToChinese": "Perėjimas prie kinų kalbos",
"switchToEnglish": "Perėjimas prie anglų kalbos",
- "modelsMenu": "Naršyti modelių tipus"
+ "modelsMenu": "Naršyti modelių tipus",
+ "agents": "Agentai"
},
"auth": {
"createYourAccount": "Sukurkite savo paskyrą",
@@ -375,7 +376,29 @@
"quotaLimit": "Riba",
"quotaRemaining": "Likę",
"quotaReset": "Atstatymas",
- "quotaObserved": "Stebėta"
+ "quotaObserved": "Stebėta",
+ "tabAgents": "Agentai",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini modelių susiejimas",
+ "geminiDesc": "Susiekite Gemini Pro, Flash ir Flash-Lite pavadinimus su Auto arba konkrečiu katalogo modeliu.",
+ "compatibilityTitle": "Agentų suderinamumas",
+ "compatibilityDesc": "Valdykite pasirenkamus suderinamumo paviršius ir Claude Code modelių aptikimą.",
+ "ollamaMode": "Ollama emuliacija",
+ "ollamaModeHint": "Atviras loopback niekada nepriima neautentifikuoto LAN srauto.",
+ "ollamaOff": "Išjungta",
+ "ollamaLoopback": "Atvira per loopback",
+ "ollamaKeyRequired": "Reikalingas API raktas",
+ "claudeAliases": "Claude Code aptikimo aliasai",
+ "claudeAliasesHint": "Atskleiskite claude/<model> aliasus, kad šliuzo modelių parinkiklis galėtų pateikti katalogą.",
+ "urlTokensTitle": "Atšaukiami URL žetonai",
+ "urlTokensDesc": "Tik klientams be antraščių. URL žetonai gali nutekėti į istoriją ir žurnalus, todėl atšaukite juos, kai nebereikia.",
+ "urlTokenLabel": "Žetono etiketė",
+ "createUrlToken": "Sukurti žetoną",
+ "urlTokenOnce": "Nukopijuokite šį žetoną dabar. Jis daugiau nebus rodomas.",
+ "revoked": "Atšaukta",
+ "revoke": "Atšaukti"
},
"status": {
"healthy": "Sveika",
@@ -454,7 +477,8 @@
"keyOrdinal": "Pagrindinė #{n}",
"attemptTimingHint": "Pradėti poslinkį nuo užklausos pradžios · Bandymo trukmė",
"requestedModel": "Prašytas modelis",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Užklausos pagal agentą"
},
"playground": {
"title": "Žaidimų aikštelė",
@@ -674,5 +698,15 @@
"url": "Įveskite galiojančią URL, prasidedančią http:// arba https://",
"email": "Įveskite galiojantį el. pašto adresą",
"passwordMin": "Bent jau {min} veikėjų"
+ },
+ "agents": {
+ "title": "Kodavimo agentai",
+ "description": "Prijunkite kodavimo įrankius prie vieno nemokamų modelių šliuzo su sugeneruota, atsarginėms kopijoms saugia konfigūracija.",
+ "apiKey": "API raktas",
+ "quickstart": "Greičiausias kelias: sukonfigūruokite Claude Code iš tiesioginio katalogo.",
+ "currentKey": "Dabartinis vieningas raktas:",
+ "seenRecently": "Neseniai matytas",
+ "endpoint": "Galinis taškas",
+ "documentation": "Dokumentacija"
}
}
diff --git a/client/src/i18n/locales/ml.json b/client/src/i18n/locales/ml.json
index 45e2dd2c..5d677247 100644
--- a/client/src/i18n/locales/ml.json
+++ b/client/src/i18n/locales/ml.json
@@ -13,7 +13,8 @@
"switchDark": "ഇരുണ്ട തീമിലേക്ക് മാറുക",
"switchToChinese": "ചൈനീസ് ഭാഷയിലേക്ക് മാറുക",
"switchToEnglish": "ഇംഗ്ലീഷിലേക്ക് മാറുക",
- "modelsMenu": "മോഡൽ തരങ്ങൾ ബ്രൗസ് ചെയ്യുക"
+ "modelsMenu": "മോഡൽ തരങ്ങൾ ബ്രൗസ് ചെയ്യുക",
+ "agents": "ഏജൻ്റുകൾ"
},
"auth": {
"createYourAccount": "നിങ്ങളുടെ അക്കൗണ്ട് സൃഷ്ടിക്കുക",
@@ -375,7 +376,29 @@
"quotaLimit": "പരിധി",
"quotaRemaining": "ശേഷിക്കുന്നത്",
"quotaReset": "പുനഃസജ്ജമാക്കുക",
- "quotaObserved": "നിരീക്ഷിച്ചു"
+ "quotaObserved": "നിരീക്ഷിച്ചു",
+ "tabAgents": "ഏജൻ്റുകൾ",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini മോഡൽ മാപ്പിംഗ്",
+ "geminiDesc": "Gemini Pro, Flash, Flash-Lite പേരുകൾ ഓട്ടോയിലേക്കോ ഒരു നിർദ്ദിഷ്ട കാറ്റലോഗ് മോഡലിലേക്കോ മാപ്പ് ചെയ്യുക.",
+ "compatibilityTitle": "ഏജൻ്റ് അനുയോജ്യത",
+ "compatibilityDesc": "ഓപ്റ്റ്-ഇൻ അനുയോജ്യതാ ഉപരിതലങ്ങളും Claude Code മോഡൽ കണ്ടെത്തലും നിയന്ത്രിക്കുക.",
+ "ollamaMode": "Ollama അനുകരണം",
+ "ollamaModeHint": "ഓപ്പൺ-ലൂപ്പ്ബാക്ക് ഒരിക്കലും ആധികാരികമാക്കാത്ത LAN ട്രാഫിക് സ്വീകരിക്കില്ല.",
+ "ollamaOff": "ഓഫ്",
+ "ollamaLoopback": "ലൂപ്പ്ബാക്കിൽ തുറന്നിരിക്കുന്നു",
+ "ollamaKeyRequired": "API കീ ആവശ്യമാണ്",
+ "claudeAliases": "Claude Code കണ്ടെത്തൽ അപരനാമങ്ങൾ",
+ "claudeAliasesHint": "ഗേറ്റ്‌വേ മോഡൽ പിക്കറിന് കാറ്റലോഗ് ലിസ്റ്റ് ചെയ്യാൻ claude/<model> അപരനാമങ്ങൾ തുറന്നുകൊടുക്കുക.",
+ "urlTokensTitle": "റദ്ദാക്കാവുന്ന URL ടോക്കണുകൾ",
+ "urlTokensDesc": "ഹെഡർ ഇല്ലാത്ത ക്ലയൻ്റുകൾക്ക് മാത്രം. URL ടോക്കണുകൾ ചരിത്രത്തിലേക്കും ലോഗുകളിലേക്കും ചോർന്നേക്കാം, അതിനാൽ ആവശ്യമില്ലാതാകുമ്പോൾ അവ റദ്ദാക്കുക.",
+ "urlTokenLabel": "ടോക്കൺ ലേബൽ",
+ "createUrlToken": "ടോക്കൺ സൃഷ്ടിക്കുക",
+ "urlTokenOnce": "ഈ ടോക്കൺ ഇപ്പോൾ പകർത്തുക. ഇത് വീണ്ടും കാണിക്കില്ല.",
+ "revoked": "റദ്ദാക്കി",
+ "revoke": "റദ്ദാക്കുക"
},
"status": {
"healthy": "ആരോഗ്യമുള്ള",
@@ -454,7 +477,8 @@
"keyOrdinal": "കീ #{n}",
"attemptTimingHint": "അഭ്യർത്ഥന ആരംഭത്തിൽ നിന്ന് ഓഫ്സെറ്റ് ആരംഭിക്കുക · ശ്രമ കാലയളവ്",
"requestedModel": "അഭ്യർത്ഥിച്ച മോഡൽ",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "ഏജൻ്റ് അനുസരിച്ചുള്ള അഭ്യർത്ഥനകൾ"
},
"playground": {
"title": "കളിസ്ഥലം",
@@ -674,5 +698,15 @@
"url": "http:// അല്ലെങ്കിൽ https:// എന്നതിൽ ആരംഭിക്കുന്ന സാധുവായ URL നൽകുക",
"email": "സാധുവായ ഒരു ഇമെയിൽ വിലാസം നൽകുക",
"passwordMin": "കുറഞ്ഞത് {min} പ്രതീകങ്ങളെങ്കിലും"
+ },
+ "agents": {
+ "title": "കോഡിംഗ് ഏജൻ്റുകൾ",
+ "description": "ജനറേറ്റ് ചെയ്ത, ബാക്കപ്പ്-സുരക്ഷിത കോൺഫിഗറേഷനോടെ കോഡിംഗ് ടൂളുകൾ ഒരു സൗജന്യ-മോഡൽ ഗേറ്റ്‌വേയിലേക്ക് ബന്ധിപ്പിക്കുക.",
+ "apiKey": "API കീ",
+ "quickstart": "ഏറ്റവും വേഗമേറിയ വഴി: ലൈവ് കാറ്റലോഗിൽ നിന്ന് Claude Code കോൺഫിഗർ ചെയ്യുക.",
+ "currentKey": "നിലവിലെ ഏകീകൃത കീ:",
+ "seenRecently": "അടുത്തിടെ കണ്ടു",
+ "endpoint": "എൻഡ്‌പോയിൻ്റ്",
+ "documentation": "ഡോക്യുമെൻ്റേഷൻ"
}
}
diff --git a/client/src/i18n/locales/mr.json b/client/src/i18n/locales/mr.json
index 46878434..aacd9dd0 100644
--- a/client/src/i18n/locales/mr.json
+++ b/client/src/i18n/locales/mr.json
@@ -13,7 +13,8 @@
"switchDark": "गडद थीमवर स्विच करा",
"switchToChinese": "चीनी वर स्विच करा",
"switchToEnglish": "इंग्रजीवर स्विच करा",
- "modelsMenu": "मॉडेल प्रकार ब्राउझ करा"
+ "modelsMenu": "मॉडेल प्रकार ब्राउझ करा",
+ "agents": "एजंट"
},
"auth": {
"createYourAccount": "तुमचे खाते तयार करा",
@@ -375,7 +376,29 @@
"quotaLimit": "मर्यादा",
"quotaRemaining": "बाकी",
"quotaReset": "रीसेट करा",
- "quotaObserved": "निरीक्षण केले"
+ "quotaObserved": "निरीक्षण केले",
+ "tabAgents": "एजंट",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini मॉडेल मॅपिंग",
+ "geminiDesc": "Gemini Pro, Flash आणि Flash-Lite नावे ऑटो किंवा विशिष्ट कॅटलॉग मॉडेलवर मॅप करा.",
+ "compatibilityTitle": "एजंट सुसंगतता",
+ "compatibilityDesc": "ऑप्ट-इन सुसंगतता पृष्ठभाग आणि Claude Code मॉडेल शोध नियंत्रित करा.",
+ "ollamaMode": "Ollama अनुकरण",
+ "ollamaModeHint": "ओपन-लूपबॅक कधीही अप्रमाणित LAN रहदारी स्वीकारत नाही.",
+ "ollamaOff": "बंद",
+ "ollamaLoopback": "लूपबॅकवर खुले",
+ "ollamaKeyRequired": "API की आवश्यक",
+ "claudeAliases": "Claude Code शोध उपनावे",
+ "claudeAliasesHint": "गेटवे मॉडेल निवडकर्ता कॅटलॉग सूचीबद्ध करू शकेल यासाठी claude/<model> उपनावे उघड करा.",
+ "urlTokensTitle": "रद्द करण्यायोग्य URL टोकन",
+ "urlTokensDesc": "फक्त हेडर-रहित क्लायंटसाठी. URL टोकन इतिहास आणि लॉगमध्ये गळती होऊ शकतात, म्हणून गरज नसताना ती रद्द करा.",
+ "urlTokenLabel": "टोकन लेबल",
+ "createUrlToken": "टोकन तयार करा",
+ "urlTokenOnce": "हे टोकन आत्ताच कॉपी करा. ते पुन्हा दाखवले जाणार नाही.",
+ "revoked": "रद्द केले",
+ "revoke": "रद्द करा"
},
"status": {
"healthy": "निरोगी",
@@ -454,7 +477,8 @@
"keyOrdinal": "की #{n}",
"attemptTimingHint": "विनंती पासून ऑफसेट सुरू करा प्रारंभ · प्रयत्न कालावधी",
"requestedModel": "मॉडेलची विनंती केली",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "एजंटनुसार विनंत्या"
},
"playground": {
"title": "खेळाचे मैदान",
@@ -674,5 +698,15 @@
"url": "http:// किंवा https:// ने सुरू होणारे वैध URL प्रविष्ट करा",
"email": "एक वैध ईमेल पत्ता प्रविष्ट करा",
"passwordMin": "किमान {min} वर्ण"
+ },
+ "agents": {
+ "title": "कोडिंग एजंट",
+ "description": "जनरेट केलेल्या, बॅकअप-सुरक्षित कॉन्फिगरेशनसह कोडिंग साधने एका मोफत-मॉडेल गेटवेशी जोडा.",
+ "apiKey": "API की",
+ "quickstart": "सर्वात जलद मार्ग: लाइव्ह कॅटलॉगमधून Claude Code कॉन्फिगर करा.",
+ "currentKey": "सध्याची युनिफाइड की:",
+ "seenRecently": "अलीकडे पाहिले",
+ "endpoint": "एंडपॉइंट",
+ "documentation": "दस्तऐवजीकरण"
}
}
diff --git a/client/src/i18n/locales/ms.json b/client/src/i18n/locales/ms.json
index 2d5fe9c8..e79e66f9 100644
--- a/client/src/i18n/locales/ms.json
+++ b/client/src/i18n/locales/ms.json
@@ -13,7 +13,8 @@
"switchDark": "Beralih ke tema gelap",
"switchToChinese": "Beralih ke Bahasa Cina",
"switchToEnglish": "Beralih ke Bahasa Inggeris",
- "modelsMenu": "Semak jenis model"
+ "modelsMenu": "Semak jenis model",
+ "agents": "Ejen"
},
"auth": {
"createYourAccount": "Cipta akaun anda",
@@ -375,7 +376,29 @@
"quotaLimit": "Had",
"quotaRemaining": "Baki",
"quotaReset": "Tetapkan Semula",
- "quotaObserved": "diperhatikan"
+ "quotaObserved": "diperhatikan",
+ "tabAgents": "Ejen",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Pemetaan model Gemini",
+ "geminiDesc": "Petakan nama Gemini Pro, Flash dan Flash-Lite kepada Auto atau model katalog tertentu.",
+ "compatibilityTitle": "Keserasian ejen",
+ "compatibilityDesc": "Kawal permukaan keserasian pilihan dan penemuan model Claude Code.",
+ "ollamaMode": "Emulasi Ollama",
+ "ollamaModeHint": "Loopback terbuka tidak sekali-kali menerima trafik LAN yang tidak disahkan.",
+ "ollamaOff": "Mati",
+ "ollamaLoopback": "Terbuka pada loopback",
+ "ollamaKeyRequired": "Kunci API diperlukan",
+ "claudeAliases": "Alias penemuan Claude Code",
+ "claudeAliasesHint": "Dedahkan alias claude/<model> supaya pemilih model gateway dapat menyenaraikan katalog.",
+ "urlTokensTitle": "Token URL boleh dibatalkan",
+ "urlTokensDesc": "Untuk klien tanpa pengepala sahaja. Token URL boleh bocor ke dalam sejarah dan log, jadi batalkannya apabila tidak lagi diperlukan.",
+ "urlTokenLabel": "Label token",
+ "createUrlToken": "Cipta token",
+ "urlTokenOnce": "Salin token ini sekarang. Ia tidak akan dipaparkan lagi.",
+ "revoked": "Dibatalkan",
+ "revoke": "Batalkan"
},
"status": {
"healthy": "sihat",
@@ -454,7 +477,8 @@
"keyOrdinal": "#{n} utama",
"attemptTimingHint": "Offset mula dari permintaan mula · tempoh cubaan",
"requestedModel": "Model yang diminta",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Permintaan mengikut ejen"
},
"playground": {
"title": "Taman Permainan",
@@ -674,5 +698,15 @@
"url": "Masukkan URL yang sah bermula dengan http:// atau https://",
"email": "Masukkan alamat emel yang sah",
"passwordMin": "Sekurang-kurangnya {min} watak"
+ },
+ "agents": {
+ "title": "Ejen pengekodan",
+ "description": "Sambungkan alat pengekodan kepada satu gateway model percuma dengan konfigurasi terjana yang selamat untuk sandaran.",
+ "apiKey": "Kunci API",
+ "quickstart": "Laluan terpantas: konfigurasikan Claude Code daripada katalog langsung.",
+ "currentKey": "Kunci bersatu semasa:",
+ "seenRecently": "Dilihat baru-baru ini",
+ "endpoint": "Titik akhir",
+ "documentation": "Dokumentasi"
}
}
diff --git a/client/src/i18n/locales/my.json b/client/src/i18n/locales/my.json
index b113a842..bf4fc29f 100644
--- a/client/src/i18n/locales/my.json
+++ b/client/src/i18n/locales/my.json
@@ -13,7 +13,8 @@
"switchDark": "အမှောင်အကြောင်းအရာသို့ ပြောင်းပါ",
"switchToChinese": "တရုတ်ဘာသာသို့ ပြောင်းရန်",
"switchToEnglish": "အင်္ဂလိပ်သို့ ပြောင်းပါ",
- "modelsMenu": "မော်ဒယ်အမျိုးအစားများကို ကြည့်ရှုပါ"
+ "modelsMenu": "မော်ဒယ်အမျိုးအစားများကို ကြည့်ရှုပါ",
+ "agents": "အေးဂျင့်များ"
},
"auth": {
"createYourAccount": "သင့်အကောင့်ကို ဖန်တီးပါ",
@@ -375,7 +376,29 @@
"quotaLimit": "ကန့်သတ်ချက်",
"quotaRemaining": "ကျန်ရှိသော",
"quotaReset": "Reset လုပ်ပါ",
- "quotaObserved": "ကြည့်ရှုခဲ့သည်"
+ "quotaObserved": "ကြည့်ရှုခဲ့သည်",
+ "tabAgents": "အေးဂျင့်များ",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini မော်ဒယ် ချိတ်ဆက်သတ်မှတ်ခြင်း",
+ "geminiDesc": "Gemini Pro၊ Flash နှင့် Flash-Lite အမည်များကို Auto သို့မဟုတ် သတ်မှတ်ထားသော catalog မော်ဒယ်တစ်ခုသို့ ချိတ်ဆက်သတ်မှတ်ပါ။",
+ "compatibilityTitle": "အေးဂျင့် လိုက်ဖက်မှု",
+ "compatibilityDesc": "ရွေးချယ်ဝင်ရောက်နိုင်သော လိုက်ဖက်မှုမျက်နှာပြင်များနှင့် Claude Code မော်ဒယ်ရှာဖွေမှုကို ထိန်းချုပ်ပါ။",
+ "ollamaMode": "Ollama တုပမှု",
+ "ollamaModeHint": "ဖွင့်ထားသော loopback သည် အထောက်အထားမစိစစ်ထားသော LAN အသွားအလာကို ဘယ်တော့မှ လက်မခံပါ။",
+ "ollamaOff": "ပိတ်",
+ "ollamaLoopback": "Loopback ပေါ်တွင် ဖွင့်ရန်",
+ "ollamaKeyRequired": "API ကီး လိုအပ်သည်",
+ "claudeAliases": "Claude Code ရှာဖွေမှု အမည်ပွားများ",
+ "claudeAliasesHint": "Gateway မော်ဒယ်ရွေးချယ်ကိရိယာက catalog ကို စာရင်းပြနိုင်ရန် claude/<model> အမည်ပွားများကို ဖော်ပြပေးပါ။",
+ "urlTokensTitle": "ရုပ်သိမ်းနိုင်သော URL တိုကင်များ",
+ "urlTokensDesc": "Header မပါသော client များအတွက်သာ ဖြစ်သည်။ URL တိုကင်များသည် မှတ်တမ်းနှင့် log များထဲသို့ ပေါက်ကြားနိုင်သဖြင့် မလိုအပ်တော့ပါက ရုပ်သိမ်းပါ။",
+ "urlTokenLabel": "တိုကင် တံဆိပ်",
+ "createUrlToken": "တိုကင် ဖန်တီးရန်",
+ "urlTokenOnce": "ဤတိုကင်ကို ယခုပင် ကူးယူပါ။ နောက်ထပ် ပြသမည် မဟုတ်ပါ။",
+ "revoked": "ရုပ်သိမ်းပြီး",
+ "revoke": "ရုပ်သိမ်းရန်"
},
"status": {
"healthy": "ကျန်းမာသော",
@@ -454,7 +477,8 @@
"keyOrdinal": "သော့ #{n}",
"attemptTimingHint": "တောင်းဆိုမှုစတင်ချိန်မှ စတင်အော့ဖ်ဆက် · ကြိုးစားမှုကြာချိန်",
"requestedModel": "တောင်းဆိုထားသော မော်ဒယ်",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "အေးဂျင့်အလိုက် တောင်းဆိုမှုများ"
},
"playground": {
"title": "ကစားကွင်း",
@@ -674,5 +698,15 @@
"url": "URL http:// သို့မဟုတ် https://",
"email": "မှန်ကန်သော အီးမေးလ်လိပ်စာ ထည့်ပါ",
"passwordMin": "အနည်းဆုံး {min}"
+ },
+ "agents": {
+ "title": "ကုဒ်ရေး အေးဂျင့်များ",
+ "description": "ကုဒ်ရေးကိရိယာများကို အလိုအလျောက်ထုတ်ပေးထားပြီး အရန်သိမ်းရန် စိတ်ချရသော configuration ဖြင့် အခမဲ့မော်ဒယ် gateway တစ်ခုတည်းသို့ ချိတ်ဆက်ပါ။",
+ "apiKey": "API ကီး",
+ "quickstart": "အမြန်ဆုံးနည်းလမ်း: တိုက်ရိုက် catalog မှ Claude Code ကို ပြင်ဆင်သတ်မှတ်ပါ။",
+ "currentKey": "လက်ရှိ ပေါင်းစည်းထားသောကီး:",
+ "seenRecently": "မကြာသေးမီက တွေ့ရှိထားသည်",
+ "endpoint": "Endpoint",
+ "documentation": "စာရွက်စာတမ်းများ"
}
}
diff --git a/client/src/i18n/locales/ne.json b/client/src/i18n/locales/ne.json
index 9454e073..7275fe8b 100644
--- a/client/src/i18n/locales/ne.json
+++ b/client/src/i18n/locales/ne.json
@@ -13,7 +13,8 @@
"switchDark": "गाढा विषयवस्तुमा स्विच गर्नुहोस्",
"switchToChinese": "चिनियाँमा स्विच गर्नुहोस्",
"switchToEnglish": "अङ्ग्रेजीमा स्विच गर्नुहोस्",
- "modelsMenu": "नमूना प्रकार ब्राउज गर्नुहोस्"
+ "modelsMenu": "नमूना प्रकार ब्राउज गर्नुहोस्",
+ "agents": "एजेन्टहरू"
},
"auth": {
"createYourAccount": "तपाईँको खाता सिर्जना गर्नुहोस्",
@@ -375,7 +376,29 @@
"quotaLimit": "सीमा",
"quotaRemaining": "बाँकी",
"quotaReset": "रिसेट गर्नुहोस्",
- "quotaObserved": "अवलोकन गरियो"
+ "quotaObserved": "अवलोकन गरियो",
+ "tabAgents": "एजेन्टहरू",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini मोडेल म्यापिङ",
+ "geminiDesc": "Gemini Pro, Flash र Flash-Lite नामहरूलाई Auto वा कुनै निश्चित क्याटलग मोडेलमा म्याप गर्नुहोस्।",
+ "compatibilityTitle": "एजेन्ट अनुकूलता",
+ "compatibilityDesc": "ऐच्छिक अनुकूलता सतहहरू र Claude Code मोडेल खोज नियन्त्रण गर्नुहोस्।",
+ "ollamaMode": "Ollama इमुलेसन",
+ "ollamaModeHint": "खुला लुपब्याकले प्रमाणीकरण नगरिएको LAN ट्राफिक कहिल्यै स्वीकार गर्दैन।",
+ "ollamaOff": "बन्द",
+ "ollamaLoopback": "लुपब्याकमा खुला",
+ "ollamaKeyRequired": "API कुञ्जी आवश्यक",
+ "claudeAliases": "Claude Code खोज उपनामहरू",
+ "claudeAliasesHint": "गेटवे मोडेल चयनकर्ताले क्याटलग सूचीबद्ध गर्न सकोस् भनेर claude/<model> उपनामहरू उपलब्ध गराउनुहोस्।",
+ "urlTokensTitle": "रद्द गर्न सकिने URL टोकनहरू",
+ "urlTokensDesc": "हेडरविहीन क्लाइन्टहरूका लागि मात्र। URL टोकनहरू इतिहास र लगहरूमा चुहिन सक्छन्, त्यसैले आवश्यक नपरेपछि रद्द गर्नुहोस्।",
+ "urlTokenLabel": "टोकन लेबल",
+ "createUrlToken": "टोकन सिर्जना गर्नुहोस्",
+ "urlTokenOnce": "यो टोकन अहिले नै प्रतिलिपि गर्नुहोस्। यो फेरि देखाइने छैन।",
+ "revoked": "रद्द गरिएको",
+ "revoke": "रद्द गर्नुहोस्"
},
"status": {
"healthy": "स्वस्थ छ",
@@ -454,7 +477,8 @@
"keyOrdinal": "कुञ्जी #{n}",
"attemptTimingHint": "अनुरोध सुरुबाट अफसेट सुरु गर्नुहोस् · प्रयास अवधि",
"requestedModel": "अनुरोध गरिएको नमूना",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "एजेन्टद्वारा अनुरोधहरू"
},
"playground": {
"title": "खेल मैदान[सम्पादन गर्ने]",
@@ -674,5 +698,15 @@
"url": "http:// वा https:// सँग सुरु भएको वैध URL प्रविष्ट गर्नुहोस्",
"email": "वैध इमेल ठेगाना प्रविष्ट गर्नुहोस्",
"passwordMin": "कम्तिमा {min} क्यारेक्टरहरू"
+ },
+ "agents": {
+ "title": "कोडिङ एजेन्टहरू",
+ "description": "कोडिङ उपकरणहरूलाई स्वतः सिर्जना गरिएको, ब्याकअप-सुरक्षित कन्फिगरेसनसहित एउटै नि:शुल्क-मोडेल गेटवेमा जोड्नुहोस्।",
+ "apiKey": "API कुञ्जी",
+ "quickstart": "सबैभन्दा छिटो बाटो: प्रत्यक्ष क्याटलगबाट Claude Code कन्फिगर गर्नुहोस्।",
+ "currentKey": "हालको एकीकृत कुञ्जी:",
+ "seenRecently": "भर्खरै देखिएको",
+ "endpoint": "एन्डपोइन्ट",
+ "documentation": "दस्तावेज"
}
}
diff --git a/client/src/i18n/locales/nl.json b/client/src/i18n/locales/nl.json
index 0c0f377e..f026d289 100644
--- a/client/src/i18n/locales/nl.json
+++ b/client/src/i18n/locales/nl.json
@@ -13,7 +13,8 @@
"switchDark": "Overschakelen naar donker thema",
"switchToChinese": "Overstappen naar Chinees",
"switchToEnglish": "Overstap naar Engels",
- "modelsMenu": "Blader door modeltypes"
+ "modelsMenu": "Blader door modeltypes",
+ "agents": "Agenten"
},
"auth": {
"createYourAccount": "Maak je account aan",
@@ -375,7 +376,29 @@
"quotaLimit": "Limiet",
"quotaRemaining": "Overige",
"quotaReset": "Reset",
- "quotaObserved": "Geobserveerd"
+ "quotaObserved": "Geobserveerd",
+ "tabAgents": "Agenten",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini-modeltoewijzing",
+ "geminiDesc": "Wijs de namen Gemini Pro, Flash en Flash-Lite toe aan Auto of een specifiek catalogusmodel.",
+ "compatibilityTitle": "Agentcompatibiliteit",
+ "compatibilityDesc": "Beheer optionele compatibiliteitsfuncties en Claude Code-modeldetectie.",
+ "ollamaMode": "Ollama-emulatie",
+ "ollamaModeHint": "Open loopback accepteert nooit niet-geauthenticeerd LAN-verkeer.",
+ "ollamaOff": "Uit",
+ "ollamaLoopback": "Open op loopback",
+ "ollamaKeyRequired": "API-sleutel vereist",
+ "claudeAliases": "Claude Code-detectiealiassen",
+ "claudeAliasesHint": "Stel claude/<model>-aliassen beschikbaar zodat de modelkiezer van de gateway de catalogus kan tonen.",
+ "urlTokensTitle": "Intrekbare URL-tokens",
+ "urlTokensDesc": "Alleen voor clients zonder headers. URL-tokens kunnen in geschiedenis en logs terechtkomen, dus trek ze in zodra ze niet meer nodig zijn.",
+ "urlTokenLabel": "Tokenlabel",
+ "createUrlToken": "Token aanmaken",
+ "urlTokenOnce": "Kopieer dit token nu. Het wordt niet opnieuw getoond.",
+ "revoked": "Ingetrokken",
+ "revoke": "Intrekken"
},
"status": {
"healthy": "Gezond",
@@ -454,7 +477,8 @@
"keyOrdinal": "Belangrijke #{n}",
"attemptTimingHint": "Start offset van verzoek start · Duur van de poging",
"requestedModel": "Aangevraagd model",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Verzoeken per agent"
},
"playground": {
"title": "Speeltuin",
@@ -674,5 +698,15 @@
"url": "Voer een geldige URL in die begint met http:// of https://",
"email": "Voer een geldig e-mailadres in",
"passwordMin": "Tenminste {min} personages"
+ },
+ "agents": {
+ "title": "Codeeragenten",
+ "description": "Verbind codeertools met één gateway voor gratis modellen, met gegenereerde, back-upveilige configuratie.",
+ "apiKey": "API-sleutel",
+ "quickstart": "Snelste route: configureer Claude Code vanuit de live catalogus.",
+ "currentKey": "Huidige uniforme sleutel:",
+ "seenRecently": "Onlangs gezien",
+ "endpoint": "Endpoint",
+ "documentation": "Documentatie"
}
}
diff --git a/client/src/i18n/locales/no.json b/client/src/i18n/locales/no.json
index 408b8234..af4335da 100644
--- a/client/src/i18n/locales/no.json
+++ b/client/src/i18n/locales/no.json
@@ -13,7 +13,8 @@
"switchDark": "Bytt til mørkt tema",
"switchToChinese": "Overgang til kinesisk",
"switchToEnglish": "Bytte til engelsk",
- "modelsMenu": "Bla gjennom modelltyper"
+ "modelsMenu": "Bla gjennom modelltyper",
+ "agents": "Agenter"
},
"auth": {
"createYourAccount": "Opprett kontoen din",
@@ -375,7 +376,29 @@
"quotaLimit": "Grense",
"quotaRemaining": "Gjenværende",
"quotaReset": "Tilbakestilling",
- "quotaObserved": "Observert"
+ "quotaObserved": "Observert",
+ "tabAgents": "Agenter",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini-modelltilordning",
+ "geminiDesc": "Tilordne navnene Gemini Pro, Flash og Flash-Lite til Auto eller en bestemt katalogmodell.",
+ "compatibilityTitle": "Agentkompatibilitet",
+ "compatibilityDesc": "Styr valgfrie kompatibilitetsflater og modelloppdaging for Claude Code.",
+ "ollamaMode": "Ollama-emulering",
+ "ollamaModeHint": "Åpen loopback godtar aldri uautentisert LAN-trafikk.",
+ "ollamaOff": "Av",
+ "ollamaLoopback": "Åpen på loopback",
+ "ollamaKeyRequired": "API-nøkkel kreves",
+ "claudeAliases": "Oppdagingsaliaser for Claude Code",
+ "claudeAliasesHint": "Eksponer claude/<model>-aliaser slik at gatewayens modellvelger kan liste opp katalogen.",
+ "urlTokensTitle": "Tilbakekallbare URL-tokener",
+ "urlTokensDesc": "Kun for klienter uten headere. URL-tokener kan lekke inn i historikk og logger, så tilbakekall dem når de ikke lenger trengs.",
+ "urlTokenLabel": "Tokenetikett",
+ "createUrlToken": "Opprett token",
+ "urlTokenOnce": "Kopier dette tokenet nå. Det vises ikke igjen.",
+ "revoked": "Tilbakekalt",
+ "revoke": "Tilbakekall"
},
"status": {
"healthy": "Sunt",
@@ -454,7 +477,8 @@
"keyOrdinal": "Nøkkel #{n}",
"attemptTimingHint": "Startforskyvning fra forespørselsstart · Forsøksvarighet",
"requestedModel": "Etterspurt modell",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Forespørsler per agent"
},
"playground": {
"title": "Lekeplass",
@@ -674,5 +698,15 @@
"url": "Skriv inn en gyldig URL som starter med http:// eller https://",
"email": "Skriv inn en gyldig e-postadresse",
"passwordMin": "I hvert fall {min} karakterer"
+ },
+ "agents": {
+ "title": "Kodeagenter",
+ "description": "Koble kodeverktøy til én gateway for gratis modeller med generert, sikkerhetskopivennlig konfigurasjon.",
+ "apiKey": "API-nøkkel",
+ "quickstart": "Raskeste vei: konfigurer Claude Code fra live-katalogen.",
+ "currentKey": "Gjeldende samlenøkkel:",
+ "seenRecently": "Nylig sett",
+ "endpoint": "Endepunkt",
+ "documentation": "Dokumentasjon"
}
}
diff --git a/client/src/i18n/locales/or.json b/client/src/i18n/locales/or.json
index 4a5b264c..43739b18 100644
--- a/client/src/i18n/locales/or.json
+++ b/client/src/i18n/locales/or.json
@@ -13,7 +13,8 @@
"switchDark": "ଗାଢ଼ ଥିମକୁ ସ୍ଵିଚ୍ କରନ୍ତୁ",
"switchToChinese": "ଚାଇନିଜ୍ କୁ ସ୍ଵିଚ୍ କରନ୍ତୁ",
"switchToEnglish": "ଇଂରାଜୀକୁ ସୁଇଚ୍ କରନ୍ତୁ",
- "modelsMenu": "ମଡେଲ୍ ପ୍ରକାରଗୁଡିକ ବ୍ରାଉଜ୍ କରନ୍ତୁ"
+ "modelsMenu": "ମଡେଲ୍ ପ୍ରକାରଗୁଡିକ ବ୍ରାଉଜ୍ କରନ୍ତୁ",
+ "agents": "ଏଜେଣ୍ଟଗୁଡ଼ିକ"
},
"auth": {
"createYourAccount": "ଆପଣଙ୍କ ଆକାଉଣ୍ଟ ସୃଷ୍ଟି କରନ୍ତୁ",
@@ -375,7 +376,29 @@
"quotaLimit": "ସୀମା",
"quotaRemaining": "ଅବଶିଷ୍ଟ",
"quotaReset": "ପୁନଃସେଟ୍ କରନ୍ତୁ",
- "quotaObserved": "ନିରୀକ୍ଷଣ କରାଯାଇଛି"
+ "quotaObserved": "ନିରୀକ୍ଷଣ କରାଯାଇଛି",
+ "tabAgents": "ଏଜେଣ୍ଟଗୁଡ଼ିକ",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini ମଡେଲ ମ୍ୟାପିଂ",
+ "geminiDesc": "Gemini Pro, Flash ଏବଂ Flash-Lite ନାମଗୁଡ଼ିକୁ Auto କିମ୍ବା ଏକ ନିର୍ଦ୍ଦିଷ୍ଟ କାଟାଲଗ୍ ମଡେଲରେ ମ୍ୟାପ୍ କରନ୍ତୁ।",
+ "compatibilityTitle": "ଏଜେଣ୍ଟ ସୁସଂଗତତା",
+ "compatibilityDesc": "ଅପ୍ଟ-ଇନ୍ ସୁସଂଗତତା ପୃଷ୍ଠଗୁଡ଼ିକ ଏବଂ Claude Code ମଡେଲ ଆବିଷ୍କାରକୁ ନିୟନ୍ତ୍ରଣ କରନ୍ତୁ।",
+ "ollamaMode": "Ollama ଏମୁଲେସନ୍",
+ "ollamaModeHint": "ଖୋଲା ଲୁପବ୍ୟାକ୍ କେବେବି ପ୍ରମାଣୀକରଣ ହୋଇନଥିବା LAN ଟ୍ରାଫିକ୍ ଗ୍ରହଣ କରେ ନାହିଁ।",
+ "ollamaOff": "ବନ୍ଦ",
+ "ollamaLoopback": "ଲୁପବ୍ୟାକ୍‌ରେ ଖୋଲା",
+ "ollamaKeyRequired": "API କୀ ଆବଶ୍ୟକ",
+ "claudeAliases": "Claude Code ଆବିଷ୍କାର ଉପନାମଗୁଡ଼ିକ",
+ "claudeAliasesHint": "ଗେଟୱେ ମଡେଲ ଚୟନକାରୀ କାଟାଲଗ୍ ତାଲିକାଭୁକ୍ତ କରିପାରିବା ପାଇଁ claude/<model> ଉପନାମଗୁଡ଼ିକୁ ଉପଲବ୍ଧ କରାନ୍ତୁ।",
+ "urlTokensTitle": "ପ୍ରତ୍ୟାହାରଯୋଗ୍ୟ URL ଟୋକେନ୍‌ଗୁଡ଼ିକ",
+ "urlTokensDesc": "କେବଳ ହେଡର୍-ବିହୀନ କ୍ଲାଏଣ୍ଟଙ୍କ ପାଇଁ। URL ଟୋକେନ୍ ଇତିହାସ ଏବଂ ଲଗରେ ଲିକ୍ ହୋଇପାରେ, ତେଣୁ ଆଉ ଆବଶ୍ୟକ ନ ହେଲେ ସେଗୁଡ଼ିକୁ ପ୍ରତ୍ୟାହାର କରନ୍ତୁ।",
+ "urlTokenLabel": "ଟୋକେନ୍ ଲେବଲ୍",
+ "createUrlToken": "ଟୋକେନ୍ ସୃଷ୍ଟି କରନ୍ତୁ",
+ "urlTokenOnce": "ଏହି ଟୋକେନ୍‌କୁ ଏବେ କପି କରନ୍ତୁ। ଏହା ପୁଣି ଦେଖାଯିବ ନାହିଁ।",
+ "revoked": "ପ୍ରତ୍ୟାହୃତ",
+ "revoke": "ପ୍ରତ୍ୟାହାର କରନ୍ତୁ"
},
"status": {
"healthy": "ସୁସ୍ଥ",
@@ -454,7 +477,8 @@
"keyOrdinal": "ମୁଖ୍ୟ #{n}",
"attemptTimingHint": "ଅନୁରୋଧ ଆରମ୍ଭରୁ ଅଫସେଟ୍ ଆରମ୍ଭ କରନ୍ତୁ · ଉଦ୍ୟମ ଅବଧି",
"requestedModel": "ଅନୁରୋଧିତ ମଡେଲ୍",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "ଏଜେଣ୍ଟ ଦ୍ୱାରା ଅନୁରୋଧଗୁଡିକ"
},
"playground": {
"title": "ଖେଳ ପଡିଆ",
@@ -674,5 +698,15 @@
"url": "http:// କିମ୍ୱା https:// ସହ ଆରମ୍ଭ କରି ଏକ ବୈଧ URL ପ୍ରବେଶ କରନ୍ତୁ",
"email": "ଏକ ବୈଧ ଇମେଲ୍ ଠିକଣା ପ୍ରବେଶ କରନ୍ତୁ",
"passwordMin": "ଅତିକମରେ {min} ବର୍ଣ୍ଣ"
+ },
+ "agents": {
+ "title": "କୋଡିଂ ଏଜେଣ୍ଟଗୁଡ଼ିକ",
+ "description": "କୋଡିଂ ଉପକରଣଗୁଡ଼ିକୁ ସୃଷ୍ଟି କରାଯାଇଥିବା, ବ୍ୟାକଅପ୍-ସୁରକ୍ଷିତ କନଫିଗରେସନ୍ ସହିତ ଗୋଟିଏ ମାଗଣା-ମଡେଲ ଗେଟୱେ ସହ ସଂଯୋଗ କରନ୍ତୁ।",
+ "apiKey": "API କୀ",
+ "quickstart": "ସବୁଠାରୁ ଦ୍ରୁତ ପଥ: ଲାଇଭ୍ କାଟାଲଗ୍‌ରୁ Claude Code କନଫିଗର୍ କରନ୍ତୁ।",
+ "currentKey": "ବର୍ତ୍ତମାନର ଏକୀକୃତ କୀ:",
+ "seenRecently": "ନିକଟରେ ଦେଖାଯାଇଛି",
+ "endpoint": "ଏଣ୍ଡପଏଣ୍ଟ",
+ "documentation": "ଡକ୍ୟୁମେଣ୍ଟେସନ୍"
}
}
diff --git a/client/src/i18n/locales/pa.json b/client/src/i18n/locales/pa.json
index af63de0e..1c79db5c 100644
--- a/client/src/i18n/locales/pa.json
+++ b/client/src/i18n/locales/pa.json
@@ -13,7 +13,8 @@
"switchDark": "ਡਾਰਕ ਥੀਮ 'ਤੇ ਸਵਿਚ ਕਰੋ",
"switchToChinese": "ਚੀਨੀ ਵਿੱਚ ਬਦਲੋ",
"switchToEnglish": "ਅੰਗਰੇਜ਼ੀ ਵਿੱਚ ਬਦਲੋ",
- "modelsMenu": "ਮਾਡਲ ਕਿਸਮਾਂ ਨੂੰ ਬ੍ਰਾਊਜ਼ ਕਰੋ"
+ "modelsMenu": "ਮਾਡਲ ਕਿਸਮਾਂ ਨੂੰ ਬ੍ਰਾਊਜ਼ ਕਰੋ",
+ "agents": "ਏਜੰਟ"
},
"auth": {
"createYourAccount": "ਆਪਣਾ ਖਾਤਾ ਬਣਾਓ",
@@ -375,7 +376,29 @@
"quotaLimit": "ਸੀਮਾ",
"quotaRemaining": "ਬਾਕੀ",
"quotaReset": "ਰੀਸੈਟ ਕਰੋ",
- "quotaObserved": "ਦੇਖਿਆ ਗਿਆ"
+ "quotaObserved": "ਦੇਖਿਆ ਗਿਆ",
+ "tabAgents": "ਏਜੰਟ",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini ਮਾਡਲ ਮੈਪਿੰਗ",
+ "geminiDesc": "Gemini Pro, Flash ਅਤੇ Flash-Lite ਨਾਵਾਂ ਨੂੰ Auto ਜਾਂ ਕਿਸੇ ਖਾਸ ਕੈਟਾਲਾਗ ਮਾਡਲ ਨਾਲ ਮੈਪ ਕਰੋ।",
+ "compatibilityTitle": "ਏਜੰਟ ਅਨੁਕੂਲਤਾ",
+ "compatibilityDesc": "ਚੋਣਵੀਆਂ ਅਨੁਕੂਲਤਾ ਸਤਹਾਂ ਅਤੇ Claude Code ਮਾਡਲ ਖੋਜ ਨੂੰ ਕੰਟਰੋਲ ਕਰੋ।",
+ "ollamaMode": "Ollama ਇਮੂਲੇਸ਼ਨ",
+ "ollamaModeHint": "ਖੁੱਲ੍ਹਾ ਲੂਪਬੈਕ ਕਦੇ ਵੀ ਬਿਨਾਂ ਪ੍ਰਮਾਣਿਕਤਾ ਵਾਲੇ LAN ਟ੍ਰੈਫਿਕ ਨੂੰ ਸਵੀਕਾਰ ਨਹੀਂ ਕਰਦਾ।",
+ "ollamaOff": "ਬੰਦ",
+ "ollamaLoopback": "ਲੂਪਬੈਕ 'ਤੇ ਖੁੱਲ੍ਹਾ",
+ "ollamaKeyRequired": "API ਕੁੰਜੀ ਲੋੜੀਂਦੀ ਹੈ",
+ "claudeAliases": "Claude Code ਖੋਜ ਉਪਨਾਮ",
+ "claudeAliasesHint": "claude/<model> ਉਪਨਾਮ ਉਪਲਬਧ ਕਰਾਓ ਤਾਂ ਜੋ ਗੇਟਵੇ ਮਾਡਲ ਚੋਣਕਾਰ ਕੈਟਾਲਾਗ ਦੀ ਸੂਚੀ ਦਿਖਾ ਸਕੇ।",
+ "urlTokensTitle": "ਰੱਦ ਕਰਨ ਯੋਗ URL ਟੋਕਨ",
+ "urlTokensDesc": "ਸਿਰਫ਼ ਹੈਡਰ-ਰਹਿਤ ਕਲਾਇੰਟਾਂ ਲਈ। URL ਟੋਕਨ ਇਤਿਹਾਸ ਅਤੇ ਲੌਗਾਂ ਵਿੱਚ ਲੀਕ ਹੋ ਸਕਦੇ ਹਨ, ਇਸ ਲਈ ਲੋੜ ਨਾ ਰਹਿਣ 'ਤੇ ਇਨ੍ਹਾਂ ਨੂੰ ਰੱਦ ਕਰ ਦਿਓ।",
+ "urlTokenLabel": "ਟੋਕਨ ਲੇਬਲ",
+ "createUrlToken": "ਟੋਕਨ ਬਣਾਓ",
+ "urlTokenOnce": "ਇਹ ਟੋਕਨ ਹੁਣੇ ਕਾਪੀ ਕਰੋ। ਇਹ ਦੁਬਾਰਾ ਨਹੀਂ ਦਿਖਾਇਆ ਜਾਵੇਗਾ।",
+ "revoked": "ਰੱਦ ਕੀਤਾ ਗਿਆ",
+ "revoke": "ਰੱਦ ਕਰੋ"
},
"status": {
"healthy": "ਸਿਹਤਮੰਦ",
@@ -454,7 +477,8 @@
"keyOrdinal": "ਕੁੰਜੀ #{n}",
"attemptTimingHint": "ਬੇਨਤੀ ਸ਼ੁਰੂ ਤੋਂ ਔਫਸੈੱਟ ਸ਼ੁਰੂ ਕਰੋ · ਕੋਸ਼ਿਸ਼ ਦੀ ਮਿਆਦ",
"requestedModel": "ਮਾਡਲ ਦੀ ਮੰਗ ਕੀਤੀ",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "ਏਜੰਟ ਦੁਆਰਾ ਬੇਨਤੀਆਂ"
},
"playground": {
"title": "ਖੇਡ ਦਾ ਮੈਦਾਨ",
@@ -674,5 +698,15 @@
"url": "http:// ਜਾਂ https:// ਨਾਲ ਸ਼ੁਰੂ ਹੋਣ ਵਾਲਾ ਇੱਕ ਵੈਧ URL ਦਾਖਲ ਕਰੋ",
"email": "ਇੱਕ ਵੈਧ ਈਮੇਲ ਪਤਾ ਦਰਜ ਕਰੋ",
"passwordMin": "ਘੱਟੋ-ਘੱਟ {min} ਅੱਖਰ"
+ },
+ "agents": {
+ "title": "ਕੋਡਿੰਗ ਏਜੰਟ",
+ "description": "ਕੋਡਿੰਗ ਟੂਲਾਂ ਨੂੰ ਤਿਆਰ ਕੀਤੀ, ਬੈਕਅੱਪ-ਸੁਰੱਖਿਅਤ ਸੰਰਚਨਾ ਨਾਲ ਇੱਕੋ ਮੁਫ਼ਤ-ਮਾਡਲ ਗੇਟਵੇ ਨਾਲ ਜੋੜੋ।",
+ "apiKey": "API ਕੁੰਜੀ",
+ "quickstart": "ਸਭ ਤੋਂ ਤੇਜ਼ ਰਾਹ: ਲਾਈਵ ਕੈਟਾਲਾਗ ਤੋਂ Claude Code ਸੰਰਚਿਤ ਕਰੋ।",
+ "currentKey": "ਮੌਜੂਦਾ ਏਕੀਕ੍ਰਿਤ ਕੁੰਜੀ:",
+ "seenRecently": "ਹਾਲ ਹੀ ਵਿੱਚ ਦੇਖਿਆ ਗਿਆ",
+ "endpoint": "ਐਂਡਪੁਆਇੰਟ",
+ "documentation": "ਦਸਤਾਵੇਜ਼"
}
}
diff --git a/client/src/i18n/locales/pl.json b/client/src/i18n/locales/pl.json
index 3b1924e7..c51d08be 100644
--- a/client/src/i18n/locales/pl.json
+++ b/client/src/i18n/locales/pl.json
@@ -13,7 +13,8 @@
"switchDark": "Przełącz na ciemny motyw",
"switchToChinese": "Przełącz na język chiński",
"switchToEnglish": "Przełącz na angielski",
- "modelsMenu": "Przeglądaj typy modeli"
+ "modelsMenu": "Przeglądaj typy modeli",
+ "agents": "Agenci"
},
"auth": {
"createYourAccount": "Utwórz swoje konto",
@@ -375,7 +376,29 @@
"quotaLimit": "Limit",
"quotaRemaining": "Pozostało",
"quotaReset": "Zresetuj",
- "quotaObserved": "Zaobserwowane"
+ "quotaObserved": "Zaobserwowane",
+ "tabAgents": "Agenci",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Mapowanie modeli Gemini",
+ "geminiDesc": "Mapuj nazwy Gemini Pro, Flash i Flash-Lite na Auto lub konkretny model z katalogu.",
+ "compatibilityTitle": "Zgodność agentów",
+ "compatibilityDesc": "Steruj opcjonalnymi warstwami zgodności i wykrywaniem modeli Claude Code.",
+ "ollamaMode": "Emulacja Ollama",
+ "ollamaModeHint": "Otwarty loopback nigdy nie przyjmuje nieuwierzytelnionego ruchu z sieci LAN.",
+ "ollamaOff": "Wył.",
+ "ollamaLoopback": "Otwarty na loopbacku",
+ "ollamaKeyRequired": "Wymagany klucz API",
+ "claudeAliases": "Aliasy wykrywania Claude Code",
+ "claudeAliasesHint": "Udostępnij aliasy claude/<model>, aby selektor modeli bramy mógł wyświetlić katalog.",
+ "urlTokensTitle": "Odwoływalne tokeny URL",
+ "urlTokensDesc": "Tylko dla klientów bez nagłówków. Tokeny URL mogą wyciec do historii i logów, więc odwołuj je, gdy nie są już potrzebne.",
+ "urlTokenLabel": "Etykieta tokenu",
+ "createUrlToken": "Utwórz token",
+ "urlTokenOnce": "Skopiuj ten token teraz. Nie zostanie ponownie wyświetlony.",
+ "revoked": "Odwołany",
+ "revoke": "Odwołaj"
},
"status": {
"healthy": "zdrowy",
@@ -454,7 +477,8 @@
"keyOrdinal": "klucz #{n}",
"attemptTimingHint": "Przesunięcie początku od początku żądania · czas trwania próby",
"requestedModel": "Żądany model",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Żądania według agenta"
},
"playground": {
"title": "Plac zabaw",
@@ -674,5 +698,15 @@
"url": "Wprowadź prawidłowy kod URL zaczynający się od http:// lub https://",
"email": "Wpisz prawidłowy adres e-mail",
"passwordMin": "Co najmniej {min} znaków"
+ },
+ "agents": {
+ "title": "Agenci kodujący",
+ "description": "Połącz narzędzia programistyczne z jedną bramą darmowych modeli dzięki generowanej konfiguracji bezpiecznej dla kopii zapasowych.",
+ "apiKey": "Klucz API",
+ "quickstart": "Najszybsza ścieżka: skonfiguruj Claude Code na podstawie aktualnego katalogu.",
+ "currentKey": "Bieżący wspólny klucz:",
+ "seenRecently": "Ostatnio widziany",
+ "endpoint": "Punkt końcowy",
+ "documentation": "Dokumentacja"
}
}
diff --git a/client/src/i18n/locales/pt-BR.json b/client/src/i18n/locales/pt-BR.json
index 06be7889..ad40b508 100644
--- a/client/src/i18n/locales/pt-BR.json
+++ b/client/src/i18n/locales/pt-BR.json
@@ -13,7 +13,8 @@
"switchDark": "Mudar para o tema escuro",
"switchToChinese": "Mudar para chinês",
"switchToEnglish": "Mudar para inglês",
- "modelsMenu": "Explorar tipos de modelo"
+ "modelsMenu": "Explorar tipos de modelo",
+ "agents": "Agentes"
},
"auth": {
"createYourAccount": "Crie sua conta",
@@ -375,7 +376,29 @@
"quotaLimit": "Limite",
"quotaRemaining": "Restante",
"quotaReset": "Redefinição",
- "quotaObserved": "Observado"
+ "quotaObserved": "Observado",
+ "tabAgents": "Agentes",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Mapeamento de modelos Gemini",
+ "geminiDesc": "Mapeie os nomes Gemini Pro, Flash e Flash-Lite para Auto ou um modelo específico do catálogo.",
+ "compatibilityTitle": "Compatibilidade de agentes",
+ "compatibilityDesc": "Controle superfícies de compatibilidade opcionais e a descoberta de modelos do Claude Code.",
+ "ollamaMode": "Emulação do Ollama",
+ "ollamaModeHint": "O loopback aberto nunca aceita tráfego de LAN não autenticado.",
+ "ollamaOff": "Desativado",
+ "ollamaLoopback": "Aberto no loopback",
+ "ollamaKeyRequired": "Chave de API obrigatória",
+ "claudeAliases": "Aliases de descoberta do Claude Code",
+ "claudeAliasesHint": "Exponha aliases claude/<model> para que o seletor de modelos do gateway possa listar o catálogo.",
+ "urlTokensTitle": "Tokens de URL revogáveis",
+ "urlTokensDesc": "Apenas para clientes sem cabeçalhos. Tokens de URL podem vazar para o histórico e os logs; revogue-os quando não forem mais necessários.",
+ "urlTokenLabel": "Rótulo do token",
+ "createUrlToken": "Criar token",
+ "urlTokenOnce": "Copie este token agora. Ele não será exibido novamente.",
+ "revoked": "Revogado",
+ "revoke": "Revogar"
},
"status": {
"healthy": "saudável",
@@ -454,7 +477,8 @@
"keyOrdinal": "chave #{n}",
"attemptTimingHint": "Deslocamento desde o início da requisição · duração da tentativa",
"requestedModel": "Modelo solicitado",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Solicitações por agente"
},
"playground": {
"title": "Playground",
@@ -674,5 +698,15 @@
"url": "Insira uma URL válida começando com http:// ou https://",
"email": "Insira um endereço de e-mail válido",
"passwordMin": "Pelo menos {min} caracteres"
+ },
+ "agents": {
+ "title": "Agentes de codificação",
+ "description": "Conecte ferramentas de codificação a um único gateway de modelos gratuitos com configuração gerada e segura para backup.",
+ "apiKey": "Chave de API",
+ "quickstart": "Caminho mais rápido: configure o Claude Code a partir do catálogo ao vivo.",
+ "currentKey": "Chave unificada atual:",
+ "seenRecently": "Visto recentemente",
+ "endpoint": "Endpoint",
+ "documentation": "Documentação"
}
}
diff --git a/client/src/i18n/locales/pt-PT.json b/client/src/i18n/locales/pt-PT.json
index 6f30af49..6ffab74a 100644
--- a/client/src/i18n/locales/pt-PT.json
+++ b/client/src/i18n/locales/pt-PT.json
@@ -13,7 +13,8 @@
"switchDark": "Mudança para tema sombrio",
"switchToChinese": "Mudança para o chinês",
"switchToEnglish": "Mudança para inglês",
- "modelsMenu": "Navegar pelos tipos de modelos"
+ "modelsMenu": "Navegar pelos tipos de modelos",
+ "agents": "Agentes"
},
"auth": {
"createYourAccount": "Crie a sua conta",
@@ -375,7 +376,29 @@
"quotaLimit": "Limite",
"quotaRemaining": "Remanescentes",
"quotaReset": "Reiniciar",
- "quotaObserved": "Observado"
+ "quotaObserved": "Observado",
+ "tabAgents": "Agentes",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Mapeamento de modelos Gemini",
+ "geminiDesc": "Mapeie os nomes Gemini Pro, Flash e Flash-Lite para Auto ou para um modelo específico do catálogo.",
+ "compatibilityTitle": "Compatibilidade de agentes",
+ "compatibilityDesc": "Controle as superfícies de compatibilidade opcionais e a descoberta de modelos do Claude Code.",
+ "ollamaMode": "Emulação do Ollama",
+ "ollamaModeHint": "O loopback aberto nunca aceita tráfego LAN não autenticado.",
+ "ollamaOff": "Desligado",
+ "ollamaLoopback": "Aberto no loopback",
+ "ollamaKeyRequired": "Chave de API obrigatória",
+ "claudeAliases": "Aliases de descoberta do Claude Code",
+ "claudeAliasesHint": "Exponha aliases claude/<model> para que o seletor de modelos do gateway possa listar o catálogo.",
+ "urlTokensTitle": "Tokens de URL revogáveis",
+ "urlTokensDesc": "Apenas para clientes sem cabeçalhos. Os tokens de URL podem ser expostos no histórico e nos registos, por isso revogue-os quando já não forem necessários.",
+ "urlTokenLabel": "Etiqueta do token",
+ "createUrlToken": "Criar token",
+ "urlTokenOnce": "Copie este token agora. Não voltará a ser mostrado.",
+ "revoked": "Revogado",
+ "revoke": "Revogar"
},
"status": {
"healthy": "Saudável",
@@ -454,7 +477,8 @@
"keyOrdinal": "#{n} chave",
"attemptTimingHint": "Início deslocado a partir do início do pedido · Duração da tentativa",
"requestedModel": "Modelo solicitado",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Pedidos por agente"
},
"playground": {
"title": "Parque infantil",
@@ -674,5 +698,15 @@
"url": "Introduza uma URL válida começando por http:// ou https://",
"email": "Insira um endereço de email válido",
"passwordMin": "Pelo menos {min} personagens"
+ },
+ "agents": {
+ "title": "Agentes de programação",
+ "description": "Ligue ferramentas de programação a um único gateway de modelos gratuitos com configuração gerada e segura para cópias de segurança.",
+ "apiKey": "Chave de API",
+ "quickstart": "Caminho mais rápido: configure o Claude Code a partir do catálogo em direto.",
+ "currentKey": "Chave unificada atual:",
+ "seenRecently": "Visto recentemente",
+ "endpoint": "Endpoint",
+ "documentation": "Documentação"
}
}
diff --git a/client/src/i18n/locales/ro.json b/client/src/i18n/locales/ro.json
index 3f89afaa..e89c44cd 100644
--- a/client/src/i18n/locales/ro.json
+++ b/client/src/i18n/locales/ro.json
@@ -13,7 +13,8 @@
"switchDark": "Treci la tema întunecată",
"switchToChinese": "Trecerea la chineză",
"switchToEnglish": "Trecerea la engleză",
- "modelsMenu": "Explorează tipurile de modele"
+ "modelsMenu": "Explorează tipurile de modele",
+ "agents": "Agenți"
},
"auth": {
"createYourAccount": "Creează-ți contul",
@@ -375,7 +376,29 @@
"quotaLimit": "Limită",
"quotaRemaining": "Rămași",
"quotaReset": "Resetare",
- "quotaObserved": "Observat"
+ "quotaObserved": "Observat",
+ "tabAgents": "Agenți",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Maparea modelelor Gemini",
+ "geminiDesc": "Mapează numele Gemini Pro, Flash și Flash-Lite la Auto sau la un model anume din catalog.",
+ "compatibilityTitle": "Compatibilitate agenți",
+ "compatibilityDesc": "Controlează suprafețele de compatibilitate opționale și descoperirea modelelor Claude Code.",
+ "ollamaMode": "Emulare Ollama",
+ "ollamaModeHint": "Loopback-ul deschis nu acceptă niciodată trafic LAN neautentificat.",
+ "ollamaOff": "Dezactivat",
+ "ollamaLoopback": "Deschis pe loopback",
+ "ollamaKeyRequired": "Cheie API necesară",
+ "claudeAliases": "Aliasuri de descoperire Claude Code",
+ "claudeAliasesHint": "Expune aliasurile claude/<model> pentru ca selectorul de modele al gateway-ului să poată lista catalogul.",
+ "urlTokensTitle": "Tokenuri URL revocabile",
+ "urlTokensDesc": "Doar pentru clienți fără anteturi. Tokenurile URL pot ajunge în istoric și în loguri, așa că revocă-le când nu mai sunt necesare.",
+ "urlTokenLabel": "Etichetă token",
+ "createUrlToken": "Creează token",
+ "urlTokenOnce": "Copiază acest token acum. Nu va mai fi afișat.",
+ "revoked": "Revocat",
+ "revoke": "Revocă"
},
"status": {
"healthy": "Sănătos",
@@ -454,7 +477,8 @@
"keyOrdinal": "#{n} cheie",
"attemptTimingHint": "Start offset față de începutul cererii · Durata încercării",
"requestedModel": "Modelul cerut",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Cereri per agent"
},
"playground": {
"title": "Locul de joacă",
@@ -674,5 +698,15 @@
"url": "Introdu un URL valid care începe cu http:// sau https://",
"email": "Introdu o adresă de email validă",
"passwordMin": "Cel puțin {min} personaje"
+ },
+ "agents": {
+ "title": "Agenți de codare",
+ "description": "Conectează instrumentele de codare la un singur gateway de modele gratuite, cu configurație generată, sigură pentru backup.",
+ "apiKey": "Cheie API",
+ "quickstart": "Cea mai rapidă cale: configurează Claude Code din catalogul live.",
+ "currentKey": "Cheia unificată curentă:",
+ "seenRecently": "Văzut recent",
+ "endpoint": "Endpoint",
+ "documentation": "Documentație"
}
}
diff --git a/client/src/i18n/locales/ru.json b/client/src/i18n/locales/ru.json
index 447cd369..acc57ddf 100644
--- a/client/src/i18n/locales/ru.json
+++ b/client/src/i18n/locales/ru.json
@@ -13,7 +13,8 @@
"switchDark": "Переключиться на темную тему",
"switchToChinese": "Переключиться на китайский",
"switchToEnglish": "Переключиться на английский",
- "modelsMenu": "Просмотр типов моделей"
+ "modelsMenu": "Просмотр типов моделей",
+ "agents": "Агенты"
},
"auth": {
"createYourAccount": "Создайте свою учетную запись",
@@ -375,7 +376,29 @@
"quotaLimit": "Лимит",
"quotaRemaining": "Осталось",
"quotaReset": "Сброс",
- "quotaObserved": "Наблюдается"
+ "quotaObserved": "Наблюдается",
+ "tabAgents": "Агенты",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Сопоставление моделей Gemini",
+ "geminiDesc": "Сопоставьте имена Gemini Pro, Flash и Flash-Lite с Auto или конкретной моделью каталога.",
+ "compatibilityTitle": "Совместимость с агентами",
+ "compatibilityDesc": "Управляйте дополнительными уровнями совместимости и обнаружением моделей Claude Code.",
+ "ollamaMode": "Эмуляция Ollama",
+ "ollamaModeHint": "Открытый loopback никогда не принимает неаутентифицированный трафик из LAN.",
+ "ollamaOff": "Выкл.",
+ "ollamaLoopback": "Открыт на loopback",
+ "ollamaKeyRequired": "Требуется API-ключ",
+ "claudeAliases": "Алиасы обнаружения Claude Code",
+ "claudeAliasesHint": "Публикуйте алиасы claude/<model>, чтобы селектор моделей шлюза мог отобразить каталог.",
+ "urlTokensTitle": "Отзываемые URL-токены",
+ "urlTokensDesc": "Только для клиентов без заголовков. URL-токены могут попасть в историю и логи, поэтому отзывайте их, когда они больше не нужны.",
+ "urlTokenLabel": "Метка токена",
+ "createUrlToken": "Создать токен",
+ "urlTokenOnce": "Скопируйте этот токен сейчас. Он больше не будет показан.",
+ "revoked": "Отозван",
+ "revoke": "Отозвать"
},
"status": {
"healthy": "здоровый",
@@ -454,7 +477,8 @@
"keyOrdinal": "ключ #{n}",
"attemptTimingHint": "Начальное смещение от начала запроса · продолжительность попытки",
"requestedModel": "Запрошенная модель",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Запросы по агентам"
},
"playground": {
"title": "Детская площадка",
@@ -674,5 +698,15 @@
"url": "Введите действительный URL, начиная с http:// или https://.",
"email": "Введите действительный адрес электронной почты",
"passwordMin": "Минимум символов {min}."
+ },
+ "agents": {
+ "title": "Агенты программирования",
+ "description": "Подключайте инструменты программирования к единому шлюзу бесплатных моделей с генерируемой конфигурацией, безопасной для резервных копий.",
+ "apiKey": "API-ключ",
+ "quickstart": "Самый быстрый путь: настройте Claude Code по актуальному каталогу.",
+ "currentKey": "Текущий единый ключ:",
+ "seenRecently": "Замечен недавно",
+ "endpoint": "Эндпоинт",
+ "documentation": "Документация"
}
}
diff --git a/client/src/i18n/locales/si.json b/client/src/i18n/locales/si.json
index 229cb05c..4357835b 100644
--- a/client/src/i18n/locales/si.json
+++ b/client/src/i18n/locales/si.json
@@ -13,7 +13,8 @@
"switchDark": "අඳුරු තේමාව වෙත මාරු වන්න",
"switchToChinese": "චීන භාෂාවට මාරු වන්න",
"switchToEnglish": "ඉංග්‍රීසි වලට මාරු වෙන්න",
- "modelsMenu": "ආකෘති වර්ග පිරික්සන්න"
+ "modelsMenu": "ආකෘති වර්ග පිරික්සන්න",
+ "agents": "නියෝජිතයන්"
},
"auth": {
"createYourAccount": "ඔබගේ ගිණුම සාදන්න",
@@ -375,7 +376,29 @@
"quotaLimit": "සීමාව",
"quotaRemaining": "ඉතිරි",
"quotaReset": "යළි පිහිටුවන්න",
- "quotaObserved": "නිරීක්ෂණය කරන ලදී"
+ "quotaObserved": "නිරීක්ෂණය කරන ලදී",
+ "tabAgents": "නියෝජිතයන්",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini ආකෘති සිතියම්ගත කිරීම",
+ "geminiDesc": "Gemini Pro, Flash සහ Flash-Lite නම් Auto වෙත හෝ නිශ්චිත නාමාවලි ආකෘතියකට සිතියම්ගත කරන්න.",
+ "compatibilityTitle": "නියෝජිත ගැළපුම",
+ "compatibilityDesc": "විකල්ප ගැළපුම් පෘෂ්ඨ සහ Claude Code ආකෘති සොයාගැනීම පාලනය කරන්න.",
+ "ollamaMode": "Ollama අනුකරණය",
+ "ollamaModeHint": "විවෘත loopback කිසිවිටෙක සත්‍යාපනය නොකළ LAN ගමනාගමනය භාර නොගනී.",
+ "ollamaOff": "අක්‍රියයි",
+ "ollamaLoopback": "Loopback මත විවෘතයි",
+ "ollamaKeyRequired": "API යතුර අවශ්‍යයි",
+ "claudeAliases": "Claude Code සොයාගැනීමේ අන්වර්ථ නාම",
+ "claudeAliasesHint": "ද්වාරයේ ආකෘති තෝරකයට නාමාවලිය ලැයිස්තුගත කළ හැකි වන පරිදි claude/<model> අන්වර්ථ නාම නිරාවරණය කරන්න.",
+ "urlTokensTitle": "අවලංගු කළ හැකි URL ටෝකන",
+ "urlTokensDesc": "ශීර්ෂක රහිත සේවාලාභීන් සඳහා පමණි. URL ටෝකන ඉතිහාසයට සහ ලොග වෙත කාන්දු විය හැකි බැවින්, තවදුරටත් අවශ්‍ය නොවන විට ඒවා අවලංගු කරන්න.",
+ "urlTokenLabel": "ටෝකන ලේබලය",
+ "createUrlToken": "ටෝකනය සාදන්න",
+ "urlTokenOnce": "මෙම ටෝකනය දැන්ම පිටපත් කරන්න. එය නැවත නොපෙන්වයි.",
+ "revoked": "අවලංගු කරන ලදී",
+ "revoke": "අවලංගු කරන්න"
},
"status": {
"healthy": "සෞඛ්ය සම්පන්න",
@@ -454,7 +477,8 @@
"keyOrdinal": "යතුර #{n}",
"attemptTimingHint": "ඉල්ලීම ආරම්භයේ සිට ඕෆ්සෙට් ආරම්භ කරන්න · උත්සාහ කාලය",
"requestedModel": "ඉල්ලූ ආකෘතිය",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "නියෝජිතයා අනුව ඉල්ලීම්"
},
"playground": {
"title": "ක්රීඩා පිටිය",
@@ -674,5 +698,15 @@
"url": "http:// හෝ https:// සමඟින් ආරම්භ වන වලංගු URL ඇතුළත් කරන්න",
"email": "වලංගු විද්‍යුත් තැපැල් ලිපිනයක් ඇතුළත් කරන්න",
"passwordMin": "අවම වශයෙන් {min} අක්ෂර"
+ },
+ "agents": {
+ "title": "කේතන නියෝජිතයන්",
+ "description": "ජනනය කළ, උපස්ථ-ආරක්ෂිත වින්‍යාසයක් සමඟ කේතන මෙවලම් එක් නොමිලේ-ආකෘති ද්වාරයකට සම්බන්ධ කරන්න.",
+ "apiKey": "API යතුර",
+ "quickstart": "වේගවත්ම මාර්ගය: සජීවී නාමාවලියෙන් Claude Code වින්‍යාස කරන්න.",
+ "currentKey": "වත්මන් ඒකාබද්ධ යතුර:",
+ "seenRecently": "මෑතකදී දක්නට ලැබුණි",
+ "endpoint": "අන්ත ලක්ෂ්‍යය",
+ "documentation": "ලේඛන"
}
}
diff --git a/client/src/i18n/locales/sk.json b/client/src/i18n/locales/sk.json
index 93d6cc22..b3dca1da 100644
--- a/client/src/i18n/locales/sk.json
+++ b/client/src/i18n/locales/sk.json
@@ -13,7 +13,8 @@
"switchDark": "Prejsť na tmavú tému",
"switchToChinese": "Prechod na čínštinu",
"switchToEnglish": "Prechod na angličtinu",
- "modelsMenu": "Prehliadať typy modelov"
+ "modelsMenu": "Prehliadať typy modelov",
+ "agents": "Agenti"
},
"auth": {
"createYourAccount": "Vytvorte si účet",
@@ -375,7 +376,29 @@
"quotaLimit": "Limit",
"quotaRemaining": "Zvyšok",
"quotaReset": "Reset",
- "quotaObserved": "Pozorované"
+ "quotaObserved": "Pozorované",
+ "tabAgents": "Agenti",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Mapovanie modelov Gemini",
+ "geminiDesc": "Namapujte názvy Gemini Pro, Flash a Flash-Lite na Auto alebo konkrétny model z katalógu.",
+ "compatibilityTitle": "Kompatibilita agentov",
+ "compatibilityDesc": "Ovládajte voliteľné vrstvy kompatibility a zisťovanie modelov Claude Code.",
+ "ollamaMode": "Emulácia Ollama",
+ "ollamaModeHint": "Otvorený loopback nikdy neprijíma neoverenú prevádzku z LAN.",
+ "ollamaOff": "Vypnuté",
+ "ollamaLoopback": "Otvorené na loopbacku",
+ "ollamaKeyRequired": "Vyžaduje sa API kľúč",
+ "claudeAliases": "Aliasy zisťovania Claude Code",
+ "claudeAliasesHint": "Sprístupnite aliasy claude/<model>, aby výber modelov brány mohol zobraziť katalóg.",
+ "urlTokensTitle": "Odvolateľné URL tokeny",
+ "urlTokensDesc": "Iba pre klientov bez hlavičiek. URL tokeny môžu uniknúť do histórie a logov, preto ich odvolajte, keď už nie sú potrebné.",
+ "urlTokenLabel": "Označenie tokenu",
+ "createUrlToken": "Vytvoriť token",
+ "urlTokenOnce": "Skopírujte tento token teraz. Už sa znova nezobrazí.",
+ "revoked": "Odvolaný",
+ "revoke": "Odvolať"
},
"status": {
"healthy": "zdravé",
@@ -454,7 +477,8 @@
"keyOrdinal": "Kľúčové #{n}",
"attemptTimingHint": "Začať offset od začiatku požiadavky · Trvanie pokusu",
"requestedModel": "Požadovaný model",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Požiadavky podľa agenta"
},
"playground": {
"title": "Ihrisko",
@@ -674,5 +698,15 @@
"url": "Zadajte platný URL začínajúci na http:// alebo https://",
"email": "Zadajte platnú e-mailovú adresu",
"passwordMin": "Aspoň {min} postavy"
+ },
+ "agents": {
+ "title": "Kódovací agenti",
+ "description": "Pripojte kódovacie nástroje k jednej bráne bezplatných modelov s generovanou konfiguráciou bezpečnou pre zálohy.",
+ "apiKey": "API kľúč",
+ "quickstart": "Najrýchlejšia cesta: nakonfigurujte Claude Code zo živého katalógu.",
+ "currentKey": "Aktuálny zjednotený kľúč:",
+ "seenRecently": "Nedávno videný",
+ "endpoint": "Endpoint",
+ "documentation": "Dokumentácia"
}
}
diff --git a/client/src/i18n/locales/sr.json b/client/src/i18n/locales/sr.json
index e6ef96e4..c39fe931 100644
--- a/client/src/i18n/locales/sr.json
+++ b/client/src/i18n/locales/sr.json
@@ -13,7 +13,8 @@
"switchDark": "Пребаците се на тамну тему",
"switchToChinese": "Пребаци на кинески",
"switchToEnglish": "Пребаците се на енглески",
- "modelsMenu": "Прегледајте типове модела"
+ "modelsMenu": "Прегледајте типове модела",
+ "agents": "Агенти"
},
"auth": {
"createYourAccount": "Креирајте свој налог",
@@ -375,7 +376,29 @@
"quotaLimit": "Лимит",
"quotaRemaining": "Преостало",
"quotaReset": "Ресетуј",
- "quotaObserved": "Посматрано"
+ "quotaObserved": "Посматрано",
+ "tabAgents": "Агенти",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Мапирање Gemini модела",
+ "geminiDesc": "Мапирајте називе Gemini Pro, Flash и Flash-Lite на Auto или одређени модел из каталога.",
+ "compatibilityTitle": "Компатибилност агената",
+ "compatibilityDesc": "Управљајте опционим површинама компатибилности и откривањем модела за Claude Code.",
+ "ollamaMode": "Ollama емулација",
+ "ollamaModeHint": "Отворени loopback никада не прихвата неаутентификовани LAN саобраћај.",
+ "ollamaOff": "Искључено",
+ "ollamaLoopback": "Отворено на loopback-у",
+ "ollamaKeyRequired": "Потребан је API кључ",
+ "claudeAliases": "Алијаси за откривање Claude Code-а",
+ "claudeAliasesHint": "Изложите claude/<model> алијасе како би бирач модела мрежног пролаза могао да прикаже каталог.",
+ "urlTokensTitle": "Опозиви URL токени",
+ "urlTokensDesc": "Само за клијенте без заглавља. URL токени могу да процуре у историју и логове, па их опозовите када више нису потребни.",
+ "urlTokenLabel": "Ознака токена",
+ "createUrlToken": "Направи токен",
+ "urlTokenOnce": "Копирајте овај токен одмах. Неће бити поново приказан.",
+ "revoked": "Опозван",
+ "revoke": "Опозови"
},
"status": {
"healthy": "здраво",
@@ -454,7 +477,8 @@
"keyOrdinal": "кључ #{n}",
"attemptTimingHint": "Почетак одступања од почетка захтева · трајање покушаја",
"requestedModel": "Тражени модел",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Захтеви по агенту"
},
"playground": {
"title": "Игралиште",
@@ -674,5 +698,15 @@
"url": "Унесите важећи URL који почиње са хттп:// или хттпс://",
"email": "Унесите важећу адресу е-поште",
"passwordMin": "Најмање {min} знакова"
+ },
+ "agents": {
+ "title": "Агенти за кодирање",
+ "description": "Повежите алате за кодирање са једним мрежним пролазом бесплатних модела уз генерисану конфигурацију безбедну за резервне копије.",
+ "apiKey": "API кључ",
+ "quickstart": "Најбржи пут: конфигуришите Claude Code из каталога уживо.",
+ "currentKey": "Тренутни обједињени кључ:",
+ "seenRecently": "Недавно виђен",
+ "endpoint": "Крајња тачка",
+ "documentation": "Документација"
}
}
diff --git a/client/src/i18n/locales/sv.json b/client/src/i18n/locales/sv.json
index 24886127..689debf2 100644
--- a/client/src/i18n/locales/sv.json
+++ b/client/src/i18n/locales/sv.json
@@ -13,7 +13,8 @@
"switchDark": "Byt till mörkt tema",
"switchToChinese": "Byt till kinesiska",
"switchToEnglish": "Byta till engelska",
- "modelsMenu": "Bläddra bland modelltyper"
+ "modelsMenu": "Bläddra bland modelltyper",
+ "agents": "Agenter"
},
"auth": {
"createYourAccount": "Skapa ditt konto",
@@ -375,7 +376,29 @@
"quotaLimit": "Gräns",
"quotaRemaining": "Återstående",
"quotaReset": "Återställ",
- "quotaObserved": "Observerat"
+ "quotaObserved": "Observerat",
+ "tabAgents": "Agenter",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini-modellmappning",
+ "geminiDesc": "Mappa namnen Gemini Pro, Flash och Flash-Lite till Auto eller en specifik katalogmodell.",
+ "compatibilityTitle": "Agentkompatibilitet",
+ "compatibilityDesc": "Styr kompatibilitetsytor som kräver aktivering samt modellupptäckt för Claude Code.",
+ "ollamaMode": "Ollama-emulering",
+ "ollamaModeHint": "Öppen loopback accepterar aldrig oautentiserad LAN-trafik.",
+ "ollamaOff": "Av",
+ "ollamaLoopback": "Öppen på loopback",
+ "ollamaKeyRequired": "API-nyckel krävs",
+ "claudeAliases": "Upptäcktsalias för Claude Code",
+ "claudeAliasesHint": "Exponera claude/<model>-alias så att gatewayens modellväljare kan lista katalogen.",
+ "urlTokensTitle": "Återkallbara URL-token",
+ "urlTokensDesc": "Endast för klienter utan headers. URL-token kan läcka till historik och loggar, så återkalla dem när de inte längre behövs.",
+ "urlTokenLabel": "Tokenetikett",
+ "createUrlToken": "Skapa token",
+ "urlTokenOnce": "Kopiera denna token nu. Den visas inte igen.",
+ "revoked": "Återkallad",
+ "revoke": "Återkalla"
},
"status": {
"healthy": "Hälsosamt",
@@ -454,7 +477,8 @@
"keyOrdinal": "Nyckel#{n}",
"attemptTimingHint": "Startförskjutning från begäran start · Försökslängd",
"requestedModel": "Efterfrågad modell",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Begäranden per agent"
},
"playground": {
"title": "Lekplats",
@@ -674,5 +698,15 @@
"url": "Ange en giltig URL som börjar med http:// eller https://",
"email": "Ange en giltig e-postadress",
"passwordMin": "Åtminstone {min} karaktärer"
+ },
+ "agents": {
+ "title": "Kodningsagenter",
+ "description": "Anslut kodningsverktyg till en gemensam gateway för gratismodeller med genererad konfiguration som säkerhetskopieras tryggt.",
+ "apiKey": "API-nyckel",
+ "quickstart": "Snabbaste vägen: konfigurera Claude Code från livekatalogen.",
+ "currentKey": "Aktuell enhetlig nyckel:",
+ "seenRecently": "Nyligen sedd",
+ "endpoint": "Slutpunkt",
+ "documentation": "Dokumentation"
}
}
diff --git a/client/src/i18n/locales/sw.json b/client/src/i18n/locales/sw.json
index 909d8041..7e2a63f5 100644
--- a/client/src/i18n/locales/sw.json
+++ b/client/src/i18n/locales/sw.json
@@ -13,7 +13,8 @@
"switchDark": "Badili hadi mandhari meusi",
"switchToChinese": "Badili hadi Kichina",
"switchToEnglish": "Badili hadi Kiingereza",
- "modelsMenu": "Vinjari aina za mifano"
+ "modelsMenu": "Vinjari aina za mifano",
+ "agents": "Mawakala"
},
"auth": {
"createYourAccount": "Fungua akaunti yako",
@@ -375,7 +376,29 @@
"quotaLimit": "Kikomo",
"quotaRemaining": "Iliyosalia",
"quotaReset": "Weka upya",
- "quotaObserved": "Imezingatiwa"
+ "quotaObserved": "Imezingatiwa",
+ "tabAgents": "Mawakala",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Ulinganishaji wa miundo ya Gemini",
+ "geminiDesc": "Linganisha majina ya Gemini Pro, Flash, na Flash-Lite na Auto au muundo maalum wa katalogi.",
+ "compatibilityTitle": "Ulinganifu wa mawakala",
+ "compatibilityDesc": "Dhibiti nyuso za ulinganifu za hiari na ugunduzi wa miundo wa Claude Code.",
+ "ollamaMode": "Uigaji wa Ollama",
+ "ollamaModeHint": "Loopback iliyo wazi haikubali kamwe trafiki ya LAN isiyothibitishwa.",
+ "ollamaOff": "Imezimwa",
+ "ollamaLoopback": "Wazi kwenye loopback",
+ "ollamaKeyRequired": "Ufunguo wa API unahitajika",
+ "claudeAliases": "Lakabu za ugunduzi za Claude Code",
+ "claudeAliasesHint": "Onyesha lakabu za claude/<model> ili kichaguzi cha miundo cha lango kiweze kuorodhesha katalogi.",
+ "urlTokensTitle": "Tokeni za URL zinazoweza kubatilishwa",
+ "urlTokensDesc": "Kwa wateja wasio na vichwa pekee. Tokeni za URL zinaweza kuvuja kwenye historia na kumbukumbu, kwa hivyo zibatilishe zisipohitajika tena.",
+ "urlTokenLabel": "Lebo ya tokeni",
+ "createUrlToken": "Unda tokeni",
+ "urlTokenOnce": "Nakili tokeni hii sasa. Haitaonyeshwa tena.",
+ "revoked": "Imebatilishwa",
+ "revoke": "Batilisha"
},
"status": {
"healthy": "afya",
@@ -454,7 +477,8 @@
"keyOrdinal": "ufunguo #{n}",
"attemptTimingHint": "Anza kukabiliana na ombi kuanza · muda wa jaribio",
"requestedModel": "Umeomba muundo",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Maombi kwa kila wakala"
},
"playground": {
"title": "Uwanja wa michezo",
@@ -674,5 +698,15 @@
"url": "Weka URL halali ukianza na http:// au https://",
"email": "Weka barua pepe halali",
"passwordMin": "Angalau vibambo {min}"
+ },
+ "agents": {
+ "title": "Mawakala wa usimbaji",
+ "description": "Unganisha zana za usimbaji na lango moja la miundo ya bure kwa usanidi ulioundwa na ulio salama kwa hifadhi rudufu.",
+ "apiKey": "Ufunguo wa API",
+ "quickstart": "Njia ya haraka zaidi: sanidi Claude Code kutoka kwenye katalogi ya moja kwa moja.",
+ "currentKey": "Ufunguo wa pamoja wa sasa:",
+ "seenRecently": "Imeonekana hivi karibuni",
+ "endpoint": "Kituo cha mwisho",
+ "documentation": "Nyaraka"
}
}
diff --git a/client/src/i18n/locales/ta.json b/client/src/i18n/locales/ta.json
index 8c68b46f..5d9ad9b7 100644
--- a/client/src/i18n/locales/ta.json
+++ b/client/src/i18n/locales/ta.json
@@ -13,7 +13,8 @@
"switchDark": "இருண்ட தீமுக்கு மாறவும்",
"switchToChinese": "சீன மொழிக்கு மாறவும்",
"switchToEnglish": "ஆங்கிலத்திற்கு மாறவும்",
- "modelsMenu": "மாதிரி வகைகளை உலாவவும்"
+ "modelsMenu": "மாதிரி வகைகளை உலாவவும்",
+ "agents": "முகவர்கள்"
},
"auth": {
"createYourAccount": "உங்கள் கணக்கை உருவாக்கவும்",
@@ -375,7 +376,29 @@
"quotaLimit": "வரம்பு",
"quotaRemaining": "மீதமுள்ளவை",
"quotaReset": "மீட்டமை",
- "quotaObserved": "கவனிக்கப்பட்டது"
+ "quotaObserved": "கவனிக்கப்பட்டது",
+ "tabAgents": "முகவர்கள்",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini மாதிரி மேப்பிங்",
+ "geminiDesc": "Gemini Pro, Flash மற்றும் Flash-Lite பெயர்களை Auto அல்லது குறிப்பிட்ட கேட்டலாக் மாதிரிக்கு மேப் செய்யவும்.",
+ "compatibilityTitle": "முகவர் இணக்கத்தன்மை",
+ "compatibilityDesc": "விருப்பத்தேர்வு இணக்கத்தன்மை அம்சங்களையும் Claude Code மாதிரி கண்டறிதலையும் கட்டுப்படுத்தவும்.",
+ "ollamaMode": "Ollama எமுலேஷன்",
+ "ollamaModeHint": "திறந்த லூப்பேக் ஒருபோதும் அங்கீகரிக்கப்படாத LAN போக்குவரத்தை ஏற்காது.",
+ "ollamaOff": "ஆஃப்",
+ "ollamaLoopback": "லூப்பேக்கில் திறந்தது",
+ "ollamaKeyRequired": "API விசை தேவை",
+ "claudeAliases": "Claude Code கண்டறிதல் மாற்றுப்பெயர்கள்",
+ "claudeAliasesHint": "கேட்வே மாதிரி தேர்வி கேட்டலாக்கைப் பட்டியலிட claude/<model> மாற்றுப்பெயர்களை வெளிப்படுத்தவும்.",
+ "urlTokensTitle": "ரத்து செய்யக்கூடிய URL டோக்கன்கள்",
+ "urlTokensDesc": "தலைப்புகள் இல்லாத கிளையண்டுகளுக்கு மட்டும். URL டோக்கன்கள் வரலாறு மற்றும் பதிவுகளில் கசியக்கூடும், எனவே தேவையில்லாதபோது அவற்றை ரத்து செய்யவும்.",
+ "urlTokenLabel": "டோக்கன் லேபிள்",
+ "createUrlToken": "டோக்கனை உருவாக்கு",
+ "urlTokenOnce": "இந்த டோக்கனை இப்போதே நகலெடுக்கவும். இது மீண்டும் காட்டப்படாது.",
+ "revoked": "ரத்து செய்யப்பட்டது",
+ "revoke": "ரத்து செய்"
},
"status": {
"healthy": "ஆரோக்கியமான",
@@ -454,7 +477,8 @@
"keyOrdinal": "விசை #{n}",
"attemptTimingHint": "கோரிக்கை தொடக்கத்திலிருந்து ஆஃப்செட்டைத் தொடங்கு · முயற்சி காலம்",
"requestedModel": "கோரப்பட்ட மாதிரி",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "முகவர் வாரியாக கோரிக்கைகள்"
},
"playground": {
"title": "விளையாட்டு மைதானம்",
@@ -674,5 +698,15 @@
"url": "http:// அல்லது https:// உடன் தொடங்கும் சரியான URL ஐ உள்ளிடவும்",
"email": "சரியான மின்னஞ்சல் முகவரியை உள்ளிடவும்",
"passwordMin": "குறைந்தது {min} எழுத்துகள்"
+ },
+ "agents": {
+ "title": "கோடிங் முகவர்கள்",
+ "description": "உருவாக்கப்பட்ட, காப்புப்பிரதி-பாதுகாப்பான உள்ளமைவுடன் கோடிங் கருவிகளை ஒரே இலவச-மாதிரி கேட்வேயுடன் இணைக்கவும்.",
+ "apiKey": "API விசை",
+ "quickstart": "விரைவான வழி: நேரடி கேட்டலாக்கிலிருந்து Claude Code ஐ உள்ளமைக்கவும்.",
+ "currentKey": "தற்போதைய ஒருங்கிணைந்த விசை:",
+ "seenRecently": "சமீபத்தில் காணப்பட்டது",
+ "endpoint": "எண்ட்பாயிண்ட்",
+ "documentation": "ஆவணங்கள்"
}
}
diff --git a/client/src/i18n/locales/te.json b/client/src/i18n/locales/te.json
index cc991888..ca7f8c0c 100644
--- a/client/src/i18n/locales/te.json
+++ b/client/src/i18n/locales/te.json
@@ -13,7 +13,8 @@
"switchDark": "డార్క్ థీమ్‌కి మారండి",
"switchToChinese": "చైనీస్‌కి మారండి",
"switchToEnglish": "ఆంగ్లానికి మారండి",
- "modelsMenu": "మోడల్ రకాలను బ్రౌజ్ చేయండి"
+ "modelsMenu": "మోడల్ రకాలను బ్రౌజ్ చేయండి",
+ "agents": "ఏజెంట్లు"
},
"auth": {
"createYourAccount": "మీ ఖాతాను సృష్టించండి",
@@ -375,7 +376,29 @@
"quotaLimit": "పరిమితి",
"quotaRemaining": "మిగిలింది",
"quotaReset": "రీసెట్ చేయండి",
- "quotaObserved": "గమనించారు"
+ "quotaObserved": "గమనించారు",
+ "tabAgents": "ఏజెంట్లు",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini మోడల్ మ్యాపింగ్",
+ "geminiDesc": "Gemini Pro, Flash మరియు Flash-Lite పేర్లను Auto లేదా నిర్దిష్ట కేటలాగ్ మోడల్‌కు మ్యాప్ చేయండి.",
+ "compatibilityTitle": "ఏజెంట్ అనుకూలత",
+ "compatibilityDesc": "ఆప్ట్-ఇన్ అనుకూలత ఉపరితలాలను మరియు Claude Code మోడల్ డిస్కవరీని నియంత్రించండి.",
+ "ollamaMode": "Ollama ఎమ్యులేషన్",
+ "ollamaModeHint": "ఓపెన్ లూప్‌బ్యాక్ ధ్రువీకరించని LAN ట్రాఫిక్‌ను ఎప్పుడూ అంగీకరించదు.",
+ "ollamaOff": "ఆఫ్",
+ "ollamaLoopback": "లూప్‌బ్యాక్‌లో ఓపెన్",
+ "ollamaKeyRequired": "API కీ అవసరం",
+ "claudeAliases": "Claude Code డిస్కవరీ అలియాస్‌లు",
+ "claudeAliasesHint": "గేట్‌వే మోడల్ పికర్ కేటలాగ్‌ను జాబితా చేయగలిగేలా claude/<model> అలియాస్‌లను బహిర్గతం చేయండి.",
+ "urlTokensTitle": "రద్దు చేయగల URL టోకెన్లు",
+ "urlTokensDesc": "హెడర్ లేని క్లయింట్ల కోసం మాత్రమే. URL టోకెన్లు హిస్టరీ మరియు లాగ్‌లలోకి లీక్ కావచ్చు, కాబట్టి ఇక అవసరం లేనప్పుడు వాటిని రద్దు చేయండి.",
+ "urlTokenLabel": "టోకెన్ లేబుల్",
+ "createUrlToken": "టోకెన్ సృష్టించండి",
+ "urlTokenOnce": "ఈ టోకెన్‌ను ఇప్పుడే కాపీ చేయండి. ఇది మళ్లీ చూపబడదు.",
+ "revoked": "రద్దు చేయబడింది",
+ "revoke": "రద్దు చేయండి"
},
"status": {
"healthy": "ఆరోగ్యకరమైన",
@@ -454,7 +477,8 @@
"keyOrdinal": "కీ #{n}",
"attemptTimingHint": "అభ్యర్థన ప్రారంభం నుండి ఆఫ్‌సెట్ ప్రారంభించండి · ప్రయత్న వ్యవధి",
"requestedModel": "అభ్యర్థించిన మోడల్",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "ఏజెంట్ వారీగా అభ్యర్థనలు"
},
"playground": {
"title": "ప్లేగ్రౌండ్",
@@ -674,5 +698,15 @@
"url": "చెల్లుబాటు అయ్యే URLని http:// లేదా https://తో ప్రారంభించండి",
"email": "చెల్లుబాటు అయ్యే ఇమెయిల్ చిరునామాను నమోదు చేయండి",
"passwordMin": "కనీసం {min} అక్షరాలు"
+ },
+ "agents": {
+ "title": "కోడింగ్ ఏజెంట్లు",
+ "description": "జనరేట్ చేయబడిన, బ్యాకప్-సురక్షిత కాన్ఫిగరేషన్‌తో కోడింగ్ సాధనాలను ఒకే ఉచిత-మోడల్ గేట్‌వేకు కనెక్ట్ చేయండి.",
+ "apiKey": "API కీ",
+ "quickstart": "వేగవంతమైన మార్గం: లైవ్ కేటలాగ్ నుండి Claude Codeను కాన్ఫిగర్ చేయండి.",
+ "currentKey": "ప్రస్తుత ఏకీకృత కీ:",
+ "seenRecently": "ఇటీవల కనిపించింది",
+ "endpoint": "ఎండ్‌పాయింట్",
+ "documentation": "డాక్యుమెంటేషన్"
}
}
diff --git a/client/src/i18n/locales/th.json b/client/src/i18n/locales/th.json
index b98a0da2..e05b4b43 100644
--- a/client/src/i18n/locales/th.json
+++ b/client/src/i18n/locales/th.json
@@ -13,7 +13,8 @@
"switchDark": "เปลี่ยนเป็นธีมสีเข้ม",
"switchToChinese": "เปลี่ยนไปใช้ภาษาจีน",
"switchToEnglish": "เปลี่ยนเป็นภาษาอังกฤษ",
- "modelsMenu": "เรียกดูประเภทโมเดล"
+ "modelsMenu": "เรียกดูประเภทโมเดล",
+ "agents": "เอเจนต์"
},
"auth": {
"createYourAccount": "สร้างบัญชีของคุณ",
@@ -375,7 +376,29 @@
"quotaLimit": "ขีดจำกัด",
"quotaRemaining": "ที่เหลืออยู่",
"quotaReset": "รีเซ็ต",
- "quotaObserved": "สังเกต"
+ "quotaObserved": "สังเกต",
+ "tabAgents": "เอเจนต์",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "การแมปโมเดล Gemini",
+ "geminiDesc": "แมปชื่อ Gemini Pro, Flash และ Flash-Lite ไปยัง Auto หรือโมเดลแค็ตตาล็อกที่ระบุ",
+ "compatibilityTitle": "ความเข้ากันได้ของเอเจนต์",
+ "compatibilityDesc": "ควบคุมพื้นผิวความเข้ากันได้แบบเลือกใช้และการค้นหาโมเดลของ Claude Code",
+ "ollamaMode": "การจำลอง Ollama",
+ "ollamaModeHint": "loopback แบบเปิดจะไม่ยอมรับทราฟฟิก LAN ที่ไม่ผ่านการยืนยันตัวตนเด็ดขาด",
+ "ollamaOff": "ปิด",
+ "ollamaLoopback": "เปิดบน loopback",
+ "ollamaKeyRequired": "ต้องใช้กุญแจ API",
+ "claudeAliases": "นามแฝงการค้นหาของ Claude Code",
+ "claudeAliasesHint": "เปิดเผยนามแฝง claude/<model> เพื่อให้ตัวเลือกโมเดลของเกตเวย์แสดงรายการแค็ตตาล็อกได้",
+ "urlTokensTitle": "โทเค็น URL ที่เพิกถอนได้",
+ "urlTokensDesc": "สำหรับไคลเอนต์ที่ไม่มีส่วนหัวเท่านั้น โทเค็น URL อาจรั่วไหลไปยังประวัติและบันทึก ดังนั้นให้เพิกถอนเมื่อไม่ต้องการใช้อีกต่อไป",
+ "urlTokenLabel": "ป้ายกำกับโทเค็น",
+ "createUrlToken": "สร้างโทเค็น",
+ "urlTokenOnce": "คัดลอกโทเค็นนี้ตอนนี้ จะไม่แสดงอีก",
+ "revoked": "เพิกถอนแล้ว",
+ "revoke": "เพิกถอน"
},
"status": {
"healthy": "มีสุขภาพดี",
@@ -454,7 +477,8 @@
"keyOrdinal": "กุญแจ #{n}",
"attemptTimingHint": "เริ่มต้นออฟเซ็ตจากคำขอเริ่มต้น · ระยะเวลาความพยายาม",
"requestedModel": "รุ่นที่ขอ",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "คำขอตามเอเจนต์"
},
"playground": {
"title": "สนามเด็กเล่น",
@@ -674,5 +698,15 @@
"url": "ป้อน URL ที่ถูกต้องโดยขึ้นต้นด้วย http:// หรือ https://",
"email": "ป้อนที่อยู่อีเมลที่ถูกต้อง",
"passwordMin": "อย่างน้อยอักขระ {min}"
+ },
+ "agents": {
+ "title": "เอเจนต์เขียนโค้ด",
+ "description": "เชื่อมต่อเครื่องมือเขียนโค้ดกับเกตเวย์โมเดลฟรีเดียวด้วยการกำหนดค่าที่สร้างให้และปลอดภัยต่อการสำรองข้อมูล",
+ "apiKey": "กุญแจ API",
+ "quickstart": "เส้นทางที่เร็วที่สุด: กำหนดค่า Claude Code จากแค็ตตาล็อกสด",
+ "currentKey": "กุญแจรวมปัจจุบัน:",
+ "seenRecently": "พบเห็นเมื่อเร็วๆ นี้",
+ "endpoint": "เอนด์พอยต์",
+ "documentation": "เอกสารประกอบ"
}
}
diff --git a/client/src/i18n/locales/tl.json b/client/src/i18n/locales/tl.json
index 286ad075..782830a2 100644
--- a/client/src/i18n/locales/tl.json
+++ b/client/src/i18n/locales/tl.json
@@ -13,7 +13,8 @@
"switchDark": "Lumipat sa madilim na tema",
"switchToChinese": "Lumipat sa Chinese",
"switchToEnglish": "Lumipat sa Ingles",
- "modelsMenu": "Mag-browse ng mga uri ng modelo"
+ "modelsMenu": "Mag-browse ng mga uri ng modelo",
+ "agents": "Mga Agent"
},
"auth": {
"createYourAccount": "Gumawa ng iyong account",
@@ -375,7 +376,29 @@
"quotaLimit": "Limitasyon",
"quotaRemaining": "Natitira",
"quotaReset": "I-reset",
- "quotaObserved": "naobserbahan"
+ "quotaObserved": "naobserbahan",
+ "tabAgents": "Mga Agent",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Pagmamapa ng modelo ng Gemini",
+ "geminiDesc": "I-map ang mga pangalan ng Gemini Pro, Flash, at Flash-Lite sa Auto o sa isang partikular na modelo ng catalog.",
+ "compatibilityTitle": "Compatibility ng agent",
+ "compatibilityDesc": "Kontrolin ang mga opt-in na compatibility surface at ang pagtuklas ng modelo ng Claude Code.",
+ "ollamaMode": "Emulasyon ng Ollama",
+ "ollamaModeHint": "Ang bukas na loopback ay hindi kailanman tumatanggap ng unauthenticated na LAN traffic.",
+ "ollamaOff": "Naka-off",
+ "ollamaLoopback": "Bukas sa loopback",
+ "ollamaKeyRequired": "Kailangan ng API key",
+ "claudeAliases": "Mga discovery alias ng Claude Code",
+ "claudeAliasesHint": "Ilantad ang mga claude/<model> na alias para mailista ng model picker ng gateway ang catalog.",
+ "urlTokensTitle": "Mga nare-revoke na URL token",
+ "urlTokensDesc": "Para lamang sa mga client na walang header. Maaaring tumagas ang mga URL token sa history at mga log, kaya i-revoke ang mga ito kapag hindi na kailangan.",
+ "urlTokenLabel": "Label ng token",
+ "createUrlToken": "Gumawa ng token",
+ "urlTokenOnce": "Kopyahin ang token na ito ngayon. Hindi na ito ipapakita muli.",
+ "revoked": "Na-revoke",
+ "revoke": "I-revoke"
},
"status": {
"healthy": "malusog",
@@ -454,7 +477,8 @@
"keyOrdinal": "pangunahing #{n}",
"attemptTimingHint": "Start offset mula sa request start · tagal ng pagtatangka",
"requestedModel": "Hinihiling na modelo",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Mga kahilingan ayon sa agent"
},
"playground": {
"title": "Palaruan",
@@ -674,5 +698,15 @@
"url": "Maglagay ng valid na URL na nagsisimula sa http:// o https://",
"email": "Maglagay ng wastong email address",
"passwordMin": "Hindi bababa sa {min} mga karakter"
+ },
+ "agents": {
+ "title": "Mga coding agent",
+ "description": "Ikonekta ang mga coding tool sa iisang free-model gateway gamit ang nabuong, backup-safe na configuration.",
+ "apiKey": "API key",
+ "quickstart": "Pinakamabilis na paraan: i-configure ang Claude Code mula sa live na catalog.",
+ "currentKey": "Kasalukuyang pinag-isang key:",
+ "seenRecently": "Nakita kamakailan",
+ "endpoint": "Endpoint",
+ "documentation": "Dokumentasyon"
}
}
diff --git a/client/src/i18n/locales/tr.json b/client/src/i18n/locales/tr.json
index a265c2fa..d2a569bd 100644
--- a/client/src/i18n/locales/tr.json
+++ b/client/src/i18n/locales/tr.json
@@ -13,7 +13,8 @@
"switchDark": "Koyu temaya geç",
"switchToChinese": "Çinceye geç",
"switchToEnglish": "İngilizceye geç",
- "modelsMenu": "Model türlerine göz atın"
+ "modelsMenu": "Model türlerine göz atın",
+ "agents": "Ajanlar"
},
"auth": {
"createYourAccount": "Hesabınızı oluşturun",
@@ -375,7 +376,29 @@
"quotaLimit": "Sınır",
"quotaRemaining": "Kalan",
"quotaReset": "Sıfırla",
- "quotaObserved": "Gözlemlendi"
+ "quotaObserved": "Gözlemlendi",
+ "tabAgents": "Ajanlar",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini model eşleme",
+ "geminiDesc": "Gemini Pro, Flash ve Flash-Lite adlarını Auto'ya veya belirli bir katalog modeline eşleyin.",
+ "compatibilityTitle": "Ajan uyumluluğu",
+ "compatibilityDesc": "İsteğe bağlı uyumluluk yüzeylerini ve Claude Code model keşfini kontrol edin.",
+ "ollamaMode": "Ollama emülasyonu",
+ "ollamaModeHint": "Açık loopback, kimliği doğrulanmamış LAN trafiğini asla kabul etmez.",
+ "ollamaOff": "Kapalı",
+ "ollamaLoopback": "Loopback'te açık",
+ "ollamaKeyRequired": "API anahtarı gerekli",
+ "claudeAliases": "Claude Code keşif takma adları",
+ "claudeAliasesHint": "Ağ geçidi model seçicisinin kataloğu listeleyebilmesi için claude/<model> takma adlarını açığa çıkarın.",
+ "urlTokensTitle": "İptal edilebilir URL belirteçleri",
+ "urlTokensDesc": "Yalnızca başlık gönderemeyen istemciler için. URL belirteçleri geçmişe ve günlüklere sızabilir; bu yüzden artık gerekmediğinde iptal edin.",
+ "urlTokenLabel": "Belirteç etiketi",
+ "createUrlToken": "Belirteç oluştur",
+ "urlTokenOnce": "Bu belirteci şimdi kopyalayın. Bir daha gösterilmeyecek.",
+ "revoked": "İptal edildi",
+ "revoke": "İptal et"
},
"status": {
"healthy": "sağlıklı",
@@ -454,7 +477,8 @@
"keyOrdinal": "anahtar #{n}",
"attemptTimingHint": "İstek başlangıcından itibaren başlangıç dengelemesi · deneme süresi",
"requestedModel": "İstenilen model",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Ajan başına istekler"
},
"playground": {
"title": "Bahçesi",
@@ -674,5 +698,15 @@
"url": "http:// veya https:// ile başlayan geçerli bir URL girin",
"email": "Geçerli bir e-posta adresi girin",
"passwordMin": "En az {min} karakter"
+ },
+ "agents": {
+ "title": "Kodlama ajanları",
+ "description": "Kodlama araçlarını, oluşturulmuş ve yedeklemeye uygun yapılandırmayla tek bir ücretsiz model ağ geçidine bağlayın.",
+ "apiKey": "API anahtarı",
+ "quickstart": "En hızlı yol: Claude Code'u canlı katalogdan yapılandırın.",
+ "currentKey": "Geçerli birleşik anahtar:",
+ "seenRecently": "Son zamanlarda görüldü",
+ "endpoint": "Uç nokta",
+ "documentation": "Dokümantasyon"
}
}
diff --git a/client/src/i18n/locales/uk.json b/client/src/i18n/locales/uk.json
index b818a269..e1f3ad18 100644
--- a/client/src/i18n/locales/uk.json
+++ b/client/src/i18n/locales/uk.json
@@ -13,7 +13,8 @@
"switchDark": "Переключитися на темну тему",
"switchToChinese": "Перейти на китайську",
"switchToEnglish": "Переключитися на англійську",
- "modelsMenu": "Перегляньте типи моделей"
+ "modelsMenu": "Перегляньте типи моделей",
+ "agents": "Агенти"
},
"auth": {
"createYourAccount": "Створіть свій акаунт",
@@ -375,7 +376,29 @@
"quotaLimit": "Ліміт",
"quotaRemaining": "Залишилося",
"quotaReset": "Скинути",
- "quotaObserved": "Спостерігається"
+ "quotaObserved": "Спостерігається",
+ "tabAgents": "Агенти",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Зіставлення моделей Gemini",
+ "geminiDesc": "Зіставте назви Gemini Pro, Flash і Flash-Lite з Auto або конкретною моделлю каталогу.",
+ "compatibilityTitle": "Сумісність агентів",
+ "compatibilityDesc": "Керуйте додатковими поверхнями сумісності та виявленням моделей Claude Code.",
+ "ollamaMode": "Емуляція Ollama",
+ "ollamaModeHint": "Відкритий loopback ніколи не приймає неавтентифікований трафік LAN.",
+ "ollamaOff": "Вимкнено",
+ "ollamaLoopback": "Відкрито на loopback",
+ "ollamaKeyRequired": "Потрібен ключ API",
+ "claudeAliases": "Псевдоніми виявлення Claude Code",
+ "claudeAliasesHint": "Відкрийте псевдоніми claude/<model>, щоб вибирач моделей шлюзу міг показати каталог.",
+ "urlTokensTitle": "Відкличні URL-токени",
+ "urlTokensDesc": "Лише для клієнтів без заголовків. URL-токени можуть потрапити в історію та журнали, тому відкликайте їх, коли вони більше не потрібні.",
+ "urlTokenLabel": "Мітка токена",
+ "createUrlToken": "Створити токен",
+ "urlTokenOnce": "Скопіюйте цей токен зараз. Він більше не буде показаний.",
+ "revoked": "Відкликано",
+ "revoke": "Відкликати"
},
"status": {
"healthy": "здоровий",
@@ -454,7 +477,8 @@
"keyOrdinal": "ключ #{n}",
"attemptTimingHint": "Початковий зсув від початку запиту · тривалість спроби",
"requestedModel": "Запитана модель",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Запити за агентами"
},
"playground": {
"title": "Дитячий майданчик",
@@ -674,5 +698,15 @@
"url": "Введіть дійсний URL, починаючи з http:// або https://",
"email": "Введіть дійсну адресу електронної пошти",
"passwordMin": "Принаймні {min} символів"
+ },
+ "agents": {
+ "title": "Агенти для кодування",
+ "description": "Підключіть інструменти кодування до єдиного шлюзу безкоштовних моделей зі згенерованою конфігурацією, безпечною для резервного копіювання.",
+ "apiKey": "Ключ API",
+ "quickstart": "Найшвидший шлях: налаштуйте Claude Code з живого каталогу.",
+ "currentKey": "Поточний єдиний ключ:",
+ "seenRecently": "Нещодавно помічено",
+ "endpoint": "Кінцева точка",
+ "documentation": "Документація"
}
}
diff --git a/client/src/i18n/locales/ur.json b/client/src/i18n/locales/ur.json
index 77eaab0d..9e28cd09 100644
--- a/client/src/i18n/locales/ur.json
+++ b/client/src/i18n/locales/ur.json
@@ -13,7 +13,8 @@
"switchDark": "تاریک تھیم پر سوئچ کریں۔",
"switchToChinese": "چینی پر سوئچ کریں۔",
"switchToEnglish": "انگریزی پر سوئچ کریں۔",
- "modelsMenu": "ماڈل کی اقسام کو براؤز کریں۔"
+ "modelsMenu": "ماڈل کی اقسام کو براؤز کریں۔",
+ "agents": "ایجنٹس"
},
"auth": {
"createYourAccount": "اپنا اکاؤنٹ بنائیں",
@@ -375,7 +376,29 @@
"quotaLimit": "حد",
"quotaRemaining": "باقی",
"quotaReset": "دوبارہ ترتیب دیں۔",
- "quotaObserved": "مشاہدہ کیا۔"
+ "quotaObserved": "مشاہدہ کیا۔",
+ "tabAgents": "ایجنٹس",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini ماڈل میپنگ",
+ "geminiDesc": "Gemini Pro، Flash اور Flash-Lite ناموں کو Auto یا کسی مخصوص کیٹلاگ ماڈل سے میپ کریں۔",
+ "compatibilityTitle": "ایجنٹ مطابقت",
+ "compatibilityDesc": "آپٹ اِن مطابقت کی سطحوں اور Claude Code ماڈل دریافت کو کنٹرول کریں۔",
+ "ollamaMode": "Ollama ایمولیشن",
+ "ollamaModeHint": "کھلا لوپ بیک کبھی بھی غیر تصدیق شدہ LAN ٹریفک قبول نہیں کرتا۔",
+ "ollamaOff": "بند",
+ "ollamaLoopback": "لوپ بیک پر کھلا",
+ "ollamaKeyRequired": "API کلید درکار ہے۔",
+ "claudeAliases": "Claude Code ڈسکوری عرفی نام",
+ "claudeAliasesHint": "claude/<model> عرفی نام ظاہر کریں تاکہ گیٹ وے ماڈل منتخب کنندہ کیٹلاگ کی فہرست دکھا سکے۔",
+ "urlTokensTitle": "قابلِ منسوخ URL ٹوکنز",
+ "urlTokensDesc": "صرف بغیر ہیڈر والے کلائنٹس کے لیے۔ URL ٹوکنز ہسٹری اور لاگز میں لیک ہو سکتے ہیں، اس لیے ضرورت نہ رہنے پر انہیں منسوخ کر دیں۔",
+ "urlTokenLabel": "ٹوکن لیبل",
+ "createUrlToken": "ٹوکن بنائیں",
+ "urlTokenOnce": "یہ ٹوکن ابھی کاپی کریں۔ یہ دوبارہ نہیں دکھایا جائے گا۔",
+ "revoked": "منسوخ شدہ",
+ "revoke": "منسوخ کریں"
},
"status": {
"healthy": "صحت مند",
@@ -454,7 +477,8 @@
"keyOrdinal": "کلید #{n}",
"attemptTimingHint": "درخواست کے آغاز سے آفسیٹ شروع کریں · کوشش کی مدت",
"requestedModel": "ماڈل کی درخواست کی۔",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "فی ایجنٹ درخواستیں"
},
"playground": {
"title": "کھیل کا میدان",
@@ -674,5 +698,15 @@
"url": "http:// یا https:// سے شروع ہونے والا ایک درست URL درج کریں",
"email": "ایک درست ای میل ایڈریس درج کریں۔",
"passwordMin": "کم از کم {min} حروف"
+ },
+ "agents": {
+ "title": "کوڈنگ ایجنٹس",
+ "description": "کوڈنگ ٹولز کو ایک ہی مفت ماڈل گیٹ وے سے جوڑیں، تیار کردہ اور بیک اپ محفوظ کنفیگریشن کے ساتھ۔",
+ "apiKey": "API کلید",
+ "quickstart": "تیز ترین راستہ: لائیو کیٹلاگ سے Claude Code کنفیگر کریں۔",
+ "currentKey": "موجودہ متحد کلید:",
+ "seenRecently": "حال ہی میں دیکھا گیا",
+ "endpoint": "اینڈ پوائنٹ",
+ "documentation": "دستاویزات"
}
}
diff --git a/client/src/i18n/locales/uz.json b/client/src/i18n/locales/uz.json
index 1ef745b9..10bcd9d5 100644
--- a/client/src/i18n/locales/uz.json
+++ b/client/src/i18n/locales/uz.json
@@ -13,7 +13,8 @@
"switchDark": "Qorongʻi mavzuga oʻtish",
"switchToChinese": "Xitoy tiliga o'tish",
"switchToEnglish": "Ingliz tiliga o'tish",
- "modelsMenu": "Model turlarini ko'rib chiqing"
+ "modelsMenu": "Model turlarini ko'rib chiqing",
+ "agents": "Agentlar"
},
"auth": {
"createYourAccount": "Hisob qaydnomangizni yarating",
@@ -375,7 +376,29 @@
"quotaLimit": "Cheklash",
"quotaRemaining": "Qolgan",
"quotaReset": "Qayta tiklash",
- "quotaObserved": "Kuzatilgan"
+ "quotaObserved": "Kuzatilgan",
+ "tabAgents": "Agentlar",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini modellarini moslashtirish",
+ "geminiDesc": "Gemini Pro, Flash va Flash-Lite nomlarini Auto yoki muayyan katalog modeliga moslang.",
+ "compatibilityTitle": "Agent mosligi",
+ "compatibilityDesc": "Ixtiyoriy moslik yuzalarini va Claude Code model aniqlashini boshqaring.",
+ "ollamaMode": "Ollama emulyatsiyasi",
+ "ollamaModeHint": "Ochiq loopback hech qachon autentifikatsiyasiz LAN trafigini qabul qilmaydi.",
+ "ollamaOff": "O'chirilgan",
+ "ollamaLoopback": "Loopbackda ochiq",
+ "ollamaKeyRequired": "API kaliti talab qilinadi",
+ "claudeAliases": "Claude Code aniqlash taxalluslari",
+ "claudeAliasesHint": "Shlyuz model tanlagichi katalogni ro'yxatlashi uchun claude/<model> taxalluslarini oching.",
+ "urlTokensTitle": "Bekor qilinadigan URL tokenlari",
+ "urlTokensDesc": "Faqat sarlavhasiz mijozlar uchun. URL tokenlari tarix va jurnallarga sizib chiqishi mumkin, shuning uchun kerak bo'lmaganda ularni bekor qiling.",
+ "urlTokenLabel": "Token yorlig'i",
+ "createUrlToken": "Token yaratish",
+ "urlTokenOnce": "Bu tokenni hozir nusxalang. U boshqa ko'rsatilmaydi.",
+ "revoked": "Bekor qilingan",
+ "revoke": "Bekor qilish"
},
"status": {
"healthy": "sog'lom",
@@ -454,7 +477,8 @@
"keyOrdinal": "kalit #{n}",
"attemptTimingHint": "So'rov boshlanishidan boshlab ofsetni boshlash · urinish davomiyligi",
"requestedModel": "So'ralgan model",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Agent bo'yicha so'rovlar"
},
"playground": {
"title": "O'yin maydonchasi",
@@ -674,5 +698,15 @@
"url": "http:// yoki https:// bilan boshlanadigan yaroqli URL kiriting",
"email": "Yaroqli elektron pochta manzilini kiriting",
"passwordMin": "Kamida {min} belgilar"
+ },
+ "agents": {
+ "title": "Kodlash agentlari",
+ "description": "Kodlash vositalarini yaratilgan, zaxira nusxa uchun xavfsiz konfiguratsiya bilan yagona bepul model shlyuziga ulang.",
+ "apiKey": "API kaliti",
+ "quickstart": "Eng tezkor yo'l: Claude Code'ni jonli katalogdan sozlang.",
+ "currentKey": "Joriy yagona kalit:",
+ "seenRecently": "Yaqinda ko'rilgan",
+ "endpoint": "So'nggi nuqta",
+ "documentation": "Hujjatlar"
}
}
diff --git a/client/src/i18n/locales/vi.json b/client/src/i18n/locales/vi.json
index b9dd82c6..b6c9be6a 100644
--- a/client/src/i18n/locales/vi.json
+++ b/client/src/i18n/locales/vi.json
@@ -13,7 +13,8 @@
"switchDark": "Chuyển sang chủ đề tối",
"switchToChinese": "Chuyển sang tiếng Trung",
"switchToEnglish": "Chuyển sang tiếng Anh",
- "modelsMenu": "Duyệt các loại mô hình"
+ "modelsMenu": "Duyệt các loại mô hình",
+ "agents": "Tác nhân"
},
"auth": {
"createYourAccount": "Tạo tài khoản của bạn",
@@ -375,7 +376,29 @@
"quotaLimit": "giới hạn",
"quotaRemaining": "Còn lại",
"quotaReset": "Đặt lại",
- "quotaObserved": "quan sát"
+ "quotaObserved": "quan sát",
+ "tabAgents": "Tác nhân",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Ánh xạ mô hình Gemini",
+ "geminiDesc": "Ánh xạ tên Gemini Pro, Flash và Flash-Lite sang Auto hoặc một mô hình danh mục cụ thể.",
+ "compatibilityTitle": "Khả năng tương thích tác nhân",
+ "compatibilityDesc": "Kiểm soát các bề mặt tương thích tùy chọn và khám phá mô hình Claude Code.",
+ "ollamaMode": "Giả lập Ollama",
+ "ollamaModeHint": "Loopback mở không bao giờ chấp nhận lưu lượng LAN chưa xác thực.",
+ "ollamaOff": "Tắt",
+ "ollamaLoopback": "Mở trên loopback",
+ "ollamaKeyRequired": "Yêu cầu khóa API",
+ "claudeAliases": "Bí danh khám phá Claude Code",
+ "claudeAliasesHint": "Hiển thị bí danh claude/<model> để bộ chọn mô hình của cổng có thể liệt kê danh mục.",
+ "urlTokensTitle": "Mã thông báo URL có thể thu hồi",
+ "urlTokensDesc": "Chỉ dành cho các ứng dụng khách không có tiêu đề. Mã thông báo URL có thể bị lộ vào lịch sử và nhật ký, vì vậy hãy thu hồi khi không còn cần thiết.",
+ "urlTokenLabel": "Nhãn mã thông báo",
+ "createUrlToken": "Tạo mã thông báo",
+ "urlTokenOnce": "Sao chép mã thông báo này ngay bây giờ. Nó sẽ không được hiển thị lại.",
+ "revoked": "Đã thu hồi",
+ "revoke": "Thu hồi"
},
"status": {
"healthy": "khỏe mạnh",
@@ -454,7 +477,8 @@
"keyOrdinal": "phím #{n}",
"attemptTimingHint": "Bắt đầu bù đắp từ khi bắt đầu yêu cầu · thời gian thử",
"requestedModel": "Mô hình được yêu cầu",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Yêu cầu theo tác nhân"
},
"playground": {
"title": "Sân chơi",
@@ -674,5 +698,15 @@
"url": "Nhập URL hợp lệ bắt đầu bằng http:// hoặc https://",
"email": "Nhập địa chỉ email hợp lệ",
"passwordMin": "Ít nhất ký tự {min}"
+ },
+ "agents": {
+ "title": "Tác nhân lập trình",
+ "description": "Kết nối các công cụ lập trình với một cổng mô hình miễn phí duy nhất bằng cấu hình được tạo sẵn, an toàn khi sao lưu.",
+ "apiKey": "Khóa API",
+ "quickstart": "Cách nhanh nhất: cấu hình Claude Code từ danh mục trực tiếp.",
+ "currentKey": "Khóa hợp nhất hiện tại:",
+ "seenRecently": "Xuất hiện gần đây",
+ "endpoint": "Điểm cuối",
+ "documentation": "Tài liệu"
}
}
diff --git a/client/src/i18n/locales/yo.json b/client/src/i18n/locales/yo.json
index 8756c4f7..b57c6478 100644
--- a/client/src/i18n/locales/yo.json
+++ b/client/src/i18n/locales/yo.json
@@ -13,7 +13,8 @@
"switchDark": "Yipada si akori dudu",
"switchToChinese": "Yipada si Kannada",
"switchToEnglish": "Yipada si English",
- "modelsMenu": "Kiri awoṣe orisi"
+ "modelsMenu": "Kiri awoṣe orisi",
+ "agents": "Awọn aṣoju"
},
"auth": {
"createYourAccount": "Ṣẹda akọọlẹ rẹ",
@@ -375,7 +376,29 @@
"quotaLimit": "Idiwọn",
"quotaRemaining": "Ti o ku",
"quotaReset": "Tunto",
- "quotaObserved": "Ti ṣe akiyesi"
+ "quotaObserved": "Ti ṣe akiyesi",
+ "tabAgents": "Awọn aṣoju",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Isopọ awoṣe Gemini",
+ "geminiDesc": "So awọn orukọ Gemini Pro, Flash, ati Flash-Lite pọ mọ Auto tabi awoṣe katalogu kan pato.",
+ "compatibilityTitle": "Ibamu aṣoju",
+ "compatibilityDesc": "Ṣakoso awọn oju ibamu yiyan ati wiwa awoṣe Claude Code.",
+ "ollamaMode": "Afarawe Ollama",
+ "ollamaModeHint": "Loopback ṣiṣi ko gba ijabọ LAN ti ko ni ijẹrisi rara.",
+ "ollamaOff": "Pa",
+ "ollamaLoopback": "Ṣii lori loopback",
+ "ollamaKeyRequired": "A nilo bọtini API",
+ "claudeAliases": "Awọn inagijẹ wiwa Claude Code",
+ "claudeAliasesHint": "Fi awọn inagijẹ claude/<model> han ki oluyan awoṣe ẹnu-ọna le ṣe atokọ katalogu naa.",
+ "urlTokensTitle": "Awọn tokini URL ti a le fagile",
+ "urlTokensDesc": "Fun awọn alabara ti ko ni akọsori nikan. Awọn tokini URL le jo sinu itan-akọọlẹ ati awọn akọsilẹ, nitorinaa fagile wọn nigbati wọn ko ba nilo mọ.",
+ "urlTokenLabel": "Aami tokini",
+ "createUrlToken": "Ṣẹda tokini",
+ "urlTokenOnce": "Daakọ tokini yii ni bayi. Kii yoo han lẹẹkansi.",
+ "revoked": "Ti fagile",
+ "revoke": "Fagile"
},
"status": {
"healthy": "ni ilera",
@@ -454,7 +477,8 @@
"keyOrdinal": "bọtini #{n}",
"attemptTimingHint": "Bẹrẹ aiṣedeede lati ibere ibere · Iye akoko igbiyanju",
"requestedModel": "Awoṣe ti a beere",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "Awọn ibeere nipasẹ aṣoju"
},
"playground": {
"title": "Ibi isereile",
@@ -674,5 +698,15 @@
"url": "Tẹ URL to wulo ti o bẹrẹ pẹlu http:// tabi https://",
"email": "Tẹ adirẹsi imeeli to wulo",
"passwordMin": "O kere ju awọn ohun kikọ {min}"
+ },
+ "agents": {
+ "title": "Awọn aṣoju kikọ koodu",
+ "description": "So awọn irinṣẹ kikọ koodu pọ mọ ẹnu-ọna awoṣe ọfẹ kan pẹlu iṣeto ti a ṣẹda, ti o ni aabo afẹyinti.",
+ "apiKey": "Bọtini API",
+ "quickstart": "Ọna ti o yara julọ: ṣeto Claude Code lati inu katalogu laaye.",
+ "currentKey": "Bọtini iṣọkan lọwọlọwọ:",
+ "seenRecently": "Ti a rii laipẹ",
+ "endpoint": "Ebute",
+ "documentation": "Iwe akọsilẹ"
}
}
diff --git a/client/src/i18n/locales/zh-CN.json b/client/src/i18n/locales/zh-CN.json
index 8a9b252d..c1ae9447 100644
--- a/client/src/i18n/locales/zh-CN.json
+++ b/client/src/i18n/locales/zh-CN.json
@@ -13,7 +13,8 @@
"switchDark": "切换到深色主题",
"switchToChinese": "切换到中文",
"switchToEnglish": "Switch to English",
- "modelsMenu": "浏览模型类型"
+ "modelsMenu": "浏览模型类型",
+ "agents": "智能体"
},
"auth": {
"createYourAccount": "创建账号",
@@ -375,7 +376,29 @@
"quotaLimit": "上限",
"quotaRemaining": "剩余",
"quotaReset": "重置",
- "quotaObserved": "观测时间"
+ "quotaObserved": "观测时间",
+ "tabAgents": "智能体",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini 模型映射",
+ "geminiDesc": "将 Gemini Pro、Flash 和 Flash-Lite 名称映射到 Auto 或特定的目录模型。",
+ "compatibilityTitle": "智能体兼容性",
+ "compatibilityDesc": "控制需主动启用的兼容性接口以及 Claude Code 模型发现。",
+ "ollamaMode": "Ollama 模拟",
+ "ollamaModeHint": "开放环回绝不接受未经认证的局域网流量。",
+ "ollamaOff": "关闭",
+ "ollamaLoopback": "在环回上开放",
+ "ollamaKeyRequired": "需要 API 密钥",
+ "claudeAliases": "Claude Code 发现别名",
+ "claudeAliasesHint": "公开 claude/<model> 别名,以便网关模型选择器列出目录。",
+ "urlTokensTitle": "可撤销的 URL 令牌",
+ "urlTokensDesc": "仅供无法发送请求头的客户端使用。URL 令牌可能泄露到历史记录和日志中,不再需要时请及时撤销。",
+ "urlTokenLabel": "令牌标签",
+ "createUrlToken": "创建令牌",
+ "urlTokenOnce": "请立即复制此令牌,它不会再次显示。",
+ "revoked": "已撤销",
+ "revoke": "撤销"
},
"status": {
"healthy": "健康",
@@ -454,7 +477,8 @@
"keyOrdinal": "密钥 #{n}",
"attemptTimingHint": "自请求开始的偏移 · 尝试耗时",
"requestedModel": "请求的模型",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "按智能体统计的请求"
},
"playground": {
"title": "试玩台",
@@ -674,5 +698,15 @@
"url": "请输入以 http:// 或 https:// 开头的有效 URL",
"email": "请输入有效的邮箱地址",
"passwordMin": "至少 {min} 个字符"
+ },
+ "agents": {
+ "title": "编码智能体",
+ "description": "通过生成的、可安全备份的配置,将编码工具连接到同一个免费模型网关。",
+ "apiKey": "API 密钥",
+ "quickstart": "最快路径:从实时目录配置 Claude Code。",
+ "currentKey": "当前统一密钥:",
+ "seenRecently": "最近活跃",
+ "endpoint": "端点",
+ "documentation": "文档"
}
}
diff --git a/client/src/i18n/locales/zh-TW.json b/client/src/i18n/locales/zh-TW.json
index b14013b5..e26a92da 100644
--- a/client/src/i18n/locales/zh-TW.json
+++ b/client/src/i18n/locales/zh-TW.json
@@ -13,7 +13,8 @@
"switchDark": "切換到暗色主題",
"switchToChinese": "轉用中文",
"switchToEnglish": "轉用英語",
- "modelsMenu": "瀏覽模型類型"
+ "modelsMenu": "瀏覽模型類型",
+ "agents": "代理程式"
},
"auth": {
"createYourAccount": "建立您的帳號",
@@ -375,7 +376,29 @@
"quotaLimit": "極限",
"quotaRemaining": "現存",
"quotaReset": "重置",
- "quotaObserved": "觀察"
+ "quotaObserved": "觀察",
+ "tabAgents": "代理程式",
+ "familyGeminiPro": "Gemini Pro",
+ "familyGeminiFlash": "Gemini Flash",
+ "familyGeminiFlashLite": "Gemini Flash-Lite",
+ "geminiTitle": "Gemini 模型對應",
+ "geminiDesc": "將 Gemini Pro、Flash 與 Flash-Lite 名稱對應到 Auto 或特定的目錄模型。",
+ "compatibilityTitle": "代理程式相容性",
+ "compatibilityDesc": "控制需主動啟用的相容性介面以及 Claude Code 模型探索。",
+ "ollamaMode": "Ollama 模擬",
+ "ollamaModeHint": "開放迴送絕不接受未經驗證的區域網路流量。",
+ "ollamaOff": "關閉",
+ "ollamaLoopback": "在迴送介面開放",
+ "ollamaKeyRequired": "需要 API 金鑰",
+ "claudeAliases": "Claude Code 探索別名",
+ "claudeAliasesHint": "公開 claude/<model> 別名,讓閘道的模型選擇器能列出目錄。",
+ "urlTokensTitle": "可撤銷的 URL 權杖",
+ "urlTokensDesc": "僅供無法傳送標頭的用戶端使用。URL 權杖可能外洩到歷史記錄與日誌中,不再需要時請撤銷。",
+ "urlTokenLabel": "權杖標籤",
+ "createUrlToken": "建立權杖",
+ "urlTokenOnce": "請立即複製此權杖,之後將不會再顯示。",
+ "revoked": "已撤銷",
+ "revoke": "撤銷"
},
"status": {
"healthy": "健康",
@@ -454,7 +477,8 @@
"keyOrdinal": "關鍵 #{n}",
"attemptTimingHint": "請求起始的起始偏移量 ·嘗試時間",
"requestedModel": "需求模型",
- "ttft": "TTFT"
+ "ttft": "TTFT",
+ "requestsByAgent": "依代理程式的請求"
},
"playground": {
"title": "遊樂場",
@@ -674,5 +698,15 @@
"url": "輸入一個以 http:// 或 https:// 開頭的有效URL",
"email": "輸入有效的電子郵件地址",
"passwordMin": "至少{min}角色"
+ },
+ "agents": {
+ "title": "程式開發代理",
+ "description": "透過產生的、可安全備份的設定,將程式開發工具連接到同一個免費模型閘道。",
+ "apiKey": "API 金鑰",
+ "quickstart": "最快途徑:從即時目錄設定 Claude Code。",
+ "currentKey": "目前的統一金鑰:",
+ "seenRecently": "最近出現",
+ "endpoint": "端點",
+ "documentation": "說明文件"
}
}
diff --git a/client/src/lib/api.ts b/client/src/lib/api.ts
index 12af6fc1..a966623a 100644
--- a/client/src/lib/api.ts
+++ b/client/src/lib/api.ts
@@ -54,6 +54,7 @@ export async function apiFetch<T>(path: string, options?: RequestInit): Promise<
err.code = body.error?.type;
throw err;
}
+ if (res.status === 204) return undefined as T;
// A 200 whose body isn't JSON means this request never reached the API — the
// usual cause is a reverse proxy (or static host) serving the dashboard's
// index.html for /api/* instead of forwarding it to the backend. Without this
diff --git a/client/src/pages/AgentsPage.tsx b/client/src/pages/AgentsPage.tsx
new file mode 100644
index 00000000..0d38b7f8
--- /dev/null
+++ b/client/src/pages/AgentsPage.tsx
@@ -0,0 +1,163 @@
+import { useState } from 'react'
+import { useQuery } from '@tanstack/react-query'
+import { CheckCircle2, ExternalLink } from 'lucide-react'
+import { apiFetch } from '@/lib/api'
+import { useI18n } from '@/i18n'
+import { PageHeader } from '@/components/page-header'
+import { CopyButton } from '@/components/copy-button'
+import { Button } from '@/components/ui/button'
+import { Badge } from '@/components/ui/badge'
+import {
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from '@/components/ui/card'
+import toolCatalog from '@/data/agent-tools.json'
+
+interface ClientAnalytics {
+ clientAgent: string
+ requests: number
+ lastSeenAt: string | null
+}
+
+interface KeyResponse {
+ apiKey: string
+}
+
+const analyticsIds: Record<string, string> = {
+ claude: 'claude-code',
+ codex: 'codex',
+ cline: 'cline',
+ continue: 'continue',
+ aider: 'aider',
+ opencode: 'opencode',
+ goose: 'goose',
+ qwen: 'qwen-code',
+ roo: 'roo',
+ kilo: 'kilo-code',
+ crush: 'crush',
+ cursor: 'cursor',
+}
+
+function masked(value: string): string {
+ if (value.length < 12) return '••••••••'
+ return `${value.slice(0, 8)}${'•'.repeat(12)}${value.slice(-4)}`
+}
+
+export default function AgentsPage() {
+ const { t } = useI18n()
+ const [revealKey, setRevealKey] = useState(false)
+ const { data: keyData } = useQuery<KeyResponse>({
+ queryKey: ['api-key'],
+ queryFn: () => apiFetch('/api/settings/api-key'),
+ })
+ const { data: byClient = [] } = useQuery<ClientAnalytics[]>({
+ queryKey: ['analytics', 'by-client', '30d'],
+ queryFn: () => apiFetch('/api/analytics/by-client?range=30d'),
+ })
+ // "Seen recently" means traffic within the last 7 days, not merely any row
+ // in the fetched 30-day window.
+ const seenCutoff = Date.now() - 7 * 24 * 60 * 60 * 1000
+ const seen = new Map(byClient
+ .filter(row => row.lastSeenAt && Date.parse(row.lastSeenAt) >= seenCutoff)
+ .map(row => [row.clientAgent, row]))
+ const origin = import.meta.env.DEV
+ ? `http://${window.location.hostname}:${__SERVER_PORT__}`
+ : window.location.origin
+ const shownKey = keyData?.apiKey
+ ? (revealKey ? keyData.apiKey : masked(keyData.apiKey))
+ : '…'
+
+ return (
+ <div>
+ <PageHeader
+ title={t('agents.title')}
+ description={t('agents.description')}
+ actions={
+ <Button variant="outline" size="sm" onClick={() => setRevealKey(value => !value)}>
+ {revealKey ? t('common.hide') : t('common.show')} {t('agents.apiKey')}
+ </Button>
+ }
+ />
+
+ <div className="mb-6 rounded-3xl border bg-card p-4">
+ <p className="text-xs text-muted-foreground">{t('agents.quickstart')}</p>
+ <div className="mt-2 flex items-center gap-2 rounded-xl bg-muted/50 px-3 py-2">
+ <code className="min-w-0 flex-1 overflow-x-auto whitespace-nowrap font-mono text-xs">
+ npx freellmapi setup-claude --url {origin}
+ </code>
+ <CopyButton
+ text={`npx freellmapi setup-claude --url ${origin}`}
+ className="size-7 shrink-0"
+ label={t('common.copy')}
+ />
+ </div>
+ <div className="mt-2 flex items-center gap-2 text-xs text-muted-foreground">
+ <span>{t('agents.currentKey')}</span>
+ <code className="font-mono">{shownKey}</code>
+ </div>
+ </div>
+
+ <div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
+ {toolCatalog.map(tool => {
+ const traffic = seen.get(analyticsIds[tool.id] ?? tool.id)
+ const command = `npx freellmapi ${tool.command} --url ${origin}`
+ const endpoint = tool.baseUrlSupport === 'root' ? origin : `${origin}/v1`
+ // The copied snippet is pasted into config files — keep it
+ // locale-independent.
+ const realConnection = `BASE_URL=${endpoint}\nAPI_KEY=${keyData?.apiKey ?? '<unified-key>'}`
+ const shownConnection = `BASE_URL=${endpoint}\nAPI_KEY=${shownKey}`
+ return (
+ <Card key={tool.id} size="sm">
+ <CardHeader>
+ <div
+ className="mb-2 flex size-9 items-center justify-center rounded-xl bg-muted font-mono text-[11px] font-semibold"
+ aria-hidden="true"
+ >
+ {tool.name.replace(/[^A-Za-z0-9]/g, '').slice(0, 2).toUpperCase()}
+ </div>
+ <CardTitle>{tool.name}</CardTitle>
+ <CardDescription>{tool.protocol} · {tool.baseUrlSupport}</CardDescription>
+ <CardAction>
+ {traffic && (
+ <Badge variant="outline" className="border-emerald-500/30 text-emerald-600 dark:text-emerald-400">
+ <CheckCircle2 />
+ {t('agents.seenRecently')}
+ </Badge>
+ )}
+ </CardAction>
+ </CardHeader>
+ <CardContent className="space-y-3">
+ <div className="flex items-center gap-2 rounded-xl bg-muted/50 px-3 py-2">
+ <code className="min-w-0 flex-1 truncate font-mono text-[11px]">{command}</code>
+ <CopyButton text={command} className="size-7 shrink-0" label={t('common.copy')} />
+ </div>
+ <div className="flex items-start gap-2 rounded-xl border px-3 py-2">
+ <code className="min-w-0 flex-1 whitespace-pre-wrap break-all font-mono text-[11px]">
+ {shownConnection}
+ </code>
+ <CopyButton
+ text={realConnection}
+ className="size-7 shrink-0"
+ label={t('common.copy')}
+ />
+ </div>
+ <a
+ href={tool.docsUrl}
+ target="_blank"
+ rel="noreferrer"
+ className="inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground"
+ >
+ {t('agents.documentation')} <ExternalLink className="size-3" />
+ </a>
+ </CardContent>
+ </Card>
+ )
+ })}
+ </div>
+ </div>
+ )
+}
diff --git a/client/src/pages/AnalyticsPage.tsx b/client/src/pages/AnalyticsPage.tsx
index 64cb5661..f83d3dfe 100644
--- a/client/src/pages/AnalyticsPage.tsx
+++ b/client/src/pages/AnalyticsPage.tsx
@@ -52,6 +52,16 @@ interface ByPlatformRow {
totalOutputTokens: number
}
+interface ByClientRow {
+ clientAgent: string
+ requests: number
+ successRate: number
+ avgLatencyMs: number
+ totalInputTokens: number
+ totalOutputTokens: number
+ lastSeenAt: string | null
+}
+
interface TimelineBucket {
timestamp: string
requests: number
@@ -362,6 +372,11 @@ export default function AnalyticsPage() {
queryFn: () => apiFetch<ByPlatformRow[]>(`/api/analytics/by-platform?range=${range}`),
})
+ const { data: byClient = [] } = useQuery({
+ queryKey: ['analytics', 'by-client', range],
+ queryFn: () => apiFetch<ByClientRow[]>(`/api/analytics/by-client?range=${range}`),
+ })
+
const { data: timeline = [] } = useQuery({
queryKey: ['analytics', 'timeline', range],
queryFn: () => apiFetch<TimelineBucket[]>(`/api/analytics/timeline?range=${range}`),
@@ -562,6 +577,22 @@ export default function AnalyticsPage() {
)}
</Panel>
+ <Panel title={t('analytics.requestsByAgent')}>
+ {byClient.length === 0 ? (
+ <p className="text-sm text-muted-foreground text-center py-8">{t('common.noData')}</p>
+ ) : (
+ <ResponsiveContainer width="100%" height={240}>
+ <BarChart data={byClient} margin={{ top: 6, right: 6, left: -12, bottom: 0 }}>
+ <CartesianGrid strokeDasharray="2 4" stroke={gridStyle} />
+ <XAxis dataKey="clientAgent" tick={axisStyle} tickLine={false} axisLine={{ stroke: gridStyle }} />
+ <YAxis tick={axisStyle} tickLine={false} axisLine={false} />
+ <Tooltip contentStyle={tooltipStyle} />
+ <Bar dataKey="requests" name={t('analytics.requests')} fill={seriesB} radius={[3, 3, 0, 0]} maxBarSize={24} />
+ </BarChart>
+ </ResponsiveContainer>
+ )}
+ </Panel>
+
{/* Latency by provider: grouped avg + p95, same unit (ms), one axis. */}
<Panel title={t('analytics.avgLatencyByProvider')}>
{byPlatform.length === 0 ? (
diff --git a/client/src/pages/KeysPage.tsx b/client/src/pages/KeysPage.tsx
index fe347dff..6c64e963 100644
--- a/client/src/pages/KeysPage.tsx
+++ b/client/src/pages/KeysPage.tsx
@@ -15,13 +15,15 @@ import { AnthropicSection } from '@/components/keys/anthropic-section'
import { ProviderList } from '@/components/keys/provider-list'
import { AddKeyDialog } from '@/components/keys/add-key-dialog'
import { ExportKeysDialog } from '@/components/keys/export-keys-dialog'
+import { AgentCompatibilitySection } from '@/components/keys/agent-compatibility-section'
-type KeysTab = 'providers' | 'quotaSignals' | 'apiKey' | 'anthropic'
+type KeysTab = 'providers' | 'quotaSignals' | 'apiKey' | 'anthropic' | 'agents'
const KEYS_TABS: { id: KeysTab; labelKey: string }[] = [
{ id: 'providers', labelKey: 'keys.tabProviders' },
{ id: 'quotaSignals', labelKey: 'keys.tabQuotaSignals' },
{ id: 'apiKey', labelKey: 'keys.tabApiKey' },
{ id: 'anthropic', labelKey: 'keys.tabAnthropic' },
+ { id: 'agents', labelKey: 'keys.tabAgents' },
]
export default function KeysPage() {
@@ -95,6 +97,7 @@ export default function KeysPage() {
)}
{tab === 'anthropic' && <AnthropicSection />}
+ {tab === 'agents' && <AgentCompatibilitySection />}
{tab === 'quotaSignals' && (
<QuotaSignalsSection states={(healthData?.quotaStates ?? []).slice(0, 24)} />
diff --git a/client/tsconfig.app.json b/client/tsconfig.app.json
index b4c2f23e..92347db6 100644
--- a/client/tsconfig.app.json
+++ b/client/tsconfig.app.json
@@ -9,6 +9,7 @@
/* Bundler mode */
"moduleResolution": "bundler",
+ "resolveJsonModule": true,
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
diff --git a/docs/api.md b/docs/api.md
index ebab5921..6d5d4704 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -9,6 +9,9 @@ Any OpenAI-compatible client works (Anthropic / Claude clients too — see [Anth
- [Streaming](#streaming)
- [Tool calling](#tool-calling)
- [Gemini Google Search grounding](#gemini-google-search-grounding)
+- [Native Gemini API](#native-gemini-api)
+- [Ollama emulation](#ollama-emulation)
+- [Revocable URL tokens](#revocable-url-tokens)
- [Vision / image input](#vision--image-input)
- [Images & text-to-speech](#images--text-to-speech)
- [Fusion (multi-model synthesis)](#fusion-multi-model-synthesis)
@@ -151,6 +154,53 @@ resp = client.chat.completions.create(
print(resp.choices[0].message.content)
```
+## Native Gemini API
+
+Gemini SDKs and Gemini CLI can use the native `/v1beta` surface:
+
+- `GET /v1beta/models`
+- `GET /v1beta/models/{model}`
+- `POST /v1beta/models/{model}:generateContent`
+- `POST /v1beta/models/{model}:streamGenerateContent` (`?alt=sse` for Gemini CLI)
+- `POST /v1beta/models/{model}:countTokens`
+
+```bash
+curl "http://localhost:3001/v1beta/models/gemini-2.5-flash:generateContent" \
+ -H "x-goog-api-key: freellmapi-your-unified-key" \
+ -H "Content-Type: application/json" \
+ -d '{"contents":[{"role":"user","parts":[{"text":"hello"}]}]}'
+```
+
+Gemini model names like `gemini-2.5-flash` resolve through the Gemini family map (Keys → Gemini model mapping) rather than the catalog directly, so they route to Auto or whichever catalog model each family is pinned to. Catalog ids work verbatim too.
+
+`contents` text, inline data, function calls/responses, system instructions,
+function declarations, structured JSON output, generation controls, and
+thinking budgets translate into the same internal chat/fallback pipeline.
+Bearer auth works too. Gemini's `?key=` query parameter is accepted only below
+`/v1beta`; prefer a header because URL credentials leak into history and logs.
+
+## Ollama emulation
+
+The opt-in Ollama surface implements tags, chat, generate, show, version, embed,
+and legacy embeddings under `/api/*`. Streaming is Ollama-compatible NDJSON.
+It defaults to `off`; choose `open-loopback` or `key-required` on
+**Keys → Agents**. Open-loopback checks the direct socket peer, so desktop LAN
+access cannot silently turn it into an unauthenticated LAN endpoint.
+
+The dashboard also owns `/api/embeddings`. A request with a valid dashboard
+session continues to the dashboard handler; all other requests at that exact
+path are treated as Ollama legacy embeddings and follow the emulation policy.
+
+## Revocable URL tokens
+
+Headerless clients can mirror models, chat completions, Responses, and
+Ollama-style chat/tags under `/v1/t/{token}/…`. These tokens are random,
+stored only as hashes, separately revocable, and are not the unified key.
+Create/revoke them on **Keys → Agents**.
+
+Treat them as sensitive anyway: URLs are routinely retained by shell history,
+reverse proxies, browser history, and telemetry. Revocation is immediate.
+
## Vision / image input
Send images with the standard OpenAI `image_url` content blocks (base64 `data:` URLs or `http(s)` URLs). When a request contains an image, the router restricts itself to **vision-capable models** and ignores text-only ones. Vision models are tagged with a **Vision** badge on the Fallback Chain page; the current set includes Gemini (2.5 / 3.x), Llama 4 Scout/Maverick (Groq, NVIDIA), GLM-4.6V Flash (Z.ai), Nemotron Nano 12B VL (OpenRouter), and GitHub's GPT-4o / GPT-4.1.
diff --git a/docs/clients.md b/docs/clients.md
index 7df1e8c9..5fe885c8 100644
--- a/docs/clients.md
+++ b/docs/clients.md
@@ -4,6 +4,9 @@
- [OpenAI-compatible clients](#openai-compatible-clients)
- [Coding agents](#coding-agents)
+- [Native Gemini clients](#native-gemini-clients)
+- [Ollama clients](#ollama-clients)
+- [Headerless clients](#headerless-clients)
- [MCP server](#mcp-server)
- [VS Code ghost-text autocomplete (Continue)](#vs-code-ghost-text-autocomplete-continue)
- [Context Handoff](#context-handoff)
@@ -19,19 +22,90 @@ Any client that can target an OpenAI-compatible base URL can use FreeLLMAPI:
## Coding agents
-Every recipe below is the same three facts in a different config file: base URL
-`http://localhost:3001/v1`, the unified key from the dashboard's Keys page, and
-a model (`auto` lets the router pick).
-
-| Agent | Setup |
-| --- | --- |
-| **Claude Code** | `ANTHROPIC_BASE_URL=http://localhost:3001` + `ANTHROPIC_AUTH_TOKEN=<unified key>` — full walkthrough in [Anthropic / Claude clients](api.md#anthropic--claude-clients) |
-| **Codex CLI** | add a provider in `~/.codex/config.toml` with `base_url = "http://localhost:3001/v1"` and its `env_key` pointing at the unified key — the `/v1/responses` surface it needs is implemented |
-| **Cline / Roo Code** | provider type "OpenAI Compatible", base URL `http://localhost:3001/v1`, unified key, model `auto` (or any id from `/v1/models`) |
-| **Continue** | `apiBase: http://localhost:3001/v1` in its config; inline autocomplete works too via the legacy `/v1/completions` surface |
-| **Aider** | `OPENAI_API_BASE=http://localhost:3001/v1` + `OPENAI_API_KEY=<unified key>`, then `aider --model openai/auto` |
-| **opencode** | OpenAI-compatible provider with the same base URL and key |
-| **Cursor** | paste the unified key under a custom OpenAI base URL — but note Cursor verifies and calls the API **from its servers**, so your router must be reachable from the internet (a tunnel or a host with a public address), not just `localhost` |
+Use the generator instead of hand-editing a client configuration:
+
+```bash
+npx freellmapi setup-claude --url http://localhost:3001 --dry-run
+npx freellmapi setup-claude --url http://localhost:3001
+```
+
+`--dry-run` prints a diff. Real writes merge with the existing configuration
+and create a timestamped backup first. `--profile <name>` creates a named
+Claude/Codex profile. The live `/v1/models` catalog supplies the model ids and
+context windows.
+
+| Agent | Automated command | Manual base URL | Wire |
+| --- | --- | --- | --- |
+| **Claude Code** | `setup-claude` or credential-free-on-disk `launch` | `http://localhost:3001` | Anthropic Messages |
+| **Codex CLI** | `setup-codex` or `launch-codex` | `http://localhost:3001/v1` | Responses (`wire_api = "responses"`) |
+| **Cline** | `setup-cline` | `http://localhost:3001/v1` | OpenAI Chat |
+| **Continue** | `setup-continue` | `http://localhost:3001/v1` | OpenAI Chat / legacy Completions |
+| **Aider** | `setup-aider` | `http://localhost:3001/v1` | OpenAI Chat |
+| **OpenCode** | `setup-opencode` | `http://localhost:3001/v1` | OpenAI Chat |
+| **Goose** | `setup-goose` | `http://localhost:3001/v1` | OpenAI Chat |
+| **Qwen Code** | `setup-qwen` | `http://localhost:3001/v1` | OpenAI Chat (native Gemini also works) |
+| **Roo Code** | `setup-roo` | `http://localhost:3001/v1` | OpenAI Chat |
+| **Kilo Code** | `setup-kilo` | `http://localhost:3001/v1` | OpenAI Chat |
+| **Crush** | `setup-crush` | `http://localhost:3001/v1` | OpenAI Chat |
+| **Cursor** | `setup-cursor` prints the guide | public `https://…/v1` | OpenAI Chat |
+| **Anything else** | `setup-generic` prints a ready block | `http://localhost:3001/v1` | OpenAI Chat |
+
+The root-vs-`/v1` distinction matters: Claude Code expects the server root
+because it appends the Anthropic Messages path. OpenAI-compatible clients in
+this table—including Cline, Aider, Goose, Codex, Continue, OpenCode, Qwen,
+Roo, Kilo, and Crush—expect their configured base URL to include `/v1`.
+
+## Native Gemini clients
+
+Gemini CLI and Gemini-lineage clients can speak Google's wire format directly:
+
+```bash
+export GOOGLE_GEMINI_BASE_URL=http://localhost:3001
+export GEMINI_API_KEY=freellmapi-your-unified-key
+gemini
+```
+
+The native surface implements `GET /v1beta/models`, model metadata,
+`generateContent`, `streamGenerateContent` (including `?alt=sse`), and
+`countTokens`. Authentication accepts `x-goog-api-key`, Bearer, or Gemini's
+`?key=` fallback. Prefer the header: query credentials leak into history and
+proxy logs.
+
+The **Keys → Agents** tab maps Gemini Pro, Flash, and Flash-Lite family names to
+Auto or a pinned catalog model.
+
+## Ollama clients
+
+Ollama emulation is off by default. Enable one of these modes on
+**Keys → Agents**:
+
+- `open-loopback`: no key on this machine only. The socket peer must be
+ `127.0.0.1`/`::1`; enabling desktop LAN access does not widen it.
+ **Docker note:** inside a container the socket peer is the Docker bridge
+ IP, not loopback, so this mode refuses even host-local traffic through a
+ published port — use `key-required` for Docker deployments.
+- `key-required`: clients must send `Authorization: Bearer <unified-key>`.
+
+The exact endpoints are `/api/tags`, `/api/chat`, `/api/generate`, `/api/show`,
+`/api/version`, `/api/embed`, and legacy `/api/embeddings`. Streaming uses
+newline-delimited JSON, not SSE. Point Zed, JetBrains AI Assistant, or another
+Ollama-capable client at `http://localhost:3001`.
+
+## Headerless clients
+
+If a client cannot set headers, create a separately revocable token on
+**Keys → Agents** and use:
+
+```text
+http://localhost:3001/v1/t/<token>/chat/completions
+http://localhost:3001/v1/t/<token>/responses
+http://localhost:3001/v1/t/<token>/models
+```
+
+The same prefix exposes `/api/chat` and `/api/tags`. Never put the unified API
+key in a URL. URL tokens have independent hashes and immediate revocation
+because URLs routinely leak into shell history, reverse-proxy logs, and
+telemetry.
## MCP server
diff --git a/package-lock.json b/package-lock.json
index 344e70f4..d38c60f4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,14 +1,15 @@
{
- "name": "freellmapi",
+ "name": "@freellmapi/monorepo",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
- "name": "freellmapi",
+ "name": "@freellmapi/monorepo",
"workspaces": [
"shared",
"server",
- "client"
+ "client",
+ "cli"
],
"devDependencies": {
"concurrently": "^9.1.2"
@@ -18,6 +19,24 @@
"npm": ">=10.0.0"
}
},
+ "cli": {
+ "name": "freellmapi",
+ "version": "0.3.0",
+ "dependencies": {
+ "jsonc-parser": "^3.3.1"
+ },
+ "bin": {
+ "freellmapi": "dist/index.js"
+ },
+ "devDependencies": {
+ "@types/node": "^24.12.2",
+ "typescript": "~6.0.2",
+ "vitest": "^3.1.3"
+ },
+ "engines": {
+ "node": ">=20.18.0 <25.0.0"
+ }
+ },
"client": {
"name": "@freellmapi/client",
"version": "0.0.0",
@@ -6770,6 +6789,10 @@
"node": ">= 0.6"
}
},
+ "node_modules/freellmapi": {
+ "resolved": "cli",
+ "link": true
+ },
"node_modules/fresh": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
@@ -7637,6 +7660,12 @@
"node": ">=6"
}
},
+ "node_modules/jsonc-parser": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz",
+ "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==",
+ "license": "MIT"
+ },
"node_modules/jsonfile": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz",
diff --git a/package.json b/package.json
index 50f6f05b..e9c92edd 100644
--- a/package.json
+++ b/package.json
@@ -1,16 +1,17 @@
{
- "name": "freellmapi",
+ "name": "@freellmapi/monorepo",
"private": true,
"workspaces": [
"shared",
"server",
- "client"
+ "client",
+ "cli"
],
"scripts": {
"dev": "concurrently --kill-others-on-fail --names server,client \"npm run dev -w server\" \"npm run dev -w client\"",
"dev:lan": "concurrently --kill-others-on-fail --names server,client \"npm run dev -w server\" \"npm run dev -w client -- --host\"",
- "test": "npm run test -w server && npm run test -w client --if-present",
- "build": "npm run build -w server && npm run build -w client",
+ "test": "npm run test -w server && npm run test -w cli && npm run test -w client --if-present",
+ "build": "npm run build -w server && npm run build -w cli && npm run build -w client",
"build:server": "npm run build -w server",
"test:migrations": "npm run test:migrations -w server",
"desktop:dev": "npm run build -w client && npm --prefix desktop run dev",
diff --git a/server/src/__tests__/db/migrate/roundtrip.test.ts b/server/src/__tests__/db/migrate/roundtrip.test.ts
index d5ec3aaf..feb487a0 100644
--- a/server/src/__tests__/db/migrate/roundtrip.test.ts
+++ b/server/src/__tests__/db/migrate/roundtrip.test.ts
@@ -19,6 +19,7 @@ const MODEL_SOURCE_PROVENANCE_FILENAME = '20260726_000003_model_source_provenanc
const MEDIA_MODEL_META_FILENAME = '20260726_000004_media_model_meta.ts';
const REQUEST_SERVED_MODEL_FILENAME = '20260726_000005_request_served_model.ts';
const ATTEMPT_ERROR_SUMMARY_FILENAME = '20260726_000006_attempt_error_summary.ts';
+const AGENT_COMPATIBILITY_FILENAME = '20260727_000001_agent_compatibility.ts';
interface SchemaRow {
type: string;
@@ -84,6 +85,7 @@ describe('migration round trip', () => {
MEDIA_MODEL_META_FILENAME,
REQUEST_SERVED_MODEL_FILENAME,
ATTEMPT_ERROR_SUMMARY_FILENAME,
+ AGENT_COMPATIBILITY_FILENAME,
]);
} finally {
db.close();
diff --git a/server/src/__tests__/lib/client-classifier.test.ts b/server/src/__tests__/lib/client-classifier.test.ts
new file mode 100644
index 00000000..5180d4fd
--- /dev/null
+++ b/server/src/__tests__/lib/client-classifier.test.ts
@@ -0,0 +1,59 @@
+import { describe, expect, it } from 'vitest';
+import type { Request } from 'express';
+import { classifyClientAgent } from '../../lib/client-classifier.js';
+
+function request(path: string, headers: Record<string, string> = {}): Request {
+ return {
+ originalUrl: path,
+ headers,
+ } as unknown as Request;
+}
+
+describe('client agent classification', () => {
+ it('prefers distinctive headers and protocol paths', () => {
+ expect(classifyClientAgent(request('/v1/messages', {
+ 'x-claude-code-session-id': 'session',
+ }))).toBe('claude-code');
+ expect(classifyClientAgent(request('/v1/responses'))).toBe('codex');
+ expect(classifyClientAgent(request('/v1beta/models/x:generateContent'))).toBe('gemini-cli');
+ expect(classifyClientAgent(request('/api/chat'))).toBe('ollama-client');
+ expect(classifyClientAgent(request('/v1/t/revocable/responses'))).toBe('codex');
+ expect(classifyClientAgent(request('/v1/t/revocable/api/chat'))).toBe('ollama-client');
+ });
+
+ it('recognizes common coding-agent user agents', () => {
+ expect(classifyClientAgent(request('/v1/chat/completions', {
+ 'user-agent': 'opencode/1.2.3',
+ }))).toBe('opencode');
+ expect(classifyClientAgent(request('/v1/chat/completions', {
+ 'user-agent': 'aider/0.80',
+ }))).toBe('aider');
+ expect(classifyClientAgent(request('/v1/chat/completions', {
+ 'user-agent': 'Kilo-Code/4.2',
+ }))).toBe('kilo-code');
+ expect(classifyClientAgent(request('/v1/chat/completions', {
+ 'user-agent': 'crush/0.8',
+ }))).toBe('crush');
+ });
+
+ it('recognizes Claude Code by its real claude-cli user agent', () => {
+ expect(classifyClientAgent(request('/v1/messages', {
+ 'user-agent': 'claude-cli/1.0.62 (external, cli)',
+ }))).toBe('claude-code');
+ expect(classifyClientAgent(request('/v1/messages', {
+ 'x-session-id': 'affinity',
+ }))).toBe('claude-code');
+ expect(classifyClientAgent(request('/v1/messages'))).toBe('anthropic-sdk');
+ });
+
+ it('lets user agents beat wire-format fallbacks', () => {
+ // Qwen Code speaks the Gemini wire; it must not count as gemini-cli.
+ expect(classifyClientAgent(request('/v1beta/models/x:generateContent', {
+ 'user-agent': 'QwenCode/0.5 qwen-code',
+ }))).toBe('qwen-code');
+ // A plain openai SDK on /v1/responses is not Codex.
+ expect(classifyClientAgent(request('/v1/responses', {
+ 'user-agent': 'OpenAI/NodeJS/4.52.0',
+ }))).toBe('openai-sdk');
+ });
+});
diff --git a/server/src/__tests__/lib/client-context.test.ts b/server/src/__tests__/lib/client-context.test.ts
index 2a1ab95e..8b1c0778 100644
--- a/server/src/__tests__/lib/client-context.test.ts
+++ b/server/src/__tests__/lib/client-context.test.ts
@@ -22,7 +22,7 @@ describe('clientContextMiddleware', () => {
it('captures the socket peer address and user agent', () => {
const ctx = contextFor(fakeReq({ 'user-agent': 'curl/8.6.0' }, '192.168.0.42'));
- expect(ctx).toEqual({ ip: '192.168.0.42', userAgent: 'curl/8.6.0' });
+ expect(ctx).toEqual({ ip: '192.168.0.42', userAgent: 'curl/8.6.0', agent: 'unknown' });
});
it('prefers the first X-Forwarded-For hop over the socket address', () => {
@@ -46,10 +46,10 @@ describe('clientContextMiddleware', () => {
it('stores nulls when REQUEST_ANALYTICS_LOG_CLIENT=false', () => {
process.env.REQUEST_ANALYTICS_LOG_CLIENT = 'false';
const ctx = contextFor(fakeReq({ 'user-agent': 'curl/8.6.0' }, '192.168.0.42'));
- expect(ctx).toEqual({ ip: null, userAgent: null });
+ expect(ctx).toEqual({ ip: null, userAgent: null, agent: null });
});
it('returns nulls outside any request scope', () => {
- expect(getClientContext()).toEqual({ ip: null, userAgent: null });
+ expect(getClientContext()).toEqual({ ip: null, userAgent: null, agent: null });
});
});
diff --git a/server/src/__tests__/lib/gemini-wire.test.ts b/server/src/__tests__/lib/gemini-wire.test.ts
new file mode 100644
index 00000000..8d9b999a
--- /dev/null
+++ b/server/src/__tests__/lib/gemini-wire.test.ts
@@ -0,0 +1,185 @@
+import { describe, expect, it } from 'vitest';
+import {
+ effortFromGeminiThinking,
+ estimateGeminiTokens,
+ geminiContentsToMessages,
+ geminiPartsFromResult,
+ geminiResponseFormat,
+ geminiToolChoice,
+ geminiToolsToChatTools,
+ sanitizeForGemini,
+} from '../../lib/gemini-wire.js';
+
+describe('Gemini wire translation', () => {
+ it('keeps text, images, function calls, and paired function responses', () => {
+ const messages = geminiContentsToMessages({
+ systemInstruction: { parts: [{ text: 'Use tools carefully.' }] },
+ contents: [
+ {
+ role: 'user',
+ parts: [
+ { text: 'Inspect this image' },
+ { inlineData: { mimeType: 'image/png', data: 'aGVsbG8=' } },
+ ],
+ },
+ {
+ role: 'model',
+ parts: [{
+ functionCall: { id: 'call_read', name: 'read_file', args: { path: 'README.md' } },
+ thoughtSignature: 'signed-thought',
+ }],
+ },
+ {
+ role: 'user',
+ parts: [{
+ functionResponse: { name: 'read_file', response: { content: 'hello' } },
+ }],
+ },
+ ],
+ });
+
+ expect(messages[0]).toEqual({ role: 'system', content: 'Use tools carefully.' });
+ expect(messages[1]).toMatchObject({
+ role: 'user',
+ content: [
+ { type: 'text', text: 'Inspect this image' },
+ { type: 'image_url', image_url: { url: 'data:image/png;base64,aGVsbG8=' } },
+ ],
+ });
+ expect(messages[2]).toMatchObject({
+ role: 'assistant',
+ tool_calls: [{
+ id: 'call_read',
+ function: { name: 'read_file', arguments: '{"path":"README.md"}' },
+ thought_signature: 'signed-thought',
+ }],
+ });
+ expect(messages[3]).toEqual({
+ role: 'tool',
+ tool_call_id: 'call_read',
+ name: 'read_file',
+ content: '{"content":"hello"}',
+ });
+ });
+
+ it('maps tool declarations, tool choice, structured output, and thinking budgets', () => {
+ expect(geminiToolsToChatTools([{
+ functionDeclarations: [{
+ name: 'write_file',
+ parameters: { type: 'object', properties: { path: { type: 'string' } } },
+ }],
+ }])?.[0].function.name).toBe('write_file');
+ expect(geminiToolChoice({
+ functionCallingConfig: { mode: 'ANY', allowedFunctionNames: ['write_file'] },
+ })).toEqual({ type: 'function', function: { name: 'write_file' } });
+ expect(geminiResponseFormat({
+ responseMimeType: 'application/json',
+ responseSchema: { type: 'object' },
+ })).toEqual({
+ type: 'json_schema',
+ json_schema: { name: 'gemini_response', schema: { type: 'object' } },
+ });
+ expect(effortFromGeminiThinking({ thinkingConfig: { thinkingBudget: 8_000 } })).toBe('medium');
+ });
+
+ it('sanitizes unsupported schema keywords and emits Gemini function-call parts', () => {
+ expect(sanitizeForGemini({
+ $schema: 'https://json-schema.org/draft/2020-12/schema',
+ type: 'object',
+ properties: {
+ value: {
+ type: 'string',
+ const: 'fixed',
+ 'x-private': true,
+ },
+ },
+ additionalProperties: false,
+ })).toEqual({
+ type: 'object',
+ properties: { value: { type: 'string' } },
+ });
+
+ expect(geminiPartsFromResult({
+ text: 'Done',
+ reasoning: 'Checking',
+ toolCalls: [{
+ id: 'call_1',
+ type: 'function',
+ function: { name: 'write_file', arguments: '{"path":"a.txt"}' },
+ }],
+ })).toEqual([
+ { text: 'Checking', thought: true },
+ { text: 'Done' },
+ { functionCall: { id: 'call_1', name: 'write_file', args: { path: 'a.txt' } } },
+ ]);
+ });
+
+ it('omits tool_choice entirely when the request has no toolConfig', () => {
+ expect(geminiToolChoice(undefined)).toBeUndefined();
+ expect(geminiToolChoice({})).toBeUndefined();
+ expect(geminiToolChoice({ functionCallingConfig: { mode: 'AUTO' } })).toBe('auto');
+ });
+
+ it('treats thinkingBudget -1 as model-managed, not disabled', () => {
+ expect(effortFromGeminiThinking({ thinkingConfig: { thinkingBudget: -1 } })).toBeUndefined();
+ expect(effortFromGeminiThinking({ thinkingConfig: { thinkingBudget: 0 } })).toBe('none');
+ expect(effortFromGeminiThinking({ thinkingConfig: { thinkingBudget: 2048 } })).toBe('low');
+ });
+
+ it('accepts parametersJsonSchema and normalizes the Gemini schema dialect', () => {
+ const tools = geminiToolsToChatTools([{
+ functionDeclarations: [{
+ name: 'lookup',
+ parametersJsonSchema: {
+ type: 'OBJECT',
+ properties: { city: { type: 'STRING', nullable: true } },
+ },
+ }],
+ }]);
+ expect(tools?.[0].function.parameters).toEqual({
+ type: 'object',
+ properties: { city: { type: ['string', 'null'] } },
+ });
+ });
+
+ it('emits tool results before new user text and matches parallel same-name calls FIFO', () => {
+ const messages = geminiContentsToMessages({
+ contents: [
+ {
+ role: 'model',
+ parts: [
+ { functionCall: { name: 'read', args: { path: 'a' } } },
+ { functionCall: { name: 'read', args: { path: 'b' } } },
+ ],
+ },
+ {
+ role: 'user',
+ parts: [
+ { text: 'Now continue.' },
+ { functionResponse: { name: 'read', response: 'A' } },
+ { functionResponse: { name: 'read', response: 'B' } },
+ ],
+ },
+ ],
+ });
+ const assistant = messages[0];
+ const toolIds = messages.filter(m => m.role === 'tool').map(m => m.tool_call_id);
+ expect(assistant.tool_calls).toHaveLength(2);
+ expect(toolIds).toEqual(assistant.tool_calls!.map(call => call.id));
+ // Ordering: assistant, tool, tool, then the new user text.
+ expect(messages.map(m => m.role)).toEqual(['assistant', 'tool', 'tool', 'user']);
+ });
+
+ it('skips replayed thought parts and prices images per-image in estimates', () => {
+ const messages = geminiContentsToMessages({
+ contents: [{ role: 'model', parts: [{ text: 'internal reasoning', thought: true }, { text: 'visible' }] }],
+ });
+ expect(JSON.stringify(messages)).not.toContain('internal reasoning');
+
+ const big = 'A'.repeat(400_000);
+ const tokens = estimateGeminiTokens({
+ contents: [{ role: 'user', parts: [{ text: 'hi' }, { inlineData: { mimeType: 'image/png', data: big } }] }],
+ });
+ expect(tokens).toBeLessThan(1000);
+ });
+});
diff --git a/server/src/__tests__/routes/analytics-client.test.ts b/server/src/__tests__/routes/analytics-client.test.ts
new file mode 100644
index 00000000..550248f5
--- /dev/null
+++ b/server/src/__tests__/routes/analytics-client.test.ts
@@ -0,0 +1,56 @@
+import { beforeAll, beforeEach, describe, expect, it } from 'vitest';
+import type { Express } from 'express';
+import { createApp } from '../../app.js';
+import { getDb, initDb } from '../../db/index.js';
+import { mintDashboardToken } from '../helpers/auth.js';
+
+async function get(app: Express, path: string, token: string) {
+ const server = app.listen(0);
+ const address = server.address() as { port: number };
+ const response = await fetch(`http://127.0.0.1:${address.port}${path}`, {
+ headers: { Authorization: `Bearer ${token}` },
+ });
+ const body = await response.json();
+ server.close();
+ return { status: response.status, body: body as any };
+}
+
+describe('GET /api/analytics/by-client', () => {
+ let app: Express;
+ let token: string;
+
+ beforeAll(() => {
+ process.env.ENCRYPTION_KEY = '0'.repeat(64);
+ initDb(':memory:');
+ app = createApp();
+ token = mintDashboardToken();
+ });
+
+ beforeEach(() => {
+ getDb().prepare('DELETE FROM requests').run();
+ const insert = getDb().prepare(`
+ INSERT INTO requests
+ (platform, model_id, status, input_tokens, output_tokens, latency_ms, client_agent)
+ VALUES (?, ?, ?, ?, ?, ?, ?)
+ `);
+ insert.run('groq', 'coder', 'success', 10, 5, 100, 'claude-code');
+ insert.run('groq', 'coder', 'error', 8, 0, 300, 'claude-code');
+ insert.run('google', 'flash', 'success', 4, 2, 80, 'gemini-cli');
+ });
+
+ it('groups request volume and success by detected agent', async () => {
+ const response = await get(app, '/api/analytics/by-client?range=7d', token);
+ expect(response.status).toBe(200);
+ expect(response.body[0]).toMatchObject({
+ clientAgent: 'claude-code',
+ requests: 2,
+ successRate: 50,
+ avgLatencyMs: 200,
+ });
+ expect(response.body[1]).toMatchObject({
+ clientAgent: 'gemini-cli',
+ requests: 1,
+ successRate: 100,
+ });
+ });
+});
diff --git a/server/src/__tests__/routes/anthropic.test.ts b/server/src/__tests__/routes/anthropic.test.ts
index 795b0087..e0f33ec7 100644
--- a/server/src/__tests__/routes/anthropic.test.ts
+++ b/server/src/__tests__/routes/anthropic.test.ts
@@ -143,6 +143,11 @@ describe('Anthropic-compatible /v1/messages', () => {
db.prepare('DELETE FROM rate_limit_cooldowns').run();
db.prepare('DELETE FROM rate_limit_usage').run();
db.prepare("DELETE FROM settings WHERE key = 'anthropic_model_map'").run();
+ db.prepare(`
+ INSERT INTO settings (key, value)
+ VALUES ('expose_cc_discovery_aliases', '0')
+ ON CONFLICT(key) DO UPDATE SET value = excluded.value
+ `).run();
const { status } = await request(app, '/api/keys',
{ platform: 'groq', key: 'gsk_anthropic_test', label: 't' },
{ Authorization: `Bearer ${dashToken}` });
@@ -227,7 +232,7 @@ describe('Anthropic-compatible /v1/messages', () => {
const db = getDb();
db.prepare('DELETE FROM api_keys').run();
const addGoogle = await request(app, '/api/keys',
- { platform: 'google', key: 'AIza_anthropic_thought_signature_test', label: 'g' },
+ { platform: 'google', key: 'google_anthropic_thought_signature_test', label: 'g' },
{ Authorization: `Bearer ${dashToken}` });
expect(addGoogle.status).toBe(201);
@@ -417,6 +422,34 @@ describe('Anthropic-compatible /v1/messages', () => {
}
});
+ it('gates Claude Code discovery aliases and routes a selected alias', async () => {
+ const hidden = await send(app, 'GET', '/v1/models', undefined, anthropicHeaders());
+ expect(hidden.body.data.some((model: any) => model.id.startsWith('claude/'))).toBe(false);
+
+ const enabled = await send(
+ app,
+ 'PUT',
+ '/api/settings/agent-compatibility',
+ { exposeClaudeDiscoveryAliases: true },
+ { Authorization: `Bearer ${dashToken}` },
+ );
+ expect(enabled.status).toBe(200);
+
+ const discovered = await send(app, 'GET', '/v1/models', undefined, anthropicHeaders());
+ const alias = discovered.body.data.find((model: any) => model.id.startsWith('claude/'));
+ expect(alias).toBeTruthy();
+
+ const captured = mockJson(textCompletion('alias routed'));
+ const response = await request(app, '/v1/messages', {
+ model: alias.id,
+ max_tokens: 32,
+ messages: [{ role: 'user', content: 'hello' }],
+ }, anthropicHeaders());
+ expect(response.status).toBe(200);
+ expect(response.body.model).toBe(alias.id);
+ expect(captured.body.model).not.toContain('claude/');
+ });
+
it('GET /v1/models falls through to the OpenAI shape without anthropic-version', async () => {
const { status, body } = await send(app, 'GET', '/v1/models', undefined, { Authorization: `Bearer ${getUnifiedApiKey()}` });
expect(status).toBe(200);
diff --git a/server/src/__tests__/routes/docs.test.ts b/server/src/__tests__/routes/docs.test.ts
index 32d76f2c..6de061fa 100644
--- a/server/src/__tests__/routes/docs.test.ts
+++ b/server/src/__tests__/routes/docs.test.ts
@@ -56,11 +56,17 @@ describe('OpenAPI docs routes', () => {
// A missing route returns 404; a present-but-unauthenticated route returns
// 401/400. We assert "not 404" so the check is auth-agnostic.
it('documents only paths that exist in the app router', async () => {
- const base = openapiSpec.servers[0].url; // "/v1"
+ const base = openapiSpec.servers[0].url; // "/"
for (const [path, item] of Object.entries(openapiSpec.paths)) {
- for (const method of Object.keys(item as Record<string, unknown>)) {
- const { status } = await request(app, method.toUpperCase(), base + path);
- expect(status, `${method.toUpperCase()} ${base}${path} should exist`).not.toBe(404);
+ for (const method of Object.keys(item as Record<string, unknown>)
+ .filter(key => !key.startsWith('x-'))) {
+ const operation = (item as Record<string, any>)[method];
+ const optional = operation?.['x-optional-surface'] === true;
+ const routePath = `${base.replace(/\/+$/, '')}/${path.replace(/^\/+/, '')}`;
+ const { status } = await request(app, method.toUpperCase(), routePath);
+ if (!optional) {
+ expect(status, `${method.toUpperCase()} ${routePath} should exist`).not.toBe(404);
+ }
}
}
});
diff --git a/server/src/__tests__/routes/gemini.test.ts b/server/src/__tests__/routes/gemini.test.ts
new file mode 100644
index 00000000..645b9346
--- /dev/null
+++ b/server/src/__tests__/routes/gemini.test.ts
@@ -0,0 +1,238 @@
+import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
+import type { Express } from 'express';
+import { createApp } from '../../app.js';
+import { encrypt } from '../../lib/crypto.js';
+import { getDb, getUnifiedApiKey, initDb } from '../../db/index.js';
+
+async function request(
+ app: Express,
+ method: string,
+ path: string,
+ body?: unknown,
+ headers: Record<string, string> = {},
+) {
+ const server = app.listen(0);
+ const address = server.address() as { port: number };
+ const response = await fetch(`http://127.0.0.1:${address.port}${path}`, {
+ method,
+ headers: {
+ ...(body !== undefined ? { 'Content-Type': 'application/json' } : {}),
+ ...headers,
+ },
+ body: body !== undefined ? JSON.stringify(body) : undefined,
+ });
+ const text = await response.text();
+ server.close();
+ let json: any;
+ try { json = JSON.parse(text); } catch { json = null; }
+ return { status: response.status, text, body: json, headers: response.headers };
+}
+
+function seedGroq(): void {
+ const key = encrypt('gsk_gemini_surface_test');
+ getDb().prepare(`
+ INSERT INTO api_keys (platform, label, encrypted_key, iv, auth_tag, status, enabled)
+ VALUES ('groq', 'gemini-test', ?, ?, ?, 'healthy', 1)
+ `).run(key.encrypted, key.iv, key.authTag);
+}
+
+const completion = {
+ id: 'chatcmpl-gemini',
+ object: 'chat.completion',
+ created: 1,
+ model: 'openai/gpt-oss-120b',
+ choices: [{
+ index: 0,
+ message: { role: 'assistant', content: 'hello from Gemini wire' },
+ finish_reason: 'stop',
+ }],
+ usage: { prompt_tokens: 5, completion_tokens: 6, total_tokens: 11 },
+};
+
+describe('native Gemini /v1beta surface', () => {
+ let app: Express;
+
+ beforeAll(() => {
+ process.env.ENCRYPTION_KEY = '0'.repeat(64);
+ initDb(':memory:');
+ app = createApp();
+ });
+
+ beforeEach(() => {
+ getDb().prepare('DELETE FROM api_keys').run();
+ getDb().prepare('DELETE FROM requests').run();
+ getDb().prepare('DELETE FROM rate_limit_usage').run();
+ getDb().prepare('DELETE FROM rate_limit_cooldowns').run();
+ seedGroq();
+ });
+
+ afterEach(() => vi.restoreAllMocks());
+
+ it('lists Gemini-shaped models with x-goog-api-key auth', async () => {
+ const response = await request(app, 'GET', '/v1beta/models', undefined, {
+ 'x-goog-api-key': getUnifiedApiKey(),
+ });
+ expect(response.status).toBe(200);
+ expect(response.body.models[0]).toMatchObject({
+ name: 'models/auto',
+ supportedGenerationMethods: ['generateContent', 'streamGenerateContent', 'countTokens'],
+ });
+ expect(response.body.models.some((model: any) => model.name.startsWith('models/'))).toBe(true);
+
+ const single = await request(app, 'GET', '/v1beta/models/auto', undefined, {
+ 'x-goog-api-key': getUnifiedApiKey(),
+ });
+ expect(single.status).toBe(200);
+ expect(single.body.name).toBe('models/auto');
+ });
+
+ it('translates generateContent and structured tools through the shared router', async () => {
+ let upstreamBody: any;
+ const originalFetch = global.fetch;
+ vi.spyOn(global, 'fetch').mockImplementation(async (url, init) => {
+ if (String(url).includes('api.groq.com/openai/v1/chat/completions')) {
+ upstreamBody = JSON.parse(String(init?.body));
+ return {
+ ok: true,
+ headers: new Headers(),
+ json: async () => completion,
+ } as any;
+ }
+ return originalFetch(url, init);
+ });
+
+ const response = await request(
+ app,
+ 'POST',
+ `/v1beta/models/gemini-2.5-flash:generateContent?key=${getUnifiedApiKey()}`,
+ {
+ systemInstruction: { parts: [{ text: 'Be concise' }] },
+ contents: [{ role: 'user', parts: [{ text: 'hello' }] }],
+ tools: [{
+ functionDeclarations: [{
+ name: 'read_file',
+ description: 'Read a file',
+ parameters: { type: 'object', properties: { path: { type: 'string' } } },
+ }],
+ }],
+ generationConfig: { temperature: 0.2, maxOutputTokens: 64 },
+ },
+ );
+
+ expect(response.status).toBe(200);
+ expect(upstreamBody.messages[0]).toEqual({ role: 'system', content: 'Be concise' });
+ expect(upstreamBody.tools[0].function.name).toBe('read_file');
+ expect(response.body.candidates[0].content.parts).toEqual([{ text: 'hello from Gemini wire' }]);
+ expect(response.body.usageMetadata.totalTokenCount).toBe(11);
+ expect(response.headers.get('x-routed-via')).toContain('groq/');
+ });
+
+ it('returns native Gemini function calls for a tool-using turn', async () => {
+ const originalFetch = global.fetch;
+ vi.spyOn(global, 'fetch').mockImplementation(async (url, init) => {
+ if (String(url).includes('api.groq.com/openai/v1/chat/completions')) {
+ return {
+ ok: true,
+ headers: new Headers(),
+ json: async () => ({
+ ...completion,
+ choices: [{
+ index: 0,
+ message: {
+ role: 'assistant',
+ content: null,
+ tool_calls: [{
+ id: 'call_read',
+ type: 'function',
+ function: { name: 'read_file', arguments: '{"path":"README.md"}' },
+ }],
+ },
+ finish_reason: 'tool_calls',
+ }],
+ }),
+ } as any;
+ }
+ return originalFetch(url, init);
+ });
+
+ const response = await request(
+ app,
+ 'POST',
+ '/v1beta/models/gemini-2.5-flash:generateContent',
+ {
+ contents: [{ role: 'user', parts: [{ text: 'Read the README' }] }],
+ tools: [{
+ functionDeclarations: [{
+ name: 'read_file',
+ parameters: {
+ type: 'object',
+ properties: { path: { type: 'string' } },
+ required: ['path'],
+ },
+ }],
+ }],
+ },
+ { 'x-goog-api-key': getUnifiedApiKey() },
+ );
+
+ expect(response.status).toBe(200);
+ expect(response.body.candidates[0].content.parts).toEqual([{
+ functionCall: {
+ id: 'call_read',
+ name: 'read_file',
+ args: { path: 'README.md' },
+ },
+ }]);
+ expect(response.body.candidates[0].finishReason).toBe('STOP');
+ });
+
+ it('streams SSE for Gemini CLI and exposes countTokens', async () => {
+ const originalFetch = global.fetch;
+ vi.spyOn(global, 'fetch').mockImplementation(async (url, init) => {
+ if (String(url).includes('api.groq.com/openai/v1/chat/completions')) {
+ return new Response(
+ 'data: {"id":"x","object":"chat.completion.chunk","created":1,"model":"x","choices":[{"index":0,"delta":{"content":"hel"},"finish_reason":null}]}\n\n'
+ + 'data: {"id":"x","object":"chat.completion.chunk","created":1,"model":"x","choices":[{"index":0,"delta":{"content":"lo"},"finish_reason":null}]}\n\n'
+ + 'data: {"id":"x","object":"chat.completion.chunk","created":1,"model":"x","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}\n\n'
+ + 'data: [DONE]\n\n',
+ { status: 200, headers: { 'Content-Type': 'text/event-stream' } },
+ );
+ }
+ return originalFetch(url, init);
+ });
+ const body = { contents: [{ role: 'user', parts: [{ text: 'hello world' }] }] };
+ const stream = await request(
+ app,
+ 'POST',
+ '/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse',
+ body,
+ { 'x-goog-api-key': getUnifiedApiKey() },
+ );
+ expect(stream.status).toBe(200);
+ expect(stream.headers.get('content-type')).toContain('text/event-stream');
+ expect(stream.text).toContain('"text":"hel"');
+ expect(stream.text).toContain('"finishReason":"STOP"');
+
+ const jsonStream = await request(
+ app,
+ 'POST',
+ '/v1beta/models/gemini-2.5-flash:streamGenerateContent',
+ body,
+ { 'x-goog-api-key': getUnifiedApiKey() },
+ );
+ expect(jsonStream.status).toBe(200);
+ expect(jsonStream.headers.get('content-type')).toContain('application/json');
+ expect(Array.isArray(jsonStream.body)).toBe(true);
+ expect(jsonStream.body.at(-1).candidates[0].finishReason).toBe('STOP');
+
+ const count = await request(
+ app,
+ 'POST',
+ '/v1beta/models/gemini-2.5-flash:countTokens',
+ body,
+ { 'x-goog-api-key': getUnifiedApiKey() },
+ );
+ expect(count.status).toBe(200);
+ expect(count.body.totalTokens).toBeGreaterThan(0);
+ });
+});
diff --git a/server/src/__tests__/routes/ollama.test.ts b/server/src/__tests__/routes/ollama.test.ts
new file mode 100644
index 00000000..870e8353
--- /dev/null
+++ b/server/src/__tests__/routes/ollama.test.ts
@@ -0,0 +1,255 @@
+import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
+import type { Express } from 'express';
+import { createApp } from '../../app.js';
+import { getDb, getUnifiedApiKey, initDb, setSetting } from '../../db/index.js';
+import { encrypt } from '../../lib/crypto.js';
+import { mintDashboardToken } from '../helpers/auth.js';
+import { isLoopback } from '../../routes/ollama.js';
+
+async function request(
+ app: Express,
+ method: string,
+ path: string,
+ body?: unknown,
+ headers: Record<string, string> = {},
+) {
+ const server = app.listen(0);
+ const address = server.address() as { port: number };
+ const response = await fetch(`http://127.0.0.1:${address.port}${path}`, {
+ method,
+ headers: { ...(body === undefined ? {} : { 'Content-Type': 'application/json' }), ...headers },
+ body: body === undefined ? undefined : JSON.stringify(body),
+ });
+ const text = await response.text();
+ server.close();
+ let json: any;
+ try { json = JSON.parse(text); } catch { json = null; }
+ return { status: response.status, text, body: json, headers: response.headers };
+}
+
+function seedGroq(): void {
+ const key = encrypt('gsk_ollama_surface_test');
+ getDb().prepare(`
+ INSERT INTO api_keys (platform, label, encrypted_key, iv, auth_tag, status, enabled)
+ VALUES ('groq', 'ollama-test', ?, ?, ?, 'healthy', 1)
+ `).run(key.encrypted, key.iv, key.authTag);
+}
+
+describe('Ollama emulation', () => {
+ let app: Express;
+ let dashboardToken: string;
+
+ beforeAll(() => {
+ process.env.ENCRYPTION_KEY = '0'.repeat(64);
+ initDb(':memory:');
+ app = createApp();
+ dashboardToken = mintDashboardToken();
+ });
+
+ beforeEach(() => {
+ getDb().prepare('DELETE FROM api_keys').run();
+ getDb().prepare('DELETE FROM requests').run();
+ getDb().prepare('DELETE FROM rate_limit_usage').run();
+ getDb().prepare('DELETE FROM rate_limit_cooldowns').run();
+ setSetting('ollama_emulation', 'off');
+ seedGroq();
+ });
+
+ afterEach(() => vi.restoreAllMocks());
+
+ it('is closed by default and opens without auth only on loopback', async () => {
+ expect((await request(app, 'GET', '/api/tags')).status).toBe(404);
+ setSetting('ollama_emulation', 'open-loopback');
+ const tags = await request(app, 'GET', '/api/tags');
+ expect(tags.status).toBe(200);
+ expect(tags.body.models.length).toBeGreaterThan(0);
+ // Plain semver — a prerelease suffix compares below the base version for
+ // clients that gate features on a minimum Ollama version.
+ expect((await request(app, 'GET', '/api/version')).body.version).toMatch(/^\d+\.\d+\.\d+$/);
+ });
+
+ it('advertises auto plus only available models, and accepts :latest names', async () => {
+ setSetting('ollama_emulation', 'open-loopback');
+ const tags = await request(app, 'GET', '/api/tags');
+ expect(tags.status).toBe(200);
+ expect(tags.body.models[0].name).toBe('auto');
+ const shown = await request(app, 'POST', '/api/show', { model: `${tags.body.models[1].name}:latest` });
+ expect(shown.status).toBe(200);
+ expect(shown.body.modified_at).toBeTruthy();
+ });
+
+ it('answers load/unload probes without calling any provider', async () => {
+ setSetting('ollama_emulation', 'open-loopback');
+ const fetchSpy = vi.spyOn(global, 'fetch');
+ const load = await request(app, 'POST', '/api/chat', { model: 'auto', messages: [] });
+ expect(load.status).toBe(200);
+ expect(load.body.done_reason).toBe('load');
+ const unload = await request(app, 'POST', '/api/generate', { model: 'auto', prompt: '', keep_alive: 0 });
+ expect(unload.body.done_reason).toBe('unload');
+ expect(unload.body.response).toBe('');
+ const upstreamCalls = fetchSpy.mock.calls.filter(([url]) =>
+ String(url).startsWith('http') && !String(url).includes('127.0.0.1'));
+ expect(upstreamCalls).toHaveLength(0);
+ });
+
+ it('streams generate frames with a generate-shaped terminal frame', async () => {
+ setSetting('ollama_emulation', 'open-loopback');
+ const originalFetch = global.fetch;
+ vi.spyOn(global, 'fetch').mockImplementation(async (url, init) => {
+ if (String(url).includes('api.groq.com/openai/v1/chat/completions')) {
+ return new Response(
+ 'data: {"id":"x","object":"chat.completion.chunk","created":1,"model":"x","choices":[{"index":0,"delta":{"content":"hi"},"finish_reason":null}]}\n\n'
+ + 'data: {"id":"x","object":"chat.completion.chunk","created":1,"model":"x","choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":{"prompt_tokens":2,"completion_tokens":1}}\n\n'
+ + 'data: [DONE]\n\n',
+ { status: 200, headers: { 'Content-Type': 'text/event-stream' } },
+ );
+ }
+ return originalFetch(url, init);
+ });
+ const response = await request(app, 'POST', '/api/generate', { model: 'auto', prompt: 'say hi' });
+ expect(response.status).toBe(200);
+ const frames = response.text.trim().split('\n').map(line => JSON.parse(line));
+ expect(frames[0].response).toBe('hi');
+ const last = frames.at(-1);
+ // Terminal frame must be generate-shaped: `response`, never `message`.
+ expect(last.response).toBe('');
+ expect(last.message).toBeUndefined();
+ expect(last.done).toBe(true);
+ expect(Array.isArray(last.context)).toBe(true);
+ expect(last.eval_duration).toBeGreaterThan(0);
+ });
+
+ it('accepts the real legacy embeddings body ({model, prompt})', async () => {
+ setSetting('ollama_emulation', 'open-loopback');
+ const response = await request(app, 'POST', '/api/embeddings', { model: 'auto', prompt: 'embed me' });
+ // No embedding provider is seeded, so upstream fails — but the request
+ // must pass validation (not 400 invalid request).
+ expect(response.status).not.toBe(400);
+ });
+
+ it('returns 401 for a stale dashboard session on the shared embeddings path', async () => {
+ setSetting('ollama_emulation', 'off');
+ const response = await request(app, 'POST', '/api/embeddings', {}, {
+ Authorization: 'Bearer stale-session-token',
+ });
+ expect(response.status).toBe(401);
+ });
+
+ it('does not treat LAN peers as loopback clients', () => {
+ const peer = (remoteAddress: string, forwarded?: string) => ({
+ socket: { remoteAddress },
+ headers: forwarded ? { 'x-forwarded-for': forwarded } : {},
+ }) as any;
+ expect(isLoopback(peer('127.0.0.1'))).toBe(true);
+ expect(isLoopback(peer('::1'))).toBe(true);
+ expect(isLoopback(peer('::ffff:127.0.0.1'))).toBe(true);
+ expect(isLoopback(peer('192.168.1.20'))).toBe(false);
+ expect(isLoopback(peer('10.0.0.5'))).toBe(false);
+ expect(isLoopback(peer('127.0.0.1', '203.0.113.5'))).toBe(false);
+ expect(isLoopback(peer('127.0.0.1', '127.0.0.1'))).toBe(true);
+ });
+
+ it('emits Ollama-compatible NDJSON chat frames', async () => {
+ setSetting('ollama_emulation', 'open-loopback');
+ const originalFetch = global.fetch;
+ vi.spyOn(global, 'fetch').mockImplementation(async (url, init) => {
+ if (String(url).includes('api.groq.com/openai/v1/chat/completions')) {
+ return new Response(
+ 'data: {"id":"x","object":"chat.completion.chunk","created":1,"model":"x","choices":[{"index":0,"delta":{"content":"one"},"finish_reason":null}]}\n\n'
+ + 'data: {"id":"x","object":"chat.completion.chunk","created":1,"model":"x","choices":[{"index":0,"delta":{"content":" two"},"finish_reason":null}]}\n\n'
+ + 'data: {"id":"x","object":"chat.completion.chunk","created":1,"model":"x","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}\n\n'
+ + 'data: [DONE]\n\n',
+ { status: 200, headers: { 'Content-Type': 'text/event-stream' } },
+ );
+ }
+ return originalFetch(url, init);
+ });
+ const response = await request(app, 'POST', '/api/chat', {
+ model: 'auto',
+ messages: [{ role: 'user', content: 'count' }],
+ });
+ expect(response.status).toBe(200);
+ expect(response.headers.get('content-type')).toContain('application/x-ndjson');
+ const frames = response.text.trim().split('\n').map(line => JSON.parse(line));
+ expect(frames.slice(0, 2).map(frame => frame.message.content)).toEqual(['one', ' two']);
+ expect(frames.at(-1).done).toBe(true);
+ expect(frames.at(-1).done_reason).toBe('stop');
+ });
+
+ it('correlates Ollama tool results with the preceding OpenAI tool call', async () => {
+ setSetting('ollama_emulation', 'open-loopback');
+ let upstreamBody: any;
+ const originalFetch = global.fetch;
+ vi.spyOn(global, 'fetch').mockImplementation(async (url, init) => {
+ if (String(url).includes('api.groq.com/openai/v1/chat/completions')) {
+ upstreamBody = JSON.parse(String(init?.body));
+ return new Response(JSON.stringify({
+ id: 'chatcmpl-ollama-tool',
+ object: 'chat.completion',
+ created: 1,
+ model: 'openai/gpt-oss-120b',
+ choices: [{
+ index: 0,
+ message: { role: 'assistant', content: 'The file is ready.' },
+ finish_reason: 'stop',
+ }],
+ usage: { prompt_tokens: 8, completion_tokens: 5, total_tokens: 13 },
+ }), {
+ status: 200,
+ headers: { 'Content-Type': 'application/json' },
+ });
+ }
+ return originalFetch(url, init);
+ });
+
+ const response = await request(app, 'POST', '/api/chat', {
+ model: 'auto',
+ stream: false,
+ messages: [
+ { role: 'user', content: 'Read README.md' },
+ {
+ role: 'assistant',
+ content: '',
+ tool_calls: [{
+ function: {
+ name: 'read_file',
+ arguments: { path: 'README.md' },
+ },
+ }],
+ },
+ {
+ role: 'tool',
+ tool_name: 'read_file',
+ content: '# FreeLLMAPI',
+ },
+ ],
+ });
+
+ expect(response.status).toBe(200);
+ const assistant = upstreamBody.messages[1];
+ const tool = upstreamBody.messages[2];
+ expect(assistant.tool_calls[0].id).toBeTruthy();
+ expect(tool.tool_call_id).toBe(assistant.tool_calls[0].id);
+ });
+
+ it('requires the unified bearer key in key-required mode', async () => {
+ setSetting('ollama_emulation', 'key-required');
+ expect((await request(app, 'GET', '/api/tags')).status).toBe(401);
+ expect((await request(app, 'GET', '/api/tags', undefined, {
+ Authorization: `Bearer ${getUnifiedApiKey()}`,
+ })).status).toBe(200);
+ });
+
+ it('preserves the dashboard side of the legacy embeddings path collision', async () => {
+ setSetting('ollama_emulation', 'open-loopback');
+ const ollama = await request(app, 'POST', '/api/embeddings', {});
+ expect(ollama.status).toBe(400);
+ expect(ollama.body.error).toContain('invalid request');
+
+ const dashboard = await request(app, 'POST', '/api/embeddings', {}, {
+ Authorization: `Bearer ${dashboardToken}`,
+ });
+ expect(dashboard.status).toBe(404);
+ expect(dashboard.text).not.toContain('invalid request');
+ });
+});
diff --git a/server/src/__tests__/routes/url-tokens.test.ts b/server/src/__tests__/routes/url-tokens.test.ts
new file mode 100644
index 00000000..78739b38
--- /dev/null
+++ b/server/src/__tests__/routes/url-tokens.test.ts
@@ -0,0 +1,118 @@
+import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
+import type { Express } from 'express';
+import { createApp } from '../../app.js';
+import { getDb, getUnifiedApiKey, initDb } from '../../db/index.js';
+import { encrypt } from '../../lib/crypto.js';
+import { mintDashboardToken } from '../helpers/auth.js';
+
+async function request(
+ app: Express,
+ method: string,
+ path: string,
+ body?: unknown,
+ headers: Record<string, string> = {},
+) {
+ const server = app.listen(0);
+ const address = server.address() as { port: number };
+ const response = await fetch(`http://127.0.0.1:${address.port}${path}`, {
+ method,
+ headers: { ...(body === undefined ? {} : { 'Content-Type': 'application/json' }), ...headers },
+ body: body === undefined ? undefined : JSON.stringify(body),
+ });
+ const text = await response.text();
+ server.close();
+ let json: any;
+ try { json = JSON.parse(text); } catch { json = null; }
+ return { status: response.status, body: json };
+}
+
+describe('revocable URL-token aliases', () => {
+ let app: Express;
+ let dashboardToken: string;
+
+ beforeAll(() => {
+ process.env.ENCRYPTION_KEY = '0'.repeat(64);
+ initDb(':memory:');
+ app = createApp();
+ dashboardToken = mintDashboardToken();
+ });
+
+ beforeEach(() => {
+ getDb().prepare('DELETE FROM url_tokens').run();
+ getDb().prepare('DELETE FROM api_keys').run();
+ getDb().prepare('DELETE FROM requests').run();
+ getDb().prepare('DELETE FROM rate_limit_usage').run();
+ getDb().prepare('DELETE FROM rate_limit_cooldowns').run();
+ const key = encrypt('gsk_url_token_test');
+ getDb().prepare(`
+ INSERT INTO api_keys (platform, label, encrypted_key, iv, auth_tag, status, enabled)
+ VALUES ('groq', 'url-token-test', ?, ?, ?, 'healthy', 1)
+ `).run(key.encrypted, key.iv, key.authTag);
+ });
+
+ afterEach(() => vi.restoreAllMocks());
+
+ it('mints once, authenticates a headerless alias, and revokes immediately', async () => {
+ const minted = await request(app, 'POST', '/api/settings/url-tokens', { label: 'VS Code' }, {
+ Authorization: `Bearer ${dashboardToken}`,
+ });
+ expect(minted.status).toBe(201);
+ expect(minted.body.token).toMatch(/^flmurl_/);
+
+ const originalFetch = global.fetch;
+ vi.spyOn(global, 'fetch').mockImplementation(async (url, init) => {
+ if (String(url).includes('api.groq.com/openai/v1/chat/completions')) {
+ return {
+ ok: true,
+ headers: new Headers(),
+ json: async () => ({
+ id: 'chatcmpl-url-token',
+ object: 'chat.completion',
+ created: 1,
+ model: 'openai/gpt-oss-120b',
+ choices: [{
+ index: 0,
+ message: { role: 'assistant', content: 'headerless response' },
+ finish_reason: 'stop',
+ }],
+ usage: { prompt_tokens: 2, completion_tokens: 3, total_tokens: 5 },
+ }),
+ } as any;
+ }
+ return originalFetch(url, init);
+ });
+
+ const models = await request(app, 'GET', `/v1/t/${minted.body.token}/models`);
+ expect(models.status).toBe(200);
+ expect(models.body.data[0].id).toBe('auto');
+
+ const chat = await request(app, 'POST', `/v1/t/${minted.body.token}/chat/completions`, {
+ messages: [{ role: 'user', content: 'hello' }],
+ });
+ expect(chat.status).toBe(200);
+ expect(chat.body.choices[0].message.content).toBe('headerless response');
+
+ const responses = await request(app, 'POST', `/v1/t/${minted.body.token}/responses`, {
+ input: 'hello',
+ stream: false,
+ });
+ expect(responses.status).toBe(200);
+ expect(responses.body.object).toBe('response');
+ expect(responses.body.output_text).toBe('headerless response');
+
+ const ollamaTags = await request(app, 'GET', `/v1/t/${minted.body.token}/api/tags`);
+ expect(ollamaTags.status).toBe(200);
+ expect(ollamaTags.body.models.length).toBeGreaterThan(0);
+
+ const revoked = await request(app, 'DELETE', `/api/settings/url-tokens/${minted.body.id}`, undefined, {
+ Authorization: `Bearer ${dashboardToken}`,
+ });
+ expect(revoked.status).toBe(204);
+ expect((await request(app, 'GET', `/v1/t/${minted.body.token}/models`)).status).toBe(401);
+ });
+
+ it('never accepts the unified API key as a URL credential', async () => {
+ const response = await request(app, 'GET', `/v1/t/${getUnifiedApiKey()}/models`);
+ expect(response.status).toBe(401);
+ });
+});
diff --git a/server/src/__tests__/services/compression.test.ts b/server/src/__tests__/services/compression.test.ts
index 3210ba86..89893eb7 100644
--- a/server/src/__tests__/services/compression.test.ts
+++ b/server/src/__tests__/services/compression.test.ts
@@ -343,7 +343,11 @@ describe('compression engines', () => {
samples.sort((a, b) => a - b);
const p50 = samples[Math.floor(samples.length * 0.5)];
const p99 = samples[samples.length - 1];
- expect(p50).toBeLessThan(5);
+ // Hosted-runner CPU scheduling and Node majors add enough jitter to make
+ // 5 ms flaky (Node 22 measured 5.54–5.77 ms in otherwise-green CI runs).
+ // Keep a tight median guard while the p99/adversarial 25 ms caps below
+ // continue to catch material synchronous regressions.
+ expect(p50).toBeLessThan(8);
expect(p99).toBeLessThan(25);
const unbalancedJson = '['.repeat(100_000);
diff --git a/server/src/app.ts b/server/src/app.ts
index 2296d5df..a93e4e2e 100644
--- a/server/src/app.ts
+++ b/server/src/app.ts
@@ -22,6 +22,9 @@ import { compressionRouter } from './routes/compression.js';
import { authRouter } from './routes/auth.js';
import { docsRouter } from './routes/docs.js';
import { mcpRouter } from './routes/mcp.js';
+import { geminiRouter } from './routes/gemini.js';
+import { ollamaRouter } from './routes/ollama.js';
+import { urlTokenRouter } from './routes/url-tokens.js';
import { requireAuth } from './middleware/requireAuth.js';
import { createProxyRateLimiter } from './middleware/rateLimit.js';
import { errorHandler } from './middleware/errorHandler.js';
@@ -79,6 +82,19 @@ export function createApp(config?: Config) {
// AsyncLocalStorage so logRequest() can read it from any depth.
app.use(clientContextMiddleware);
+ // Ollama emulation owns only its exact fixed /api/* paths. Mount it before
+ // the dashboard session gate because real Ollama clients do not use that
+ // auth scheme. Its legacy /api/embeddings handler explicitly falls through
+ // when it sees a valid dashboard session.
+ // The same per-IP limiter as /v1 runs first: key-required mode is a
+ // brute-forceable credential check without it. Dashboard traffic on the
+ // shared /api/embeddings path shares the (generous, configurable) budget.
+ app.use(
+ ['/api/tags', '/api/version', '/api/show', '/api/chat', '/api/generate', '/api/embed', '/api/embeddings'],
+ createProxyRateLimiter(cfg.proxyRateLimitRpm),
+ );
+ app.use(ollamaRouter);
+
// Dashboard auth (#35): /api/auth/{status,setup,login} bootstrap without a
// session; everything else under /api/* requires a logged-in dashboard user.
// The /v1 proxy keeps its own unified-API-key auth and is NOT gated here.
@@ -104,6 +120,10 @@ export function createApp(config?: Config) {
// owns those two paths; everything else falls through to the routers below.
app.use('/v1', docsRouter);
+ // Separately revocable URL tokens for clients that cannot set headers.
+ app.use('/v1/t/:token', createProxyRateLimiter(cfg.proxyRateLimitRpm));
+ app.use('/v1/t/:token', urlTokenRouter);
+
// OpenAI-compatible proxy. Per-IP rate limiting (#35 item #6) runs first so
// it throttles unauthenticated brute-force / flood attempts before any
// routing work. Tune via PROXY_RATE_LIMIT_RPM; 0 disables it.
@@ -118,6 +138,10 @@ export function createApp(config?: Config) {
// OpenAI Responses API shim (Codex CLI requires wire_api="responses"; see #96)
app.use('/v1', responsesRouter);
+ // Native Gemini wire surface for Gemini CLI and Gemini-lineage agents.
+ app.use('/v1beta', createProxyRateLimiter(cfg.proxyRateLimitRpm));
+ app.use('/v1beta', geminiRouter);
+
// MCP server (Model Context Protocol over stateless Streamable HTTP):
// gateway introspection tools for MCP-speaking agents. Unified-key auth,
// like /v1 — NOT behind the dashboard session gate. Same per-IP limiter as
@@ -167,7 +191,7 @@ export function createApp(config?: Config) {
}));
// SPA fallback — serve index.html for non-API routes
app.use((req, res, next) => {
- if (req.path.startsWith('/api/') || req.path.startsWith('/v1/')) {
+ if (req.path.startsWith('/api/') || req.path.startsWith('/v1/') || req.path.startsWith('/v1beta/')) {
next();
return;
}
diff --git a/server/src/db/migrate/defaults.ts b/server/src/db/migrate/defaults.ts
index 8c717092..ae69af19 100644
--- a/server/src/db/migrate/defaults.ts
+++ b/server/src/db/migrate/defaults.ts
@@ -14,6 +14,7 @@ import * as modelSourceProvenance from '../migrations/20260726_000003_model_sour
import * as mediaModelMeta from '../migrations/20260726_000004_media_model_meta.js';
import * as requestServedModel from '../migrations/20260726_000005_request_served_model.js';
import * as attemptErrorSummary from '../migrations/20260726_000006_attempt_error_summary.js';
+import * as agentCompatibility from '../migrations/20260727_000001_agent_compatibility.js';
export interface MigrationModule {
up(db: Db): void;
@@ -40,6 +41,7 @@ export const MODEL_SOURCE_PROVENANCE_FILENAME = '20260726_000003_model_source_pr
export const MEDIA_MODEL_META_FILENAME = '20260726_000004_media_model_meta.ts';
export const REQUEST_SERVED_MODEL_FILENAME = '20260726_000005_request_served_model.ts';
export const ATTEMPT_ERROR_SUMMARY_FILENAME = '20260726_000006_attempt_error_summary.ts';
+export const AGENT_COMPATIBILITY_FILENAME = '20260727_000001_agent_compatibility.ts';
export const DEFAULT_MIGRATIONS: readonly DefaultMigration[] = [
{ filename: LEGACY_BASELINE_FILENAME, module: legacyBaseline },
@@ -57,4 +59,5 @@ export const DEFAULT_MIGRATIONS: readonly DefaultMigration[] = [
{ filename: MEDIA_MODEL_META_FILENAME, module: mediaModelMeta },
{ filename: REQUEST_SERVED_MODEL_FILENAME, module: requestServedModel },
{ filename: ATTEMPT_ERROR_SUMMARY_FILENAME, module: attemptErrorSummary },
+ { filename: AGENT_COMPATIBILITY_FILENAME, module: agentCompatibility },
];
diff --git a/server/src/db/migrations/20260727_000001_agent_compatibility.ts b/server/src/db/migrations/20260727_000001_agent_compatibility.ts
new file mode 100644
index 00000000..ec7e7a44
--- /dev/null
+++ b/server/src/db/migrations/20260727_000001_agent_compatibility.ts
@@ -0,0 +1,52 @@
+import type { Db } from '../types.js';
+
+function hasColumn(db: Db, table: string, column: string): boolean {
+ const columns = db.prepare(`PRAGMA table_info(${table})`).all() as { name: string }[];
+ return columns.some(entry => entry.name === column);
+}
+
+export function up(db: Db): void {
+ if (!hasColumn(db, 'requests', 'client_agent')) {
+ db.prepare('ALTER TABLE requests ADD COLUMN client_agent TEXT').run();
+ }
+ db.prepare(
+ 'CREATE INDEX IF NOT EXISTS idx_requests_client_agent_created ON requests(client_agent, created_at)',
+ ).run();
+
+ db.exec(`
+ CREATE TABLE IF NOT EXISTS url_tokens (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ token_hash TEXT NOT NULL UNIQUE,
+ label TEXT NOT NULL DEFAULT '',
+ token_prefix TEXT NOT NULL,
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
+ last_used_at TEXT,
+ revoked_at TEXT
+ );
+ CREATE INDEX IF NOT EXISTS idx_url_tokens_active
+ ON url_tokens(token_hash, revoked_at);
+ `);
+
+ db.prepare(
+ "INSERT INTO settings (key, value) VALUES ('ollama_emulation', 'off') ON CONFLICT(key) DO NOTHING",
+ ).run();
+ db.prepare(
+ "INSERT INTO settings (key, value) VALUES ('expose_cc_discovery_aliases', '0') ON CONFLICT(key) DO NOTHING",
+ ).run();
+}
+
+export function down(db: Db): void {
+ db.prepare('DROP TABLE IF EXISTS url_tokens').run();
+ db.prepare('DROP INDEX IF EXISTS idx_requests_client_agent_created').run();
+ if (hasColumn(db, 'requests', 'client_agent')) {
+ db.prepare('ALTER TABLE requests DROP COLUMN client_agent').run();
+ }
+ db.prepare(`
+ DELETE FROM settings
+ WHERE key IN (
+ 'ollama_emulation',
+ 'expose_cc_discovery_aliases',
+ 'gemini_model_map'
+ )
+ `).run();
+}
diff --git a/server/src/docs/openapi.ts b/server/src/docs/openapi.ts
index 6fe6679b..19b92c33 100644
--- a/server/src/docs/openapi.ts
+++ b/server/src/docs/openapi.ts
@@ -22,11 +22,11 @@ export const openapiSpec = {
description:
'OpenAI-compatible proxy that aggregates free LLM provider tiers behind a single /v1 endpoint. ' +
'A router picks an available model per request and fails over when a provider is rate-limited. ' +
- 'The same /v1 router also speaks the OpenAI Responses API and the Anthropic Messages API.',
+ 'The gateway also speaks OpenAI Responses, Anthropic Messages, native Gemini, and Ollama wire formats.',
license: { name: 'MIT', url: 'https://github.com/tashfeenahmed/freellmapi/blob/main/LICENSE' },
},
servers: [
- { url: '/v1', description: 'This proxy instance' },
+ { url: '/', description: 'This proxy instance' },
],
security: [
{ bearerAuth: [] },
@@ -38,9 +38,12 @@ export const openapiSpec = {
{ name: 'Responses', description: 'OpenAI Responses API (Codex CLI wire format)' },
{ name: 'Anthropic', description: 'Anthropic Messages API (Claude Code and the Anthropic SDKs)' },
{ name: 'Models', description: 'Model discovery' },
+ { name: 'Gemini', description: 'Native Gemini generateContent wire format' },
+ { name: 'Ollama', description: 'Opt-in Ollama-compatible local-client surface' },
+ { name: 'URL tokens', description: 'Headerless-client aliases using separately revocable URL tokens' },
],
paths: {
- '/chat/completions': {
+ '/v1/chat/completions': {
post: {
tags: ['Chat'],
operationId: 'createChatCompletion',
@@ -74,7 +77,7 @@ export const openapiSpec = {
},
},
},
- '/completions': {
+ '/v1/completions': {
post: {
tags: ['Chat'],
operationId: 'createCompletion',
@@ -106,7 +109,7 @@ export const openapiSpec = {
},
},
},
- '/embeddings': {
+ '/v1/embeddings': {
post: {
tags: ['Chat'],
operationId: 'createEmbedding',
@@ -136,7 +139,7 @@ export const openapiSpec = {
},
},
},
- '/images/generations': {
+ '/v1/images/generations': {
post: {
tags: ['Media'],
operationId: 'createImage',
@@ -168,7 +171,7 @@ export const openapiSpec = {
},
},
},
- '/audio/speech': {
+ '/v1/audio/speech': {
post: {
tags: ['Media'],
operationId: 'createSpeech',
@@ -198,7 +201,7 @@ export const openapiSpec = {
},
},
},
- '/audio/transcriptions': {
+ '/v1/audio/transcriptions': {
post: {
tags: ['Media'],
operationId: 'createTranscription',
@@ -250,7 +253,7 @@ export const openapiSpec = {
},
},
},
- '/responses': {
+ '/v1/responses': {
post: {
tags: ['Responses'],
operationId: 'createResponse',
@@ -283,7 +286,7 @@ export const openapiSpec = {
},
},
},
- '/messages': {
+ '/v1/messages': {
post: {
tags: ['Anthropic'],
operationId: 'createMessage',
@@ -317,7 +320,7 @@ export const openapiSpec = {
},
},
},
- '/messages/count_tokens': {
+ '/v1/messages/count_tokens': {
post: {
tags: ['Anthropic'],
operationId: 'countTokens',
@@ -345,7 +348,7 @@ export const openapiSpec = {
},
},
},
- '/models': {
+ '/v1/models': {
get: {
tags: ['Models'],
operationId: 'listModels',
@@ -377,6 +380,219 @@ export const openapiSpec = {
},
},
},
+ '/v1beta/models': {
+ get: {
+ tags: ['Gemini'],
+ operationId: 'listGeminiModels',
+ summary: 'List models in Gemini format',
+ security: [{ googleApiKeyHeader: [] }, { googleApiKeyQuery: [] }, { bearerAuth: [] }],
+ responses: {
+ '200': { description: 'Gemini-shaped model list.' },
+ '401': { $ref: '#/components/responses/Unauthorized' },
+ },
+ },
+ },
+ '/v1beta/models/{model}': {
+ get: {
+ tags: ['Gemini'],
+ operationId: 'getGeminiModel',
+ summary: 'Get Gemini-shaped model metadata',
+ security: [{ googleApiKeyHeader: [] }, { googleApiKeyQuery: [] }, { bearerAuth: [] }],
+ parameters: [{
+ name: 'model',
+ in: 'path',
+ required: true,
+ schema: { type: 'string' },
+ }],
+ responses: {
+ '200': { description: 'Gemini-shaped model metadata.' },
+ '404': { description: 'Model not found.' },
+ },
+ },
+ },
+ '/v1beta/models/{model}:generateContent': {
+ post: {
+ tags: ['Gemini'],
+ operationId: 'generateGeminiContent',
+ summary: 'Generate content using the native Gemini wire format',
+ security: [{ googleApiKeyHeader: [] }, { googleApiKeyQuery: [] }, { bearerAuth: [] }],
+ parameters: [{
+ name: 'model',
+ in: 'path',
+ required: true,
+ schema: { type: 'string' },
+ }],
+ requestBody: {
+ required: true,
+ content: { 'application/json': { schema: { $ref: '#/components/schemas/GeminiGenerateRequest' } } },
+ },
+ responses: {
+ '200': { description: 'Gemini candidates and usage metadata.' },
+ '400': { $ref: '#/components/responses/BadRequest' },
+ '401': { $ref: '#/components/responses/Unauthorized' },
+ },
+ },
+ },
+ '/v1beta/models/{model}:streamGenerateContent': {
+ post: {
+ tags: ['Gemini'],
+ operationId: 'streamGeminiContent',
+ summary: 'Stream native Gemini content',
+ description: 'Use `?alt=sse` for Gemini CLI SSE. Without it, the response is a streamed JSON array.',
+ security: [{ googleApiKeyHeader: [] }, { googleApiKeyQuery: [] }, { bearerAuth: [] }],
+ parameters: [
+ { name: 'model', in: 'path', required: true, schema: { type: 'string' } },
+ { name: 'alt', in: 'query', required: false, schema: { type: 'string', enum: ['sse'] } },
+ ],
+ requestBody: {
+ required: true,
+ content: { 'application/json': { schema: { $ref: '#/components/schemas/GeminiGenerateRequest' } } },
+ },
+ responses: {
+ '200': { description: 'SSE or JSON-array Gemini stream.' },
+ '400': { $ref: '#/components/responses/BadRequest' },
+ '401': { $ref: '#/components/responses/Unauthorized' },
+ },
+ },
+ },
+ '/v1beta/models/{model}:countTokens': {
+ post: {
+ tags: ['Gemini'],
+ operationId: 'countGeminiTokens',
+ summary: 'Estimate tokens for Gemini content',
+ security: [{ googleApiKeyHeader: [] }, { googleApiKeyQuery: [] }, { bearerAuth: [] }],
+ parameters: [{
+ name: 'model',
+ in: 'path',
+ required: true,
+ schema: { type: 'string' },
+ }],
+ requestBody: {
+ required: true,
+ content: { 'application/json': { schema: { $ref: '#/components/schemas/GeminiGenerateRequest' } } },
+ },
+ responses: {
+ '200': { description: 'Heuristic token count.' },
+ '401': { $ref: '#/components/responses/Unauthorized' },
+ },
+ },
+ },
+ '/api/tags': {
+ get: {
+ tags: ['Ollama'],
+ operationId: 'listOllamaModels',
+ summary: 'List models in Ollama format',
+ 'x-optional-surface': true,
+ responses: { '200': { description: 'Ollama model list.' }, '404': { description: 'Emulation disabled.' } },
+ },
+ },
+ '/api/chat': {
+ post: {
+ tags: ['Ollama'],
+ operationId: 'ollamaChat',
+ summary: 'Create an Ollama chat response',
+ description: 'Streaming defaults to NDJSON, matching Ollama.',
+ 'x-optional-surface': true,
+ responses: { '200': { description: 'Ollama chat response or NDJSON stream.' }, '404': { description: 'Emulation disabled.' } },
+ },
+ },
+ '/api/generate': {
+ post: {
+ tags: ['Ollama'],
+ operationId: 'ollamaGenerate',
+ summary: 'Create an Ollama legacy prompt response',
+ 'x-optional-surface': true,
+ responses: { '200': { description: 'Ollama generation response or NDJSON stream.' }, '404': { description: 'Emulation disabled.' } },
+ },
+ },
+ '/api/show': {
+ post: {
+ tags: ['Ollama'],
+ operationId: 'showOllamaModel',
+ summary: 'Show Ollama model metadata',
+ 'x-optional-surface': true,
+ responses: { '200': { description: 'Ollama model metadata.' }, '404': { description: 'Emulation disabled or model missing.' } },
+ },
+ },
+ '/api/version': {
+ get: {
+ tags: ['Ollama'],
+ operationId: 'getOllamaVersion',
+ summary: 'Get emulated Ollama version',
+ 'x-optional-surface': true,
+ responses: { '200': { description: 'Emulation version.' }, '404': { description: 'Emulation disabled.' } },
+ },
+ },
+ '/api/embed': {
+ post: {
+ tags: ['Ollama'],
+ operationId: 'ollamaEmbed',
+ summary: 'Create Ollama embeddings',
+ 'x-optional-surface': true,
+ responses: { '200': { description: 'Ollama embedding vectors.' }, '404': { description: 'Emulation disabled.' } },
+ },
+ },
+ '/api/embeddings': {
+ post: {
+ tags: ['Ollama'],
+ operationId: 'ollamaLegacyEmbed',
+ summary: 'Create a legacy Ollama embedding',
+ description: 'A valid dashboard session falls through to the dashboard embeddings API.',
+ 'x-optional-surface': true,
+ responses: { '200': { description: 'Legacy Ollama embedding.' }, '404': { description: 'Emulation disabled.' } },
+ },
+ },
+ '/v1/t/{token}/models': {
+ get: {
+ tags: ['URL tokens'],
+ operationId: 'listModelsWithUrlToken',
+ summary: 'Headerless model discovery',
+ parameters: [{ name: 'token', in: 'path', required: true, schema: { type: 'string' } }],
+ security: [],
+ responses: { '200': { description: 'OpenAI-shaped model list.' }, '401': { description: 'Invalid or revoked URL token.' } },
+ },
+ },
+ '/v1/t/{token}/chat/completions': {
+ post: {
+ tags: ['URL tokens'],
+ operationId: 'chatWithUrlToken',
+ summary: 'Headerless OpenAI chat completions',
+ description: 'URL tokens are separately revocable and are never the unified API key. URLs can leak into history and logs.',
+ parameters: [{ name: 'token', in: 'path', required: true, schema: { type: 'string' } }],
+ security: [],
+ responses: { '200': { description: 'OpenAI chat completion.' }, '401': { description: 'Invalid or revoked URL token.' } },
+ },
+ },
+ '/v1/t/{token}/responses': {
+ post: {
+ tags: ['URL tokens'],
+ operationId: 'responsesWithUrlToken',
+ summary: 'Headerless OpenAI Responses API',
+ parameters: [{ name: 'token', in: 'path', required: true, schema: { type: 'string' } }],
+ security: [],
+ responses: { '200': { description: 'OpenAI Responses response.' }, '401': { description: 'Invalid or revoked URL token.' } },
+ },
+ },
+ '/v1/t/{token}/api/chat': {
+ post: {
+ tags: ['URL tokens'],
+ operationId: 'ollamaChatWithUrlToken',
+ summary: 'Headerless Ollama chat',
+ parameters: [{ name: 'token', in: 'path', required: true, schema: { type: 'string' } }],
+ security: [],
+ responses: { '200': { description: 'Ollama response or NDJSON stream.' }, '401': { description: 'Invalid or revoked URL token.' } },
+ },
+ },
+ '/v1/t/{token}/api/tags': {
+ get: {
+ tags: ['URL tokens'],
+ operationId: 'ollamaTagsWithUrlToken',
+ summary: 'Headerless Ollama model discovery',
+ parameters: [{ name: 'token', in: 'path', required: true, schema: { type: 'string' } }],
+ security: [],
+ responses: { '200': { description: 'Ollama model list.' }, '401': { description: 'Invalid or revoked URL token.' } },
+ },
+ },
},
components: {
securitySchemes: {
@@ -393,6 +609,18 @@ export const openapiSpec = {
name: 'x-api-key',
description: 'Unified API key as `x-api-key: <key>` (Anthropic-style clients).',
},
+ googleApiKeyHeader: {
+ type: 'apiKey',
+ in: 'header',
+ name: 'x-goog-api-key',
+ description: 'Unified API key in Gemini SDK format.',
+ },
+ googleApiKeyQuery: {
+ type: 'apiKey',
+ in: 'query',
+ name: 'key',
+ description: 'Gemini compatibility fallback. Prefer the header because URLs leak into history and logs.',
+ },
},
responses: {
BadRequest: {
@@ -413,6 +641,45 @@ export const openapiSpec = {
},
},
schemas: {
+ GeminiGenerateRequest: {
+ type: 'object',
+ required: ['contents'],
+ properties: {
+ contents: {
+ type: 'array',
+ minItems: 1,
+ items: {
+ type: 'object',
+ properties: {
+ role: { type: 'string', enum: ['user', 'model'] },
+ parts: {
+ type: 'array',
+ items: {
+ type: 'object',
+ description: 'A text, inlineData, functionCall, or functionResponse part.',
+ },
+ },
+ },
+ },
+ },
+ systemInstruction: { type: 'object' },
+ tools: { type: 'array', items: { type: 'object' } },
+ toolConfig: { type: 'object' },
+ generationConfig: {
+ type: 'object',
+ properties: {
+ temperature: { type: 'number' },
+ topP: { type: 'number' },
+ topK: { type: 'integer' },
+ maxOutputTokens: { type: 'integer' },
+ stopSequences: { type: 'array', items: { type: 'string' } },
+ responseMimeType: { type: 'string' },
+ responseSchema: { type: 'object' },
+ thinkingConfig: { type: 'object' },
+ },
+ },
+ },
+ },
ChatCompletionRequest: {
type: 'object',
required: ['messages'],
diff --git a/server/src/lib/client-classifier.ts b/server/src/lib/client-classifier.ts
new file mode 100644
index 00000000..6f599845
--- /dev/null
+++ b/server/src/lib/client-classifier.ts
@@ -0,0 +1,80 @@
+import type { Request } from 'express';
+
+export const CLIENT_AGENTS = [
+ 'claude-code',
+ 'codex',
+ 'cline',
+ 'roo',
+ 'continue',
+ 'aider',
+ 'opencode',
+ 'goose',
+ 'qwen-code',
+ 'kilo-code',
+ 'crush',
+ 'cursor',
+ 'gemini-cli',
+ 'zed',
+ 'jetbrains',
+ 'ollama-client',
+ 'openai-sdk',
+ 'anthropic-sdk',
+ 'unknown',
+] as const;
+
+export type ClientAgent = (typeof CLIENT_AGENTS)[number];
+
+function header(req: Request, name: string): string {
+ const raw = req.headers[name];
+ return (Array.isArray(raw) ? raw[0] : raw)?.toLowerCase() ?? '';
+}
+
+/**
+ * Best-effort classifier from stable protocol/header signals first, then UA.
+ * It intentionally returns a coarse enum: analytics should remain useful when
+ * a client revs its version string or wraps an underlying SDK.
+ */
+export function classifyClientAgent(req: Request): ClientAgent {
+ const path = (req.originalUrl ?? req.url ?? '').split('?')[0].toLowerCase();
+ const tokenizedPath = path.replace(/^\/v1\/t\/[^/]+/, '');
+ const ua = header(req, 'user-agent');
+
+ // Strongest signal first: the dedicated session header only Claude Code sets.
+ if (header(req, 'x-claude-code-session-id')) return 'claude-code';
+
+ // UA signals must beat wire-format fallbacks: Qwen Code speaks the Gemini
+ // wire on /v1beta, and a plain openai SDK can call /v1/responses — neither
+ // should be counted as the surface's flagship client. Claude Code's real UA
+ // is `claude-cli/x.y.z (external, cli)`.
+ if (/claude[- ]?code|\bclaude-cli\b/.test(ua)) return 'claude-code';
+ if (/\bcodex\b/.test(ua)) return 'codex';
+ if (/qwen[- ]?code|\bqwen-cli\b/.test(ua)) return 'qwen-code';
+ if (/gemini[- /]?cli/.test(ua)) return 'gemini-cli';
+ if (/kilo[- ]?code|\bkilocode\b/.test(ua)) return 'kilo-code';
+ if (/\bcrush(?:\/|\s|$)/.test(ua)) return 'crush';
+ if (/opencode/.test(ua)) return 'opencode';
+ if (/\bcline\b/.test(ua)) return 'cline';
+ if (/\broo[- /]/.test(ua) || /roo code/.test(ua)) return 'roo';
+ if (/continue(?:\.dev)?/.test(ua)) return 'continue';
+ if (/\baider\b/.test(ua)) return 'aider';
+ if (/\bgoose\b/.test(ua)) return 'goose';
+ if (/\bcursor\b/.test(ua)) return 'cursor';
+ if (/\bzed\b/.test(ua)) return 'zed';
+ if (/jetbrains|intellij|pycharm|webstorm/.test(ua)) return 'jetbrains';
+ if (/\bollama\b/.test(ua)) return 'ollama-client';
+ if (/anthropic|claude-sdk/.test(ua)) return 'anthropic-sdk';
+ if (/openai|langchain|litellm/.test(ua)) return 'openai-sdk';
+
+ // Wire-format fallbacks for clients with no recognizable UA.
+ if (path.startsWith('/v1/responses') || tokenizedPath.startsWith('/responses')) return 'codex';
+ if (path.startsWith('/v1beta/')) return 'gemini-cli';
+ if (path.startsWith('/v1/messages')) {
+ // anthropic.ts session affinity treats x-session-id as a Claude Code
+ // signal on this surface; anything else Anthropic-shaped stays coarse.
+ return header(req, 'x-session-id') ? 'claude-code' : 'anthropic-sdk';
+ }
+ if (tokenizedPath.startsWith('/api/chat')
+ || tokenizedPath.startsWith('/api/generate')
+ || tokenizedPath.startsWith('/api/tags')) return 'ollama-client';
+ return 'unknown';
+}
diff --git a/server/src/lib/client-context.ts b/server/src/lib/client-context.ts
index 23740816..324d8338 100644
--- a/server/src/lib/client-context.ts
+++ b/server/src/lib/client-context.ts
@@ -1,9 +1,11 @@
import { AsyncLocalStorage } from 'async_hooks';
import type { NextFunction, Request, Response } from 'express';
+import { classifyClientAgent, type ClientAgent } from './client-classifier.js';
export interface ClientContext {
ip: string | null;
userAgent: string | null;
+ agent: ClientAgent | null;
}
// Request-scoped caller identity, readable from anywhere below the middleware
@@ -31,13 +33,17 @@ function clientLoggingEnabled(): boolean {
export function clientContextMiddleware(req: Request, _res: Response, next: NextFunction): void {
if (!clientLoggingEnabled()) {
- storage.run({ ip: null, userAgent: null }, next);
+ storage.run({ ip: null, userAgent: null, agent: null }, next);
return;
}
const ua = req.headers['user-agent'];
- storage.run({ ip: resolveClientIp(req), userAgent: typeof ua === 'string' ? ua.slice(0, 256) : null }, next);
+ storage.run({
+ ip: resolveClientIp(req),
+ userAgent: typeof ua === 'string' ? ua.slice(0, 256) : null,
+ agent: classifyClientAgent(req),
+ }, next);
}
export function getClientContext(): ClientContext {
- return storage.getStore() ?? { ip: null, userAgent: null };
+ return storage.getStore() ?? { ip: null, userAgent: null, agent: null };
}
diff --git a/server/src/lib/gemini-wire.ts b/server/src/lib/gemini-wire.ts
new file mode 100644
index 00000000..d9784820
--- /dev/null
+++ b/server/src/lib/gemini-wire.ts
@@ -0,0 +1,366 @@
+import type {
+ ChatContentBlock,
+ ChatMessage,
+ ChatToolCall,
+ ChatToolChoice,
+ ChatToolDefinition,
+} from '@freellmapi/shared/types.js';
+import type { ReasoningEffort, ResponseFormat } from './sampling-params.js';
+import type { InboundChatResult } from './inbound-chat.js';
+
+export interface GeminiPart {
+ text?: string;
+ thought?: boolean;
+ inlineData?: { mimeType?: string; data?: string };
+ inline_data?: { mime_type?: string; data?: string };
+ functionCall?: { id?: string; name?: string; args?: unknown };
+ functionResponse?: { id?: string; name?: string; response?: unknown };
+ thoughtSignature?: string;
+ [key: string]: unknown;
+}
+
+export interface GeminiContent {
+ role?: 'user' | 'model';
+ parts?: GeminiPart[];
+}
+
+export interface GeminiInboundRequest {
+ contents: GeminiContent[];
+ systemInstruction?: { parts?: GeminiPart[] };
+ tools?: Array<{ functionDeclarations?: Array<{
+ name?: string;
+ description?: string;
+ parameters?: Record<string, unknown>;
+ // Newer @google/genai clients (incl. Gemini CLI's MCP tool path) send
+ // plain JSON Schema under this alternative field instead of `parameters`.
+ parametersJsonSchema?: Record<string, unknown>;
+ }> }>;
+ toolConfig?: {
+ functionCallingConfig?: {
+ mode?: string;
+ allowedFunctionNames?: string[];
+ };
+ };
+ generationConfig?: {
+ temperature?: number;
+ topP?: number;
+ topK?: number;
+ maxOutputTokens?: number;
+ stopSequences?: string[];
+ responseMimeType?: string;
+ responseSchema?: Record<string, unknown>;
+ responseJsonSchema?: Record<string, unknown>;
+ thinkingConfig?: { thinkingBudget?: number };
+ };
+}
+
+// Gemini-native clients write schemas in the API's OpenAPI-flavored dialect:
+// Type enum casing ("OBJECT", "STRING") and `nullable: true`. OpenAI-style
+// strict json_schema validators reject both, so normalize the inbound
+// direction (the outbound direction has sanitizeForGemini).
+const GEMINI_TYPE_ENUM = new Set(['object', 'string', 'number', 'integer', 'boolean', 'array', 'null']);
+
+export function normalizeGeminiSchema(schema: unknown): unknown {
+ if (Array.isArray(schema)) return schema.map(normalizeGeminiSchema);
+ if (!schema || typeof schema !== 'object') return schema;
+ const out: Record<string, unknown> = {};
+ let nullable = false;
+ for (const [key, value] of Object.entries(schema as Record<string, unknown>)) {
+ if (key === 'nullable') {
+ nullable = value === true;
+ continue;
+ }
+ if (key === 'type' && typeof value === 'string' && GEMINI_TYPE_ENUM.has(value.toLowerCase())) {
+ out.type = value.toLowerCase();
+ continue;
+ }
+ if (key === 'properties' && value && typeof value === 'object' && !Array.isArray(value)) {
+ out.properties = Object.fromEntries(
+ Object.entries(value as Record<string, unknown>).map(([name, child]) => [name, normalizeGeminiSchema(child)]),
+ );
+ continue;
+ }
+ out[key] = normalizeGeminiSchema(value);
+ }
+ if (nullable && typeof out.type === 'string') out.type = [out.type, 'null'];
+ return out;
+}
+
+const UNSUPPORTED_SCHEMA_KEYS = new Set([
+ '$schema', '$id', '$ref', '$defs', '$comment',
+ 'definitions',
+ 'exclusiveMinimum', 'exclusiveMaximum',
+ 'patternProperties', 'unevaluatedProperties', 'unevaluatedItems',
+ 'if', 'then', 'else',
+ 'contentEncoding', 'contentMediaType', 'contentSchema',
+ 'dependentRequired', 'dependentSchemas', 'dependencies',
+ 'additionalProperties',
+ 'examples', 'const', 'readOnly', 'writeOnly',
+ 'uniqueItems',
+ 'not', 'allOf', 'oneOf',
+ 'prefixItems',
+ 'contains', 'minContains', 'maxContains',
+ 'propertyNames',
+ 'multipleOf',
+ 'deprecated',
+]);
+
+const VENDOR_EXTENSION_SCHEMA_KEY = /^x-/i;
+
+export function sanitizeForGemini(schema: unknown): unknown {
+ return sanitizeSchema(schema, false);
+}
+
+function sanitizeSchema(schema: unknown, insidePropertiesMap: boolean): unknown {
+ if (Array.isArray(schema)) return schema.map(value => sanitizeSchema(value, false));
+ if (!schema || typeof schema !== 'object') return schema;
+ const out: Record<string, unknown> = {};
+ for (const [key, value] of Object.entries(schema as Record<string, unknown>)) {
+ if (insidePropertiesMap) {
+ out[key] = sanitizeSchema(value, false);
+ } else if (!UNSUPPORTED_SCHEMA_KEYS.has(key) && !VENDOR_EXTENSION_SCHEMA_KEY.test(key)) {
+ out[key] = sanitizeSchema(value, key === 'properties');
+ }
+ }
+ return out;
+}
+
+function serializeResponse(value: unknown): string {
+ if (typeof value === 'string') return value;
+ try {
+ return JSON.stringify(value ?? {});
+ } catch {
+ return String(value);
+ }
+}
+
+function systemText(system?: GeminiInboundRequest['systemInstruction']): string {
+ return (system?.parts ?? [])
+ .map(part => typeof part.text === 'string' ? part.text : '')
+ .filter(Boolean)
+ .join('\n');
+}
+
+export function geminiContentsToMessages(body: GeminiInboundRequest): ChatMessage[] {
+ const messages: ChatMessage[] = [];
+ // FIFO per name: parallel calls to the same tool without client-echoed ids
+ // must each consume their own synthesized id, or one call is left without a
+ // response and strict upstreams reject the history.
+ const pendingCallIdsByName = new Map<string, string[]>();
+ const system = systemText(body.systemInstruction);
+ if (system) messages.push({ role: 'system', content: system });
+
+ for (const content of body.contents ?? []) {
+ const role = content.role === 'model' ? 'assistant' : 'user';
+ const textBlocks: ChatContentBlock[] = [];
+ const calls: ChatToolCall[] = [];
+ const functionResponses: GeminiPart[] = [];
+
+ for (const part of content.parts ?? []) {
+ // Thought summaries kept in client history are not conversation content.
+ if (typeof part.text === 'string' && part.thought !== true) {
+ textBlocks.push({ type: 'text', text: part.text });
+ }
+ const inline = part.inlineData ?? (
+ part.inline_data
+ ? { mimeType: part.inline_data.mime_type, data: part.inline_data.data }
+ : undefined
+ );
+ if (inline?.mimeType && inline.data) {
+ textBlocks.push({
+ type: 'image_url',
+ image_url: { url: `data:${inline.mimeType};base64,${inline.data}` },
+ });
+ }
+ if (part.functionCall?.name) {
+ const id = part.functionCall.id || `call_${messages.length}_${calls.length}`;
+ calls.push({
+ id,
+ type: 'function',
+ function: {
+ name: part.functionCall.name,
+ arguments: typeof part.functionCall.args === 'string'
+ ? part.functionCall.args
+ : JSON.stringify(part.functionCall.args ?? {}),
+ },
+ ...(part.thoughtSignature ? { thought_signature: part.thoughtSignature } : {}),
+ });
+ const queue = pendingCallIdsByName.get(part.functionCall.name) ?? [];
+ queue.push(id);
+ pendingCallIdsByName.set(part.functionCall.name, queue);
+ }
+ if (part.functionResponse?.name) functionResponses.push(part);
+ }
+
+ if (role === 'assistant') {
+ messages.push({
+ role,
+ content: textBlocks.length ? textBlocks : null,
+ ...(calls.length ? { tool_calls: calls } : {}),
+ });
+ }
+
+ // Tool results answer the preceding assistant tool_calls; they must come
+ // before any new user text or strict upstreams reject the ordering.
+ for (const part of functionResponses) {
+ const response = part.functionResponse!;
+ messages.push({
+ role: 'tool',
+ tool_call_id: response.id || pendingCallIdsByName.get(response.name!)?.shift()
+ || `call_${messages.length}`,
+ name: response.name,
+ content: serializeResponse(response.response),
+ });
+ }
+
+ if (role !== 'assistant' && (textBlocks.length || functionResponses.length === 0)) {
+ messages.push({
+ role: 'user',
+ content: textBlocks.length ? textBlocks : '',
+ });
+ }
+ }
+ return messages;
+}
+
+export function geminiToolsToChatTools(
+ tools: GeminiInboundRequest['tools'],
+): ChatToolDefinition[] | undefined {
+ const declarations = (tools ?? []).flatMap(tool => tool.functionDeclarations ?? []);
+ const converted = declarations
+ .filter(declaration => !!declaration.name)
+ .map(declaration => ({
+ type: 'function' as const,
+ function: {
+ name: declaration.name!,
+ description: declaration.description,
+ parameters: normalizeGeminiSchema(
+ declaration.parameters
+ ?? declaration.parametersJsonSchema
+ ?? { type: 'object', properties: {} },
+ ) as Record<string, unknown>,
+ },
+ }));
+ return converted.length ? converted : undefined;
+}
+
+export function geminiToolChoice(config: GeminiInboundRequest['toolConfig']): ChatToolChoice | undefined {
+ const fc = config?.functionCallingConfig;
+ const mode = fc?.mode?.toUpperCase();
+ // No toolConfig at all must map to undefined: emitting tool_choice on a
+ // tool-free request 400s on strict OpenAI-compatible upstreams.
+ if (!mode) return undefined;
+ if (mode === 'AUTO') return 'auto';
+ if (mode === 'NONE') return 'none';
+ if (mode === 'ANY') {
+ const name = fc?.allowedFunctionNames?.[0];
+ return name ? { type: 'function', function: { name } } : 'required';
+ }
+ return undefined;
+}
+
+export function geminiResponseFormat(
+ config: GeminiInboundRequest['generationConfig'],
+): ResponseFormat | undefined {
+ if (config?.responseMimeType !== 'application/json') return undefined;
+ const schema = config.responseSchema ?? config.responseJsonSchema;
+ if (schema) {
+ return {
+ type: 'json_schema',
+ json_schema: {
+ name: 'gemini_response',
+ schema: normalizeGeminiSchema(schema) as Record<string, unknown>,
+ },
+ };
+ }
+ return { type: 'json_object' };
+}
+
+export function effortFromGeminiThinking(
+ config: GeminiInboundRequest['generationConfig'],
+): ReasoningEffort | undefined {
+ const budget = config?.thinkingConfig?.thinkingBudget;
+ if (budget == null) return undefined;
+ // -1 is the API's "dynamic thinking" (model-managed budget) and is Gemini
+ // CLI's default — leave the provider default in place rather than disabling.
+ if (budget < 0) return undefined;
+ if (budget === 0) return 'none';
+ if (budget < 4096) return 'low';
+ if (budget < 16384) return 'medium';
+ return 'high';
+}
+
+export function geminiFinishReason(
+ finishReason: string | null,
+ hasToolCalls = false,
+): string {
+ if (hasToolCalls) return 'STOP';
+ switch ((finishReason ?? '').toLowerCase()) {
+ case 'length':
+ return 'MAX_TOKENS';
+ case 'content_filter':
+ return 'SAFETY';
+ default:
+ return 'STOP';
+ }
+}
+
+export function geminiPartsFromResult(result: Pick<InboundChatResult, 'text' | 'reasoning' | 'toolCalls'>): GeminiPart[] {
+ const parts: GeminiPart[] = [];
+ if (result.reasoning) parts.push({ text: result.reasoning, thought: true });
+ if (result.text) parts.push({ text: result.text });
+ for (const call of result.toolCalls) {
+ let args: unknown = {};
+ try {
+ args = JSON.parse(call.function.arguments);
+ } catch {
+ args = { value: call.function.arguments };
+ }
+ parts.push({
+ functionCall: {
+ id: call.id,
+ name: call.function.name,
+ args,
+ },
+ ...(call.thought_signature ? { thoughtSignature: call.thought_signature } : {}),
+ });
+ }
+ return parts;
+}
+
+export function geminiResponseFromResult(result: InboundChatResult): Record<string, unknown> {
+ return {
+ candidates: [{
+ content: { role: 'model', parts: geminiPartsFromResult(result) },
+ finishReason: geminiFinishReason(result.finishReason, result.toolCalls.length > 0),
+ index: 0,
+ }],
+ usageMetadata: {
+ promptTokenCount: result.promptTokens,
+ candidatesTokenCount: result.completionTokens,
+ totalTokenCount: result.promptTokens + result.completionTokens,
+ },
+ modelVersion: result.route.modelId,
+ };
+}
+
+// Gemini bills images at a fixed per-tile cost; counting their base64 length
+// as text overreports by orders of magnitude and triggers premature client
+// context compression.
+const GEMINI_IMAGE_TOKENS = 258;
+
+export function estimateGeminiTokens(
+ body: Pick<GeminiInboundRequest, 'contents' | 'systemInstruction' | 'tools'>,
+): number {
+ let tokens = Math.ceil(systemText(body.systemInstruction).length / 4);
+ for (const content of body.contents ?? []) {
+ for (const part of content.parts ?? []) {
+ if (typeof part.text === 'string') tokens += Math.ceil(part.text.length / 4);
+ if (part.inlineData?.data || part.inline_data?.data) tokens += GEMINI_IMAGE_TOKENS;
+ if (part.functionCall) tokens += Math.ceil(JSON.stringify(part.functionCall).length / 4);
+ if (part.functionResponse) tokens += Math.ceil(JSON.stringify(part.functionResponse).length / 4);
+ }
+ }
+ if (body.tools?.length) tokens += Math.ceil(JSON.stringify(body.tools).length / 4);
+ return tokens;
+}
diff --git a/server/src/lib/inbound-chat.ts b/server/src/lib/inbound-chat.ts
new file mode 100644
index 00000000..53d9c141
--- /dev/null
+++ b/server/src/lib/inbound-chat.ts
@@ -0,0 +1,517 @@
+import type { Request, Response } from 'express';
+import type {
+ ChatMessage,
+ ChatToolCall,
+ ChatToolChoice,
+ ChatToolDefinition,
+} from '@freellmapi/shared/types.js';
+import { getDb } from '../db/index.js';
+import {
+ routeRequest,
+ routingReserveTokens,
+ resolveModelGroupCandidates,
+ type ChainRow,
+ type RouteResult,
+} from '../services/router.js';
+import {
+ getModelGroups,
+ isUnifyEnabled,
+ resolveRequestedIdToMembers,
+} from '../services/model-groups.js';
+import {
+ newFallbackState,
+ recordUpstreamSuccess,
+ runFallbackLoop,
+ setExhaustionHeaders,
+ setFallbackHeaders,
+ type AttemptRecord,
+ type ExhaustionBody,
+} from './fallback-loop.js';
+import { applyTokenBudget, tokenBudgetMessage } from './guardrails.js';
+import { contentToString } from './content.js';
+import { repairToolArguments, toolSchemaMap } from './tool-args.js';
+import {
+ containsDialectMarker,
+ couldBecomeDialectMarker,
+ rescueInlineToolCalls,
+ startsWithDialectMarker,
+} from './tool-call-rescue.js';
+import { sanitizeProviderErrorMessage } from './error-redaction.js';
+import { newClientAbortError } from './error-classify.js';
+import { logRequest } from './request-log.js';
+import { getStickyModel, setStickyModel } from '../routes/proxy.js';
+import type { CompletionOptions } from '../providers/base.js';
+
+export interface InboundChatRequest {
+ model?: string;
+ messages: ChatMessage[];
+ stream: boolean;
+ maxTokens?: number;
+ temperature?: number;
+ topP?: number;
+ stop?: string | string[];
+ tools?: ChatToolDefinition[];
+ toolChoice?: ChatToolChoice;
+ parallelToolCalls?: boolean;
+ topK?: number;
+ responseFormat?: CompletionOptions['response_format'];
+ reasoningEffort?: CompletionOptions['reasoning_effort'];
+ sessionId?: string;
+ endpoint: string;
+}
+
+export interface InboundChatResult {
+ route: RouteResult;
+ text: string;
+ reasoning: string;
+ toolCalls: ChatToolCall[];
+ finishReason: string | null;
+ promptTokens: number;
+ completionTokens: number;
+}
+
+export interface InboundChatWire {
+ sendError(res: Response, status: number, message: string, code?: string): void;
+ sendNonStream(res: Response, result: InboundChatResult): void;
+ startStream(res: Response, route: RouteResult): void;
+ sendTextDelta(res: Response, route: RouteResult, text: string): void;
+ sendReasoningDelta?(res: Response, route: RouteResult, text: string): void;
+ sendToolCalls?(res: Response, route: RouteResult, calls: ChatToolCall[]): void;
+ finishStream(res: Response, result: InboundChatResult): void;
+ sendStreamError?(res: Response, message: string): void;
+}
+
+function estimateTokens(messages: ChatMessage[]): number {
+ return messages.reduce((sum, message) => {
+ const text = contentToString(message.content);
+ const calls = (message.tool_calls ?? [])
+ .reduce((n, call) => n + call.function.name.length + call.function.arguments.length, 0);
+ return sum + Math.ceil((text.length + calls) / 4);
+ }, 0);
+}
+
+function hasImages(messages: ChatMessage[]): boolean {
+ return messages.some(message =>
+ Array.isArray(message.content)
+ && message.content.some(block =>
+ !!block && typeof block === 'object' && (block as { type?: string }).type === 'image_url'));
+}
+
+interface ResolvedPin {
+ preferredModel?: number;
+ strictChain?: ChainRow[];
+ pinnedLabel: string | null;
+}
+
+function resolvePin(model: string | undefined, messages: ChatMessage[], sessionId?: string): ResolvedPin {
+ const requested = model?.trim();
+ const auto = !requested || requested.toLowerCase() === 'auto' || requested.toLowerCase().startsWith('auto:');
+ if (auto) {
+ return {
+ preferredModel: getStickyModel(messages, sessionId),
+ pinnedLabel: null,
+ };
+ }
+
+ const db = getDb();
+ const members = isUnifyEnabled()
+ ? resolveRequestedIdToMembers(requested, getModelGroups())
+ : null;
+ if (members?.length) {
+ const strictChain = resolveModelGroupCandidates(members);
+ if (strictChain.length === 0) {
+ const err = new Error(`Model '${requested}' has no enabled provider with a usable key`) as Error & { status?: number; code?: string };
+ err.status = 503;
+ err.code = 'no_providers_configured';
+ throw err;
+ }
+ const sticky = getStickyModel(messages, sessionId, requested);
+ return {
+ preferredModel: sticky != null && strictChain.some(row => row.model_db_id === sticky)
+ ? sticky
+ : undefined,
+ strictChain,
+ pinnedLabel: requested,
+ };
+ }
+
+ const enabled = db.prepare(
+ 'SELECT id FROM models WHERE model_id = ? AND enabled = 1',
+ ).get(requested) as { id: number } | undefined;
+ if (!enabled) {
+ const err = new Error(`Model '${requested}' is disabled or is not in the catalog`) as Error & { status?: number; code?: string };
+ err.status = 404;
+ err.code = 'model_not_found';
+ throw err;
+ }
+ return { preferredModel: enabled.id, pinnedLabel: requested };
+}
+
+function sendExhaustion(
+ res: Response,
+ wire: InboundChatWire,
+ exhaustion: ExhaustionBody,
+ attempts: AttemptRecord[],
+): void {
+ setFallbackHeaders(res, attempts.length, attempts);
+ setExhaustionHeaders(res, exhaustion);
+ wire.sendError(res, exhaustion.status, exhaustion.message, exhaustion.code);
+}
+
+/**
+ * Provider-neutral execution for non-OpenAI inbound protocols. The protocol
+ * router owns validation and wire translation; this function owns the same
+ * routing, retry, cooldown, accounting, pinning, and disconnect behavior as
+ * the established OpenAI/Anthropic/Responses surfaces.
+ */
+export async function runInboundChat(
+ req: Request,
+ res: Response,
+ input: InboundChatRequest,
+ wire: InboundChatWire,
+): Promise<void> {
+ const start = Date.now();
+ const estimatedInputTokens = estimateTokens(input.messages);
+ const budget = applyTokenBudget(estimatedInputTokens, input.maxTokens);
+ if (budget.rejection) {
+ wire.sendError(res, 413, tokenBudgetMessage(budget.rejection), 'request_token_budget');
+ return;
+ }
+ const maxTokens = input.maxTokens
+ ?? (budget.maxTokens != null ? Math.min(1024, budget.maxTokens) : 1024);
+
+ let pin: ResolvedPin;
+ try {
+ pin = resolvePin(input.model, input.messages, input.sessionId);
+ } catch (error: any) {
+ wire.sendError(res, error.status ?? 404, error.message, error.code ?? 'model_not_found');
+ return;
+ }
+
+ const state = newFallbackState();
+ const attemptLog: AttemptRecord[] = [];
+ const wantsTools = (input.tools?.length ?? 0) > 0;
+ const imageRequest = hasImages(input.messages);
+ const estimatedTotal = estimatedInputTokens + routingReserveTokens(maxTokens);
+ const schemas = toolSchemaMap(input.tools);
+ let clientGone = false;
+ const clientAbort = new AbortController();
+ res.on('close', () => {
+ if (!res.writableEnded) {
+ clientGone = true;
+ clientAbort.abort(newClientAbortError());
+ }
+ });
+
+ const options: CompletionOptions = {
+ temperature: input.temperature,
+ max_tokens: maxTokens,
+ top_p: input.topP,
+ top_k: input.topK,
+ stop: input.stop,
+ tools: input.tools,
+ tool_choice: input.toolChoice,
+ parallel_tool_calls: input.parallelToolCalls,
+ response_format: input.responseFormat,
+ reasoning_effort: input.reasoningEffort,
+ signal: clientAbort.signal,
+ };
+
+ await runFallbackLoop({
+ state,
+ attemptLog,
+ clientGone: () => clientGone,
+ route: () => routeRequest(
+ estimatedTotal,
+ state.skipKeys.size ? state.skipKeys : undefined,
+ pin.preferredModel,
+ imageRequest,
+ wantsTools,
+ state.skipModels.size ? state.skipModels : undefined,
+ pin.strictChain,
+ input.responseFormat !== undefined,
+ ),
+ dispatch: async (route, attempt) => {
+ if (!input.stream) {
+ const result = await route.provider.chatCompletion(
+ route.apiKey,
+ input.messages,
+ route.modelId,
+ options,
+ );
+ const message = result.choices?.[0]?.message;
+ let text = contentToString(message?.content ?? '');
+ const reasoning = message?.reasoning_content ?? '';
+ let toolCalls = message?.tool_calls ?? [];
+ if (!text && !reasoning && toolCalls.length === 0) {
+ throw Object.assign(
+ new Error(`empty completion from ${route.displayName}`),
+ result.choices?.[0]?.finish_reason === 'length' ? { skipBench: true } : {},
+ );
+ }
+ if (wantsTools && text && toolCalls.length === 0) {
+ const rescue = rescueInlineToolCalls(
+ text,
+ new Set((input.tools ?? []).map(tool => tool.function.name)),
+ );
+ if (rescue.detected && !rescue.calls) {
+ throw new Error(`unparseable inline tool-call dialect from ${route.displayName}`);
+ }
+ if (rescue.detected && rescue.calls) {
+ toolCalls = rescue.calls.map((call, index) => ({
+ id: `call_${Date.now()}_${index}`,
+ type: 'function' as const,
+ function: {
+ name: call.name,
+ arguments: repairToolArguments(
+ call.arguments,
+ schemas.get(call.name),
+ ),
+ },
+ }));
+ text = rescue.cleanText;
+ }
+ }
+ for (const call of toolCalls) {
+ call.function.arguments = repairToolArguments(
+ call.function.arguments,
+ schemas.get(call.function.name),
+ );
+ }
+ const promptTokens = result.usage?.prompt_tokens ?? estimatedInputTokens;
+ const completionTokens = result.usage?.completion_tokens
+ ?? Math.ceil((text.length + reasoning.length + toolCalls.reduce(
+ (n, call) => n + call.function.name.length + call.function.arguments.length,
+ 0,
+ )) / 4);
+ const normalized: InboundChatResult = {
+ route,
+ text,
+ reasoning,
+ toolCalls,
+ finishReason: result.choices?.[0]?.finish_reason ?? null,
+ promptTokens,
+ completionTokens,
+ };
+ recordUpstreamSuccess(route, result.usage?.total_tokens ?? promptTokens + completionTokens);
+ if (pin.pinnedLabel == null) setStickyModel(input.messages, route.modelDbId, input.sessionId);
+ res.setHeader('X-Routed-Via', `${route.platform}/${route.modelId}`);
+ setFallbackHeaders(res, attempt, attemptLog);
+ logRequest(
+ route.platform,
+ route.modelId,
+ route.keyId,
+ 'success',
+ promptTokens,
+ completionTokens,
+ Date.now() - start,
+ null,
+ null,
+ pin.pinnedLabel,
+ );
+ wire.sendNonStream(res, normalized);
+ return 'done';
+ }
+
+ let committed = false;
+ let text = '';
+ let reasoning = '';
+ let finishReason: string | null = null;
+ let outputTokens = 0;
+ const toolAcc = new Map<number, { id?: string; name: string; args: string; thoughtSignature?: string }>();
+ let dialectMode: 'undecided' | 'passthrough' | 'dialect' = 'undecided';
+ let heldText = '';
+ const commit = () => {
+ if (committed) return;
+ res.setHeader('X-Routed-Via', `${route.platform}/${route.modelId}`);
+ setFallbackHeaders(res, attempt, attemptLog);
+ wire.startStream(res, route);
+ committed = true;
+ };
+
+ try {
+ const stream = route.provider.streamChatCompletion(
+ route.apiKey,
+ input.messages,
+ route.modelId,
+ options,
+ );
+ for await (const chunk of stream) {
+ if (clientGone) break;
+ const anyChunk = chunk as Record<string, any>;
+ if (anyChunk.error && !anyChunk.choices) {
+ throw new Error(anyChunk.error.message ?? `in-band provider error from ${route.displayName}`);
+ }
+ const choice = anyChunk.choices?.[0];
+ if (!choice) continue;
+ if (choice.finish_reason) finishReason = choice.finish_reason;
+ const deltaText = typeof choice.delta?.content === 'string' ? choice.delta.content : '';
+ const deltaReasoning = choice.delta?.reasoning_content ?? choice.delta?.reasoning;
+ if (deltaText) {
+ text += deltaText;
+ outputTokens += Math.ceil(deltaText.length / 4);
+ if (!wantsTools || dialectMode === 'passthrough') {
+ commit();
+ wire.sendTextDelta(res, route, deltaText);
+ } else {
+ heldText += deltaText;
+ const probe = heldText.trimStart();
+ if (startsWithDialectMarker(probe)) {
+ dialectMode = 'dialect';
+ } else if (!couldBecomeDialectMarker(probe) || heldText.length > 256) {
+ dialectMode = 'passthrough';
+ commit();
+ wire.sendTextDelta(res, route, heldText);
+ heldText = '';
+ }
+ }
+ }
+ if (typeof deltaReasoning === 'string' && deltaReasoning) {
+ commit();
+ reasoning += deltaReasoning;
+ outputTokens += Math.ceil(deltaReasoning.length / 4);
+ wire.sendReasoningDelta?.(res, route, deltaReasoning);
+ }
+ for (const call of choice.delta?.tool_calls ?? []) {
+ const index = call.index ?? 0;
+ const acc = toolAcc.get(index) ?? { name: '', args: '' };
+ if (call.id && !acc.id) acc.id = call.id;
+ if (call.function?.name) acc.name += call.function.name;
+ if (call.function?.arguments) acc.args += call.function.arguments;
+ const signature = call.thought_signature ?? call.thoughtSignature;
+ if (typeof signature === 'string' && !acc.thoughtSignature) acc.thoughtSignature = signature;
+ toolAcc.set(index, acc);
+ }
+ }
+
+ if (heldText) {
+ const rescue = (dialectMode === 'dialect' || containsDialectMarker(heldText))
+ ? rescueInlineToolCalls(
+ heldText,
+ new Set((input.tools ?? []).map(tool => tool.function.name)),
+ )
+ : { detected: false as const, calls: null, cleanText: heldText };
+ if (rescue.detected && !rescue.calls) {
+ throw new Error(`unparseable inline tool-call dialect from ${route.displayName}`);
+ }
+ if (rescue.detected && rescue.calls) {
+ text = text.slice(0, Math.max(0, text.length - heldText.length)) + rescue.cleanText;
+ if (rescue.cleanText) {
+ commit();
+ wire.sendTextDelta(res, route, rescue.cleanText);
+ }
+ rescue.calls.forEach((call, index) => {
+ toolAcc.set(10_000 + index, {
+ name: call.name,
+ args: call.arguments,
+ });
+ });
+ } else {
+ commit();
+ wire.sendTextDelta(res, route, heldText);
+ }
+ heldText = '';
+ }
+
+ const toolCalls: ChatToolCall[] = [...toolAcc.values()]
+ .filter(call => call.name)
+ .map((call, index) => ({
+ id: call.id || `call_${Date.now()}_${index}`,
+ type: 'function' as const,
+ function: {
+ name: call.name,
+ arguments: repairToolArguments(call.args || '{}', schemas.get(call.name)),
+ },
+ ...(call.thoughtSignature ? { thought_signature: call.thoughtSignature } : {}),
+ }));
+ if (toolCalls.length) {
+ commit();
+ wire.sendToolCalls?.(res, route, toolCalls);
+ outputTokens += Math.ceil(toolCalls.reduce(
+ (n, call) => n + call.function.name.length + call.function.arguments.length,
+ 0,
+ ) / 4);
+ }
+ if (!text && !reasoning && toolCalls.length === 0) {
+ if (clientGone) return 'committed';
+ throw Object.assign(
+ new Error(`empty completion from ${route.displayName}`),
+ finishReason === 'length' ? { skipBench: true } : {},
+ );
+ }
+
+ const normalized: InboundChatResult = {
+ route,
+ text,
+ reasoning,
+ toolCalls,
+ finishReason,
+ promptTokens: estimatedInputTokens,
+ completionTokens: outputTokens,
+ };
+ wire.finishStream(res, normalized);
+ recordUpstreamSuccess(route, estimatedInputTokens + outputTokens);
+ if (pin.pinnedLabel == null) setStickyModel(input.messages, route.modelDbId, input.sessionId);
+ logRequest(
+ route.platform,
+ route.modelId,
+ route.keyId,
+ 'success',
+ estimatedInputTokens,
+ outputTokens,
+ Date.now() - start,
+ null,
+ null,
+ pin.pinnedLabel,
+ );
+ return 'done';
+ } catch (error: any) {
+ if (!committed) throw error;
+ wire.sendStreamError?.(res, sanitizeProviderErrorMessage(error.message));
+ if (!res.writableEnded) res.end();
+ logRequest(
+ route.platform,
+ route.modelId,
+ route.keyId,
+ 'error',
+ estimatedInputTokens,
+ outputTokens,
+ Date.now() - start,
+ sanitizeProviderErrorMessage(error.message),
+ null,
+ pin.pinnedLabel,
+ );
+ return 'committed';
+ }
+ },
+ logFailure: (route, error) => {
+ logRequest(
+ route.platform,
+ route.modelId,
+ route.keyId,
+ 'error',
+ estimatedInputTokens,
+ 0,
+ Date.now() - start,
+ sanitizeProviderErrorMessage(error.message),
+ null,
+ pin.pinnedLabel,
+ );
+ },
+ onFatal: (route, error, attempt) => {
+ setFallbackHeaders(res, attempt, attemptLog);
+ wire.sendError(
+ res,
+ 502,
+ `Provider error (${route.displayName}): ${sanitizeProviderErrorMessage(error.message)}`,
+ 'upstream_error',
+ );
+ },
+ onRoutingExhausted: (_lastError, _routeError, exhaustion, info) => {
+ sendExhaustion(res, wire, exhaustion, info.attempts);
+ },
+ onExhausted: (exhaustion, info) => {
+ sendExhaustion(res, wire, exhaustion, info.attempts);
+ },
+ });
+}
diff --git a/server/src/lib/request-log.ts b/server/src/lib/request-log.ts
index f97c7776..cf8e44d2 100644
--- a/server/src/lib/request-log.ts
+++ b/server/src/lib/request-log.ts
@@ -68,9 +68,9 @@ export function logRequest(
const client = getClientContext();
const tx = db.transaction(() => {
const insert = db.prepare(`
- INSERT INTO requests (platform, model_id, key_id, status, input_tokens, output_tokens, latency_ms, error, ttfb_ms, requested_model, served_model, client_ip, client_user_agent)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
- `).run(platform, modelId, keyId, status, inputTokens, outputTokens, latencyMs, error, ttfbMs, requestedModel, servedModel, client.ip, client.userAgent);
+ INSERT INTO requests (platform, model_id, key_id, status, input_tokens, output_tokens, latency_ms, error, ttfb_ms, requested_model, served_model, client_ip, client_user_agent, client_agent)
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
+ `).run(platform, modelId, keyId, status, inputTokens, outputTokens, latencyMs, error, ttfbMs, requestedModel, servedModel, client.ip, client.userAgent, client.agent);
// Report the row id back to the fallback loop's attempt trace (if one is
// active): the LAST id noted during a loop run is the terminal row the
diff --git a/server/src/providers/google.ts b/server/src/providers/google.ts
index 71fa53c3..7a32ba4e 100644
--- a/server/src/providers/google.ts
+++ b/server/src/providers/google.ts
@@ -12,6 +12,9 @@ import { contentToString } from '../lib/content.js';
import { proxyFetch } from '../lib/proxy.js';
import { recordQuotaObservationsFromResponse, type QuotaObservationContext } from '../services/provider-quota.js';
import { providerTimeoutMs, streamStallTimeoutMs } from '../lib/provider-timeout.js';
+import { sanitizeForGemini } from '../lib/gemini-wire.js';
+
+export { sanitizeForGemini } from '../lib/gemini-wire.js';
const API_BASE = 'https://generativelanguage.googleapis.com/v1beta';
@@ -177,50 +180,6 @@ function toGeminiFinishReason(finishReason?: string): string {
// Google Gemini accepts only a subset of JSON Schema (~OpenAPI 3.0).
// Strip fields that opencode / other strict-JSON-Schema clients send but
// Google rejects with 400 "Unknown name '<field>'".
-const GEMINI_UNSUPPORTED_SCHEMA_KEYS = new Set([
- '$schema', '$id', '$ref', '$defs', '$comment',
- 'definitions',
- 'exclusiveMinimum', 'exclusiveMaximum',
- 'patternProperties', 'unevaluatedProperties', 'unevaluatedItems',
- 'if', 'then', 'else',
- 'contentEncoding', 'contentMediaType', 'contentSchema',
- 'dependentRequired', 'dependentSchemas', 'dependencies',
- 'additionalProperties',
- 'examples', 'const', 'readOnly', 'writeOnly',
- 'uniqueItems',
- 'not', 'allOf', 'oneOf',
- 'prefixItems',
- 'contains', 'minContains', 'maxContains',
- 'propertyNames',
- 'multipleOf',
- 'deprecated',
-]);
-
-const VENDOR_EXTENSION_SCHEMA_KEY = /^x-/i;
-
-export function sanitizeForGemini(schema: unknown): unknown {
- return sanitizeForGeminiSchema(schema, false);
-}
-
-function sanitizeForGeminiSchema(schema: unknown, insidePropertiesMap: boolean): unknown {
- if (Array.isArray(schema)) {
- return schema.map(s => sanitizeForGeminiSchema(s, false));
- }
- if (schema && typeof schema === 'object') {
- const out: Record<string, unknown> = {};
- for (const [k, v] of Object.entries(schema as Record<string, unknown>)) {
- if (insidePropertiesMap) {
- out[k] = sanitizeForGeminiSchema(v, false);
- continue;
- }
- if (GEMINI_UNSUPPORTED_SCHEMA_KEYS.has(k) || VENDOR_EXTENSION_SCHEMA_KEY.test(k)) continue;
- out[k] = sanitizeForGeminiSchema(v, k === 'properties');
- }
- return out;
- }
- return schema;
-}
-
// OpenAI clients can't express Gemini's native Google Search grounding, so we
// treat a tool named `google_search` (a few spellings) as the signal to enable
// it. It maps to Gemini's `{ google_search: {} }` tool rather than a function
diff --git a/server/src/routes/analytics.ts b/server/src/routes/analytics.ts
index 520c1001..61fa5de8 100644
--- a/server/src/routes/analytics.ts
+++ b/server/src/routes/analytics.ts
@@ -293,6 +293,35 @@ analyticsRouter.get('/by-platform', (req: Request, res: Response) => {
}));
});
+analyticsRouter.get('/by-client', (req: Request, res: Response) => {
+ const range = (req.query.range as string) ?? '7d';
+ const since = getSinceTimestamp(range);
+ const rows = getDb().prepare(`
+ SELECT
+ COALESCE(client_agent, 'unknown') AS client_agent,
+ COUNT(*) AS requests,
+ SUM(CASE WHEN status = 'success' THEN 1 ELSE 0 END) * 100.0 / COUNT(*) AS success_rate,
+ AVG(latency_ms) AS avg_latency_ms,
+ SUM(input_tokens) AS total_input_tokens,
+ SUM(output_tokens) AS total_output_tokens,
+ MAX(strftime('%Y-%m-%dT%H:%M:%SZ', created_at)) AS last_seen_at
+ FROM requests
+ WHERE created_at >= ?
+ GROUP BY client_agent
+ ORDER BY requests DESC
+ `).all(since) as any[];
+
+ res.json(rows.map(row => ({
+ clientAgent: row.client_agent,
+ requests: row.requests,
+ successRate: Math.round((row.success_rate ?? 0) * 10) / 10,
+ avgLatencyMs: Math.round(row.avg_latency_ms ?? 0),
+ totalInputTokens: row.total_input_tokens ?? 0,
+ totalOutputTokens: row.total_output_tokens ?? 0,
+ lastSeenAt: row.last_seen_at,
+ })));
+});
+
// Stats grouped by API key. Raw-row scoped (the hourly aggregate has no key
// dimension), LEFT JOINed to api_keys so a request whose key was later deleted
// still shows up with a null label — the keyId is always returned.
@@ -499,7 +528,7 @@ analyticsRouter.get('/requests', (req: Request, res: Response) => {
const rows = db.prepare(`
SELECT id, platform, model_id, requested_model, request_type, status,
input_tokens, output_tokens, latency_ms, error,
- client_ip, client_user_agent,
+ client_ip, client_user_agent, client_agent,
strftime('%Y-%m-%dT%H:%M:%SZ', created_at) as created_at_iso,
(SELECT COUNT(*) FROM request_attempts a WHERE a.request_id = requests.id) as attempt_count
FROM requests
@@ -523,6 +552,7 @@ analyticsRouter.get('/requests', (req: Request, res: Response) => {
error: r.error,
clientIp: r.client_ip,
clientUserAgent: r.client_user_agent,
+ clientAgent: r.client_agent,
createdAt: r.created_at_iso,
// Failover-ladder length for this row. Attempts hang off the TERMINAL
// row of a proxied request; mid-ladder failure rows report 0.
@@ -549,7 +579,7 @@ analyticsRouter.get('/requests/:id', (req: Request, res: Response) => {
const r = db.prepare(`
SELECT id, platform, model_id, requested_model, served_model, request_type, status,
input_tokens, output_tokens, latency_ms, ttfb_ms, error,
- client_ip, client_user_agent,
+ client_ip, client_user_agent, client_agent,
strftime('%Y-%m-%dT%H:%M:%SZ', created_at) as created_at_iso
FROM requests
WHERE id = ?
@@ -583,6 +613,7 @@ analyticsRouter.get('/requests/:id', (req: Request, res: Response) => {
error: r.error,
clientIp: r.client_ip,
clientUserAgent: r.client_user_agent,
+ clientAgent: r.client_agent,
createdAt: r.created_at_iso,
attempts: attempts.map(a => ({
ordinal: a.ordinal,
diff --git a/server/src/routes/anthropic.ts b/server/src/routes/anthropic.ts
index 41588aa1..a81abc18 100644
--- a/server/src/routes/anthropic.ts
+++ b/server/src/routes/anthropic.ts
@@ -10,7 +10,7 @@ import type {
ChatContentBlock,
} from '@freellmapi/shared/types.js';
import { routeRequest, routingReserveTokens, type RouteResult } from '../services/router.js';
-import { getUnifiedApiKey } from '../db/index.js';
+import { getSetting, getUnifiedApiKey } from '../db/index.js';
import { contentToString } from '../lib/content.js';
import { repairToolArguments, toolSchemaMap } from '../lib/tool-args.js';
import { rescueInlineToolCalls, startsWithDialectMarker, couldBecomeDialectMarker, containsDialectMarker } from '../lib/tool-call-rescue.js';
@@ -426,6 +426,9 @@ anthropicRouter.post('/messages', async (req: Request, res: Response) => {
const body = parsed.data;
const requestedModel = body.model ?? 'auto';
+ const routedModel = body.model?.startsWith('claude/')
+ ? body.model.slice('claude/'.length)
+ : body.model;
// The Anthropic wire format requires max_tokens, but OUR default injection
// must not change the budget gate's verdict: gating AFTER defaulting made a
// no-max_tokens request 413 here (input + 1024 over budget) where the chat
@@ -481,7 +484,7 @@ anthropicRouter.post('/messages', async (req: Request, res: Response) => {
// Resolve the model through the operator's Claude-family map (opus/sonnet/
// haiku/default → auto | a pinned catalog model). A concrete catalog id pins
// directly. `pinned` drives the analytics requested-model label.
- const resolved = resolveAnthropicModel(body.model);
+ const resolved = resolveAnthropicModel(routedModel);
const pinnedModelId = resolved.pinned ? (body.model ?? null) : null;
// Session affinity: Claude Code stamps every request in a session with
@@ -930,21 +933,26 @@ anthropicRouter.post('/messages/count_tokens', (req: Request, res: Response) =>
// endpoint (real free models that can serve a request right now, plus "auto") —
// no fake Claude cloud models.
//
-// Heads-up: Claude Code's gateway model picker (enabled via
-// CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1) only surfaces ids beginning
-// with `claude`/`anthropic`, so our ids won't populate its picker by design.
-// Routing still works because Claude Code keeps its built-in `claude-*` names,
-// which the model map sends to "auto" (or a pinned model).
+// Optional `claude/<real-id>` aliases let Claude Code's gateway picker discover
+// the full catalog; /messages strips the synthetic prefix before routing.
anthropicRouter.get('/models', (req: Request, res: Response, next: NextFunction) => {
if (!req.headers['anthropic-version']) return next(); // OpenAI client → proxyRouter
if (!authenticate(req, res)) return;
const { models } = buildModelListing();
+ const available = models.filter(m => m.available === 1);
+ const aliasesEnabled = getSetting('expose_cc_discovery_aliases') === '1';
const data = [
{ type: 'model' as const, id: 'auto', display_name: 'Auto (router picks the best available model)', created_at: MODEL_CREATED_AT },
- ...models
- .filter(m => m.available === 1)
- .map(m => ({ type: 'model' as const, id: m.id, display_name: m.name, created_at: MODEL_CREATED_AT })),
+ ...available.map(m => ({ type: 'model' as const, id: m.id, display_name: m.name, created_at: MODEL_CREATED_AT })),
+ ...(aliasesEnabled
+ ? available.map(m => ({
+ type: 'model' as const,
+ id: `claude/${m.id}`,
+ display_name: `${m.name} (Claude Code)`,
+ created_at: MODEL_CREATED_AT,
+ }))
+ : []),
];
res.json({ data, has_more: false, first_id: data[0]?.id ?? null, last_id: data[data.length - 1]?.id ?? null });
});
diff --git a/server/src/routes/gemini.ts b/server/src/routes/gemini.ts
new file mode 100644
index 00000000..2c26a269
--- /dev/null
+++ b/server/src/routes/gemini.ts
@@ -0,0 +1,233 @@
+import { Router } from 'express';
+import type { Request, Response } from 'express';
+import { z } from 'zod';
+import { getUnifiedApiKey } from '../db/index.js';
+import { buildModelListing, type NormalizedModel } from '../services/model-listing.js';
+import { extractApiToken, timingSafeStringEqual } from './proxy.js';
+import { runInboundChat, type InboundChatWire } from '../lib/inbound-chat.js';
+import {
+ effortFromGeminiThinking,
+ estimateGeminiTokens,
+ geminiContentsToMessages,
+ geminiFinishReason,
+ geminiPartsFromResult,
+ geminiResponseFormat,
+ geminiResponseFromResult,
+ geminiToolChoice,
+ geminiToolsToChatTools,
+ type GeminiInboundRequest,
+} from '../lib/gemini-wire.js';
+import { resolveGeminiModel } from '../services/gemini-map.js';
+
+export const geminiRouter = Router();
+
+const partSchema = z.object({}).passthrough();
+const contentSchema = z.object({
+ role: z.enum(['user', 'model']).optional(),
+ parts: z.array(partSchema).optional(),
+}).passthrough();
+const generateSchema = z.object({
+ contents: z.array(contentSchema).min(1),
+ systemInstruction: z.object({ parts: z.array(partSchema).optional() }).passthrough().optional(),
+ tools: z.array(z.object({}).passthrough()).optional(),
+ toolConfig: z.object({}).passthrough().optional(),
+ generationConfig: z.object({}).passthrough().optional(),
+}).passthrough();
+
+function sendError(res: Response, status: number, message: string, code = 'INVALID_ARGUMENT'): void {
+ res.status(status).json({
+ error: {
+ code: status,
+ message,
+ status: code.toUpperCase(),
+ },
+ });
+}
+
+function authenticate(req: Request, res: Response): boolean {
+ const queryKey = typeof req.query.key === 'string' ? req.query.key.trim() : '';
+ if (queryKey) {
+ // Query credentials are a Gemini compatibility escape hatch and are
+ // intentionally scoped to this router. Warn because URLs commonly land in
+ // shell history, reverse-proxy logs, and referrer telemetry.
+ console.warn('[Gemini] API key supplied in ?key=; prefer x-goog-api-key to avoid URL leakage');
+ }
+ const token = extractApiToken(req) ?? queryKey;
+ if (!token || !timingSafeStringEqual(token, getUnifiedApiKey())) {
+ sendError(res, 401, 'Invalid API key', 'UNAUTHENTICATED');
+ return false;
+ }
+ return true;
+}
+
+function modelShape(model: NormalizedModel | null, autoContextWindow: number | null, id = 'auto') {
+ const context = model?.contextWindow ?? autoContextWindow ?? 128_000;
+ return {
+ name: `models/${model?.id ?? id}`,
+ displayName: model?.name ?? 'Auto (router picks the best available model)',
+ description: model
+ ? `FreeLLMAPI catalog model served by ${model.ownedBy}`
+ : 'FreeLLMAPI automatically selects the best available model',
+ inputTokenLimit: context,
+ // The current catalog does not yet carry a separate output ceiling. Keep a
+ // conservative interoperable value instead of inventing per-model limits.
+ outputTokenLimit: Math.min(8192, context),
+ supportedGenerationMethods: ['generateContent', 'streamGenerateContent', 'countTokens'],
+ version: model?.id ?? id,
+ };
+}
+
+geminiRouter.get('/models', (req, res) => {
+ if (!authenticate(req, res)) return;
+ const { models, autoContextWindow } = buildModelListing();
+ const availableOnly = String(req.query.available ?? '').toLowerCase();
+ const listed = ['1', 'true', 'yes'].includes(availableOnly)
+ ? models.filter(model => model.available === 1)
+ : models;
+ res.json({
+ models: [
+ modelShape(null, autoContextWindow),
+ ...listed.map(model => modelShape(model, autoContextWindow)),
+ ],
+ });
+});
+
+geminiRouter.get(/^\/models\/(.+)$/, (req, res) => {
+ if (!authenticate(req, res)) return;
+ const requested = decodeURIComponent(req.params[0]).replace(/^models\//, '');
+ const { models, autoContextWindow } = buildModelListing();
+ if (requested === 'auto') {
+ res.json(modelShape(null, autoContextWindow));
+ return;
+ }
+ const model = models.find(entry => entry.id === requested);
+ if (!model) {
+ sendError(res, 404, `Model '${requested}' was not found`, 'NOT_FOUND');
+ return;
+ }
+ res.json(modelShape(model, autoContextWindow));
+});
+
+function parseGenerateBody(req: Request, res: Response): GeminiInboundRequest | null {
+ const parsed = generateSchema.safeParse(req.body);
+ if (!parsed.success) {
+ const detail = parsed.error.errors
+ .slice(0, 5)
+ .map(error => `${error.path.join('.') || 'body'}: ${error.message}`)
+ .join(', ');
+ sendError(res, 400, `Invalid Gemini request: ${detail}`);
+ return null;
+ }
+ return parsed.data as GeminiInboundRequest;
+}
+
+function actionModel(req: Request, suffix: string): string {
+ const encoded = req.path.slice('/models/'.length, -suffix.length);
+ return decodeURIComponent(encoded).replace(/^models\//, '');
+}
+
+function streamWire(altSse: boolean): InboundChatWire {
+ let firstJsonChunk = true;
+ const write = (res: Response, payload: Record<string, unknown>) => {
+ const serialized = JSON.stringify(payload);
+ if (altSse) {
+ res.write(`data: ${serialized}\n\n`);
+ } else {
+ res.write(`${firstJsonChunk ? '' : ','}\n${serialized}`);
+ firstJsonChunk = false;
+ }
+ };
+ return {
+ sendError,
+ sendNonStream: (res, result) => res.json(geminiResponseFromResult(result)),
+ startStream: (res) => {
+ res.setHeader('Content-Type', altSse ? 'text/event-stream' : 'application/json');
+ res.setHeader('Cache-Control', 'no-cache');
+ if (!altSse) res.write('[');
+ },
+ sendTextDelta: (res, _route, text) => write(res, {
+ candidates: [{ content: { role: 'model', parts: [{ text }] }, index: 0 }],
+ }),
+ sendReasoningDelta: (res, _route, text) => write(res, {
+ candidates: [{ content: { role: 'model', parts: [{ text, thought: true }] }, index: 0 }],
+ }),
+ sendToolCalls: (res, _route, calls) => write(res, {
+ candidates: [{
+ content: {
+ role: 'model',
+ parts: geminiPartsFromResult({ text: '', reasoning: '', toolCalls: calls }),
+ },
+ index: 0,
+ }],
+ }),
+ finishStream: (res, result) => {
+ write(res, {
+ candidates: [{
+ content: { role: 'model', parts: [] },
+ finishReason: geminiFinishReason(result.finishReason, result.toolCalls.length > 0),
+ index: 0,
+ }],
+ usageMetadata: {
+ promptTokenCount: result.promptTokens,
+ candidatesTokenCount: result.completionTokens,
+ totalTokenCount: result.promptTokens + result.completionTokens,
+ },
+ modelVersion: result.route.modelId,
+ });
+ if (!altSse) res.write('\n]');
+ res.end();
+ },
+ sendStreamError: (res, message) => {
+ write(res, { error: { code: 502, message, status: 'UNAVAILABLE' } });
+ if (!altSse) res.write('\n]');
+ },
+ };
+}
+
+async function handleGenerate(req: Request, res: Response, stream: boolean): Promise<void> {
+ if (!authenticate(req, res)) return;
+ const body = parseGenerateBody(req, res);
+ if (!body) return;
+ const generation = body.generationConfig;
+ const model = actionModel(
+ req,
+ stream ? ':streamGenerateContent' : ':generateContent',
+ );
+ const rawSession = req.headers['x-goog-request-id'] ?? req.headers['x-session-id'];
+ const sessionId = Array.isArray(rawSession) ? rawSession[0] : rawSession;
+ const tools = geminiToolsToChatTools(body.tools);
+ await runInboundChat(req, res, {
+ model: resolveGeminiModel(model),
+ messages: geminiContentsToMessages(body),
+ stream,
+ // Gemini CLI never sends maxOutputTokens; the shared 1024-token default
+ // would truncate every response, so match Gemini's own model default.
+ maxTokens: generation?.maxOutputTokens ?? 8192,
+ temperature: generation?.temperature,
+ topP: generation?.topP,
+ topK: generation?.topK,
+ stop: generation?.stopSequences,
+ tools,
+ // tool_choice without tools 400s on strict OpenAI-compatible upstreams.
+ toolChoice: tools ? geminiToolChoice(body.toolConfig) : undefined,
+ responseFormat: geminiResponseFormat(generation),
+ reasoningEffort: effortFromGeminiThinking(generation),
+ sessionId,
+ endpoint: stream ? 'gemini/streamGenerateContent' : 'gemini/generateContent',
+ }, streamWire(String(req.query.alt ?? '').toLowerCase() === 'sse'));
+}
+
+geminiRouter.post(/^\/models\/(.+):generateContent$/, (req, res) => {
+ void handleGenerate(req, res, false);
+});
+
+geminiRouter.post(/^\/models\/(.+):streamGenerateContent$/, (req, res) => {
+ void handleGenerate(req, res, true);
+});
+
+geminiRouter.post(/^\/models\/(.+):countTokens$/, (req, res) => {
+ if (!authenticate(req, res)) return;
+ const body = parseGenerateBody(req, res);
+ if (!body) return;
+ res.json({ totalTokens: estimateGeminiTokens(body) });
+});
diff --git a/server/src/routes/ollama.ts b/server/src/routes/ollama.ts
new file mode 100644
index 00000000..38fdf7b5
--- /dev/null
+++ b/server/src/routes/ollama.ts
@@ -0,0 +1,607 @@
+import { Router } from 'express';
+import type { NextFunction, Request, Response } from 'express';
+import { z } from 'zod';
+import type {
+ ChatMessage,
+ ChatToolDefinition,
+} from '@freellmapi/shared/types.js';
+import { getSetting, getUnifiedApiKey } from '../db/index.js';
+import { buildModelListing } from '../services/model-listing.js';
+import { extractApiToken, timingSafeStringEqual } from './proxy.js';
+import { runInboundChat, type InboundChatResult, type InboundChatWire } from '../lib/inbound-chat.js';
+import { runEmbeddings, EmbeddingsError } from '../services/embeddings.js';
+import { validateSession } from '../services/auth.js';
+
+export const ollamaRouter = Router();
+
+export type OllamaEmulationMode = 'off' | 'open-loopback' | 'key-required';
+
+export function getOllamaEmulationMode(): OllamaEmulationMode {
+ const stored = getSetting('ollama_emulation');
+ return stored === 'open-loopback' || stored === 'key-required' ? stored : 'off';
+}
+
+export function isLoopback(req: Request): boolean {
+ const isLoopbackAddress = (value: string | undefined) => {
+ const address = value?.trim().replace(/^::ffff:/i, '');
+ return address === '127.0.0.1' || address === '::1';
+ };
+ if (!isLoopbackAddress(req.socket.remoteAddress)) return false;
+ const forwarded = req.headers['x-forwarded-for'];
+ const firstForwarded = (Array.isArray(forwarded) ? forwarded[0] : forwarded)
+ ?.split(',')[0];
+ // A local reverse proxy is itself a loopback socket, but its first forwarded
+ // hop may be remote. Refuse that request instead of silently widening
+ // open-loopback mode through the proxy.
+ return !firstForwarded || isLoopbackAddress(firstForwarded);
+}
+
+function authorize(req: Request, res: Response): boolean {
+ if ((req as Request & { urlTokenAuthenticated?: boolean }).urlTokenAuthenticated) {
+ return true;
+ }
+ const mode = getOllamaEmulationMode();
+ if (mode === 'off') {
+ res.status(404).json({ error: 'Ollama emulation is disabled' });
+ return false;
+ }
+ if (mode === 'open-loopback') {
+ if (isLoopback(req)) return true;
+ res.status(403).json({
+ error: 'Ollama open-loopback mode only accepts connections from this machine',
+ });
+ return false;
+ }
+ const token = extractApiToken(req);
+ if (!token || !timingSafeStringEqual(token, getUnifiedApiKey())) {
+ res.status(401).json({ error: 'Invalid API key' });
+ return false;
+ }
+ return true;
+}
+
+// Ollama clients routinely configure `name:latest`; catalog ids carry no tag.
+export function normalizeOllamaModel(name: string | undefined): string {
+ const trimmed = name?.trim().replace(/:latest$/i, '');
+ return trimmed || 'auto';
+}
+
+// Real Ollama only emits stop/length/load/unload; clients switch on it before
+// reading tool_calls, so upstream finish reasons like "tool_calls" map to stop.
+function ollamaDoneReason(finishReason: string | null | undefined): string {
+ return finishReason === 'length' ? 'length' : 'stop';
+}
+
+// Epoch-0 renders as "55 years ago" in Ollama UIs; boot time is honest enough.
+const CATALOG_MODIFIED_AT = new Date().toISOString();
+
+function ollamaModel(model: ReturnType<typeof buildModelListing>['models'][number]) {
+ return {
+ name: model.id,
+ model: model.id,
+ modified_at: CATALOG_MODIFIED_AT,
+ size: 0,
+ digest: '',
+ details: {
+ parent_model: '',
+ format: 'freellmapi',
+ family: model.ownedBy,
+ families: [model.ownedBy],
+ parameter_size: 'remote',
+ quantization_level: 'remote',
+ },
+ };
+}
+
+ollamaRouter.get('/api/tags', (req, res) => {
+ if (!authorize(req, res)) return;
+ const { models } = buildModelListing();
+ // Ollama clients always pick an explicit model from this list, so advertise
+ // `auto` and only models /api/chat will actually accept (see proxy.ts /v1/models).
+ const auto = {
+ name: 'auto',
+ model: 'auto',
+ modified_at: CATALOG_MODIFIED_AT,
+ size: 0,
+ digest: '',
+ details: {
+ parent_model: '',
+ format: 'freellmapi',
+ family: 'freellmapi',
+ families: ['freellmapi'],
+ parameter_size: 'remote',
+ quantization_level: 'remote',
+ },
+ };
+ res.json({ models: [auto, ...models.filter(model => model.available === 1).map(ollamaModel)] });
+});
+
+ollamaRouter.get('/api/version', (req, res) => {
+ if (!authorize(req, res)) return;
+ // Plain semver: a prerelease suffix would compare BELOW 0.9.9 for clients
+ // that gate features on a minimum Ollama version.
+ res.json({ version: '0.9.9' });
+});
+
+const showSchema = z.object({ model: z.string().optional(), name: z.string().optional() }).passthrough();
+ollamaRouter.post('/api/show', (req, res) => {
+ if (!authorize(req, res)) return;
+ const parsed = showSchema.safeParse(req.body);
+ if (!parsed.success || !(parsed.data.model || parsed.data.name)) {
+ res.status(400).json({ error: 'model is required' });
+ return;
+ }
+ const id = normalizeOllamaModel(parsed.data.model || parsed.data.name);
+ const { models, autoContextWindow } = buildModelListing();
+ if (id === 'auto') {
+ // /api/tags advertises `auto`, and clients probe /api/show for
+ // capabilities before using a model.
+ res.json({
+ license: '',
+ modified_at: CATALOG_MODIFIED_AT,
+ modelfile: 'FROM auto',
+ parameters: `num_ctx ${autoContextWindow ?? 128000}`,
+ template: '{{ .Prompt }}',
+ details: {
+ parent_model: '',
+ format: 'freellmapi',
+ family: 'freellmapi',
+ families: ['freellmapi'],
+ parameter_size: 'remote',
+ quantization_level: 'remote',
+ },
+ model_info: {
+ 'general.architecture': 'freellmapi',
+ 'general.context_length': autoContextWindow ?? 128000,
+ },
+ capabilities: ['completion', 'tools'],
+ });
+ return;
+ }
+ const model = models.find(entry => entry.id === id);
+ if (!model) {
+ res.status(404).json({ error: `model '${id}' not found` });
+ return;
+ }
+ res.json({
+ license: '',
+ modified_at: CATALOG_MODIFIED_AT,
+ modelfile: `FROM ${model.id}`,
+ parameters: `num_ctx ${model.contextWindow ?? 128000}`,
+ template: '{{ .Prompt }}',
+ details: ollamaModel(model).details,
+ model_info: {
+ 'general.architecture': model.ownedBy,
+ 'general.context_length': model.contextWindow ?? 128000,
+ },
+ capabilities: model.supportsTools
+ ? ['completion', 'tools']
+ : ['completion'],
+ });
+});
+
+const messageSchema = z.object({
+ role: z.enum(['system', 'user', 'assistant', 'tool']),
+ content: z.union([z.string(), z.array(z.object({}).passthrough())]).optional(),
+ tool_name: z.string().optional(),
+ tool_calls: z.array(z.object({}).passthrough()).optional(),
+}).passthrough();
+
+const chatSchema = z.object({
+ model: z.string().optional(),
+ // Empty messages is a documented Ollama load/unload probe, not an error.
+ messages: z.array(messageSchema).default([]),
+ stream: z.boolean().optional(),
+ tools: z.array(z.object({}).passthrough()).optional(),
+ options: z.object({}).passthrough().optional(),
+ format: z.union([z.literal('json'), z.record(z.string(), z.unknown())]).optional(),
+}).passthrough();
+
+function ollamaMessages(raw: z.infer<typeof messageSchema>[]): ChatMessage[] {
+ const pendingCalls = new Map<string, string[]>();
+ const converted: ChatMessage[] = [];
+ raw.forEach((message, messageIndex) => {
+ const toolCalls = message.tool_calls
+ ?.filter((call: any) => call?.function?.name)
+ .map((call: any, callIndex) => {
+ const id = call.id || `call_${messageIndex}_${callIndex}`;
+ const name = call.function.name as string;
+ const queue = pendingCalls.get(name) ?? [];
+ queue.push(id);
+ pendingCalls.set(name, queue);
+ return {
+ id,
+ type: 'function' as const,
+ function: {
+ name,
+ arguments: typeof call.function.arguments === 'string'
+ ? call.function.arguments
+ : JSON.stringify(call.function.arguments ?? {}),
+ },
+ };
+ });
+ let toolCallId: string | undefined;
+ if (message.role === 'tool') {
+ toolCallId = (message as any).tool_call_id;
+ if (!toolCallId && message.tool_name) {
+ toolCallId = pendingCalls.get(message.tool_name)?.shift();
+ }
+ if (!toolCallId) {
+ const firstPending = [...pendingCalls.values()].find(queue => queue.length);
+ toolCallId = firstPending?.shift() ?? `call_${messageIndex}`;
+ }
+ }
+ // Ollama vision requests carry base64 images alongside text; convert them
+ // to content blocks so vision-capable routing (hasImages) sees them.
+ const images = (message as { images?: unknown }).images;
+ const imageBlocks = Array.isArray(images)
+ ? images
+ .filter((image): image is string => typeof image === 'string' && image.length > 0)
+ .map(image => ({
+ type: 'image_url' as const,
+ image_url: { url: image.startsWith('data:') ? image : `data:image/png;base64,${image}` },
+ }))
+ : [];
+ const textContent = typeof message.content === 'string' ? message.content : '';
+ converted.push({
+ role: message.role,
+ content: imageBlocks.length
+ ? [{ type: 'text', text: textContent }, ...imageBlocks]
+ : message.content ?? '',
+ ...(message.tool_name ? { name: message.tool_name } : {}),
+ ...(toolCallId ? { tool_call_id: toolCallId } : {}),
+ ...(toolCalls?.length ? { tool_calls: toolCalls } : {}),
+ } as ChatMessage);
+ });
+ return converted;
+}
+
+function ollamaTools(raw: unknown[] | undefined): ChatToolDefinition[] | undefined {
+ if (!raw?.length) return undefined;
+ const tools = raw
+ .filter((tool: any) => tool?.function?.name)
+ .map((tool: any) => ({
+ type: 'function' as const,
+ function: {
+ name: tool.function.name,
+ description: tool.function.description,
+ parameters: tool.function.parameters ?? { type: 'object', properties: {} },
+ },
+ }));
+ return tools.length ? tools : undefined;
+}
+
+function ollamaToolCalls(result: Pick<InboundChatResult, 'toolCalls'>) {
+ return result.toolCalls.map(call => {
+ let args: unknown = {};
+ try {
+ args = JSON.parse(call.function.arguments);
+ } catch {
+ args = { value: call.function.arguments };
+ }
+ return {
+ function: {
+ name: call.function.name,
+ arguments: args,
+ },
+ };
+ });
+}
+
+// Rough nanosecond timings measured at the gateway: clients compute
+// tokens/sec as eval_count / eval_duration and choke on zero/undefined.
+function ollamaDurations(startedMs: number, promptTokens: number, completionTokens: number) {
+ const totalNs = Math.max(1, Math.round((performance.now() - startedMs) * 1e6));
+ const promptShare = promptTokens + completionTokens > 0
+ ? promptTokens / (promptTokens + completionTokens)
+ : 0.5;
+ const promptNs = Math.max(1, Math.round(totalNs * promptShare * 0.2));
+ return {
+ total_duration: totalNs,
+ load_duration: 0,
+ prompt_eval_duration: promptNs,
+ eval_duration: Math.max(1, totalNs - promptNs),
+ };
+}
+
+function ollamaWire(model: string): InboundChatWire {
+ const createdAt = () => new Date().toISOString();
+ const startedMs = performance.now();
+ return {
+ sendError: (res, status, message) => res.status(status).json({ error: message }),
+ sendNonStream: (res, result) => {
+ res.json({
+ model,
+ created_at: createdAt(),
+ message: {
+ role: 'assistant',
+ content: result.text,
+ ...(result.reasoning ? { thinking: result.reasoning } : {}),
+ ...(result.toolCalls.length ? { tool_calls: ollamaToolCalls(result) } : {}),
+ },
+ done: true,
+ done_reason: ollamaDoneReason(result.finishReason),
+ ...ollamaDurations(startedMs, result.promptTokens, result.completionTokens),
+ prompt_eval_count: result.promptTokens,
+ eval_count: result.completionTokens,
+ });
+ },
+ startStream: (res) => {
+ res.setHeader('Content-Type', 'application/x-ndjson');
+ res.setHeader('Cache-Control', 'no-cache');
+ },
+ sendTextDelta: (res, _route, text) => {
+ res.write(`${JSON.stringify({
+ model,
+ created_at: createdAt(),
+ message: { role: 'assistant', content: text },
+ done: false,
+ })}\n`);
+ },
+ sendReasoningDelta: (res, _route, thinking) => {
+ res.write(`${JSON.stringify({
+ model,
+ created_at: createdAt(),
+ message: { role: 'assistant', content: '', thinking },
+ done: false,
+ })}\n`);
+ },
+ sendToolCalls: (res, _route, calls) => {
+ res.write(`${JSON.stringify({
+ model,
+ created_at: createdAt(),
+ message: {
+ role: 'assistant',
+ content: '',
+ tool_calls: ollamaToolCalls({ toolCalls: calls }),
+ },
+ done: false,
+ })}\n`);
+ },
+ finishStream: (res, result) => {
+ res.write(`${JSON.stringify({
+ model,
+ created_at: createdAt(),
+ message: { role: 'assistant', content: '' },
+ done: true,
+ done_reason: ollamaDoneReason(result.finishReason),
+ ...ollamaDurations(startedMs, result.promptTokens, result.completionTokens),
+ prompt_eval_count: result.promptTokens,
+ eval_count: result.completionTokens,
+ })}\n`);
+ res.end();
+ },
+ sendStreamError: (res, message) => {
+ res.write(`${JSON.stringify({ error: message, done: true })}\n`);
+ },
+ };
+}
+
+ollamaRouter.post('/api/chat', (req, res) => {
+ if (!authorize(req, res)) return;
+ const parsed = chatSchema.safeParse(req.body);
+ if (!parsed.success) {
+ res.status(400).json({ error: `invalid request: ${parsed.error.message}` });
+ return;
+ }
+ const body = parsed.data;
+ const model = normalizeOllamaModel(body.model);
+ if (body.messages.length === 0) {
+ // Model load/unload probe: real Ollama answers immediately without
+ // generating. Never burn upstream quota on it.
+ const unload = (body as { keep_alive?: unknown }).keep_alive === 0;
+ res.json({
+ model,
+ created_at: new Date().toISOString(),
+ message: { role: 'assistant', content: '' },
+ done: true,
+ done_reason: unload ? 'unload' : 'load',
+ });
+ return;
+ }
+ const options = body.options as Record<string, unknown> | undefined;
+ const rawSession = req.headers['x-ollama-session-id'] ?? req.headers['x-session-id'];
+ const sessionId = Array.isArray(rawSession) ? rawSession[0] : rawSession;
+ void runInboundChat(req, res, {
+ model,
+ messages: ollamaMessages(body.messages),
+ stream: body.stream !== false,
+ maxTokens: typeof options?.num_predict === 'number' ? options.num_predict : undefined,
+ temperature: typeof options?.temperature === 'number' ? options.temperature : undefined,
+ topP: typeof options?.top_p === 'number' ? options.top_p : undefined,
+ topK: typeof options?.top_k === 'number' ? options.top_k : undefined,
+ stop: Array.isArray(options?.stop)
+ ? options.stop.filter((value): value is string => typeof value === 'string')
+ : undefined,
+ tools: ollamaTools(body.tools),
+ responseFormat: body.format
+ ? (body.format === 'json'
+ ? { type: 'json_object' }
+ : { type: 'json_schema', json_schema: { name: 'ollama_response', schema: body.format } })
+ : undefined,
+ sessionId,
+ endpoint: 'ollama/chat',
+ }, ollamaWire(model));
+});
+
+const generateSchema = z.object({
+ model: z.string().optional(),
+ prompt: z.string().default(''),
+ system: z.string().optional(),
+ suffix: z.string().optional(),
+ stream: z.boolean().optional(),
+ options: z.object({}).passthrough().optional(),
+ format: z.union([z.literal('json'), z.record(z.string(), z.unknown())]).optional(),
+}).passthrough();
+
+function generateWire(model: string): InboundChatWire {
+ const wire = ollamaWire(model);
+ const startedMs = performance.now();
+ return {
+ ...wire,
+ sendNonStream: (res, result) => {
+ res.json({
+ model,
+ created_at: new Date().toISOString(),
+ response: result.text,
+ thinking: result.reasoning || undefined,
+ done: true,
+ done_reason: ollamaDoneReason(result.finishReason),
+ // The gateway cannot produce real Ollama context tokens (an opaque
+ // tokenizer artifact); an empty array keeps strict clients parsing.
+ context: [],
+ ...ollamaDurations(startedMs, result.promptTokens, result.completionTokens),
+ prompt_eval_count: result.promptTokens,
+ eval_count: result.completionTokens,
+ });
+ },
+ sendTextDelta: (res, _route, text) => {
+ res.write(`${JSON.stringify({
+ model,
+ created_at: new Date().toISOString(),
+ response: text,
+ done: false,
+ })}\n`);
+ },
+ sendReasoningDelta: (res, _route, thinking) => {
+ res.write(`${JSON.stringify({
+ model,
+ created_at: new Date().toISOString(),
+ response: '',
+ thinking,
+ done: false,
+ })}\n`);
+ },
+ // The inherited finisher emits a chat-shaped `message` frame; generate
+ // consumers append `chunk.response` from every frame and strict parsers
+ // reject the terminal frame without it.
+ finishStream: (res, result) => {
+ res.write(`${JSON.stringify({
+ model,
+ created_at: new Date().toISOString(),
+ response: '',
+ done: true,
+ done_reason: ollamaDoneReason(result.finishReason),
+ context: [],
+ ...ollamaDurations(startedMs, result.promptTokens, result.completionTokens),
+ prompt_eval_count: result.promptTokens,
+ eval_count: result.completionTokens,
+ })}\n`);
+ res.end();
+ },
+ };
+}
+
+ollamaRouter.post('/api/generate', (req, res) => {
+ if (!authorize(req, res)) return;
+ const parsed = generateSchema.safeParse(req.body);
+ if (!parsed.success) {
+ res.status(400).json({ error: `invalid request: ${parsed.error.message}` });
+ return;
+ }
+ const body = parsed.data;
+ const model = normalizeOllamaModel(body.model);
+ if (!body.prompt && !body.suffix) {
+ // Model load/unload probe; real Ollama answers without generating.
+ const unload = (body as { keep_alive?: unknown }).keep_alive === 0;
+ res.json({
+ model,
+ created_at: new Date().toISOString(),
+ response: '',
+ done: true,
+ done_reason: unload ? 'unload' : 'load',
+ });
+ return;
+ }
+ const options = body.options as Record<string, unknown> | undefined;
+ const messages: ChatMessage[] = [];
+ if (body.system) messages.push({ role: 'system', content: body.system });
+ messages.push({
+ role: 'user',
+ content: body.suffix
+ ? `${body.prompt}\n\nComplete the text before this suffix:\n${body.suffix}`
+ : body.prompt,
+ });
+ void runInboundChat(req, res, {
+ model,
+ messages,
+ stream: body.stream !== false,
+ maxTokens: typeof options?.num_predict === 'number' ? options.num_predict : undefined,
+ temperature: typeof options?.temperature === 'number' ? options.temperature : undefined,
+ topP: typeof options?.top_p === 'number' ? options.top_p : undefined,
+ topK: typeof options?.top_k === 'number' ? options.top_k : undefined,
+ responseFormat: body.format
+ ? (body.format === 'json'
+ ? { type: 'json_object' }
+ : { type: 'json_schema', json_schema: { name: 'ollama_response', schema: body.format } })
+ : undefined,
+ endpoint: 'ollama/generate',
+ }, generateWire(model));
+});
+
+const embedSchema = z.object({
+ model: z.string().optional(),
+ // /api/embed sends `input`; the legacy /api/embeddings body — the whole
+ // reason that endpoint exists — sends `prompt`.
+ input: z.union([z.string(), z.array(z.string())]).optional(),
+ prompt: z.string().optional(),
+ dimensions: z.number().int().positive().optional(),
+}).passthrough().refine(data => data.input != null || data.prompt != null, {
+ message: 'input is required',
+});
+
+async function handleEmbed(req: Request, res: Response, legacy: boolean): Promise<void> {
+ if (!authorize(req, res)) return;
+ const parsed = embedSchema.safeParse(req.body);
+ if (!parsed.success) {
+ res.status(400).json({ error: `invalid request: ${parsed.error.message}` });
+ return;
+ }
+ const rawInput = parsed.data.input ?? parsed.data.prompt ?? '';
+ const inputs = Array.isArray(rawInput) ? rawInput : [rawInput];
+ try {
+ const result = await runEmbeddings(
+ parsed.data.model?.replace(/:latest$/i, ''),
+ inputs,
+ parsed.data.dimensions,
+ );
+ if (legacy) {
+ res.json({ embedding: result.vectors[0] ?? [] });
+ } else {
+ res.json({
+ model: parsed.data.model || result.family,
+ embeddings: result.vectors,
+ total_duration: 0,
+ load_duration: 0,
+ prompt_eval_count: result.inputTokens,
+ });
+ }
+ } catch (error: any) {
+ const status = error instanceof EmbeddingsError ? error.status : 502;
+ res.status(status).json({ error: error.message ?? 'embedding request failed' });
+ }
+}
+
+ollamaRouter.post('/api/embed', (req, res) => {
+ void handleEmbed(req, res, false);
+});
+
+// The dashboard already owns POST /api/embeddings. A valid dashboard session
+// always falls through to that router; otherwise this exact path is Ollama's
+// legacy embeddings endpoint and is governed by the emulation auth mode.
+ollamaRouter.post('/api/embeddings', (req: Request, res: Response, next: NextFunction) => {
+ const dashboardToken = req.headers.authorization?.replace(/^Bearer\s+/i, '')
+ ?? (req.headers['x-dashboard-token'] as string | undefined);
+ if (validateSession(dashboardToken)) {
+ next();
+ return;
+ }
+ // A stale dashboard session must still surface as 401 so the SPA's
+ // re-login flow triggers — unless the bearer could be a unified API key
+ // for key-required Ollama mode, which handleEmbed will verify itself.
+ if (dashboardToken && getOllamaEmulationMode() !== 'key-required') {
+ res.status(401).json({ error: { message: 'Authentication required', type: 'authentication_error' } });
+ return;
+ }
+ void handleEmbed(req, res, true);
+});
diff --git a/server/src/routes/proxy.ts b/server/src/routes/proxy.ts
index 7335a2e2..1eeb3bf7 100644
--- a/server/src/routes/proxy.ts
+++ b/server/src/routes/proxy.ts
@@ -58,11 +58,8 @@ export function timingSafeStringEqual(provided: string, expected: string): boole
}
// Extract the unified API key from an incoming request. Accepts both the
-// OpenAI-style `Authorization: Bearer <key>` header and the Anthropic-style
-// `x-api-key` header. Clients that speak the Anthropic wire format — notably
-// Claude Code routed through CC Switch (#103) — send the key in `x-api-key`
-// rather than a bearer token, and were getting a spurious "Invalid API key"
-// 401 before this fallback existed.
+// OpenAI Bearer, Anthropic x-api-key, and Gemini x-goog-api-key headers.
+// Query credentials remain scoped to the Gemini router.
export function extractApiToken(req: Request): string | undefined {
const bearer = req.headers.authorization?.replace(/^Bearer\s+/i, '').trim();
if (bearer) return bearer;
@@ -70,7 +67,10 @@ export function extractApiToken(req: Request): string | undefined {
const apiKeyHeader = req.headers['x-api-key'];
const xApiKey = Array.isArray(apiKeyHeader) ? apiKeyHeader[0] : apiKeyHeader;
const trimmed = xApiKey?.trim();
- return trimmed || undefined;
+ if (trimmed) return trimmed;
+ const googleHeader = req.headers['x-goog-api-key'];
+ const googleKey = Array.isArray(googleHeader) ? googleHeader[0] : googleHeader;
+ return googleKey?.trim() || undefined;
}
function quotaContextForRoute(route: RouteResult, endpoint: string): QuotaObservationContext {
diff --git a/server/src/routes/responses.ts b/server/src/routes/responses.ts
index 4e7e713f..cab78a6b 100644
--- a/server/src/routes/responses.ts
+++ b/server/src/routes/responses.ts
@@ -397,7 +397,9 @@ responsesRouter.post('/responses', async (req: Request, res: Response) => {
}
completionOpts.max_tokens = budgetCheck.maxTokens;
// Optional client-managed session affinity (mirrors /chat/completions).
- const rawSessionId = req.headers['x-session-id'];
+ const rawSessionId = req.headers['x-codex-session-id']
+ ?? req.headers['session-id']
+ ?? req.headers['x-session-id'];
const sessionIdHeader = Array.isArray(rawSessionId) ? rawSessionId[0] : rawSessionId;
const preferredModel = getStickyModel(messages, sessionIdHeader);
const requestedModelLabel = reqData.model ?? 'auto';
diff --git a/server/src/routes/settings.ts b/server/src/routes/settings.ts
index c0d851d8..d398e8b8 100644
--- a/server/src/routes/settings.ts
+++ b/server/src/routes/settings.ts
@@ -5,6 +5,9 @@ import { applyProxyUrl, applyProxyEnabled, applyProxyBypass, isProxyActive, getP
import { getSavedFusionConfig, setSavedFusionConfig, savedFusionConfigSchema, getFusionMaxK } from '../services/fusion.js';
import { isUnifyEnabled, setUnifyEnabled, getUnifyOverrides, setUnifyOverrides, unifyOverridesSchema } from '../services/model-groups.js';
import { getClaudeModelMap, setClaudeModelMap } from '../services/anthropic-map.js';
+import { getGeminiModelMap, setGeminiModelMap } from '../services/gemini-map.js';
+import { getOllamaEmulationMode } from './ollama.js';
+import { listUrlTokens, mintUrlToken, revokeUrlToken } from '../services/url-tokens.js';
import {
getRequestMaxTokensBudget,
getMaxConsecutiveUpstreamFails,
@@ -103,6 +106,80 @@ settingsRouter.put('/anthropic-map', (req: Request, res: Response) => {
}
});
+settingsRouter.get('/gemini-map', (_req: Request, res: Response) => {
+ res.json({ map: getGeminiModelMap() });
+});
+
+settingsRouter.put('/gemini-map', (req: Request, res: Response) => {
+ try {
+ res.json({ map: setGeminiModelMap(req.body) });
+ } catch (err: any) {
+ const detail = err?.errors
+ ? err.errors.map((e: any) => (e.path?.length ? `${e.path.join('.')}: ${e.message}` : e.message)).slice(0, 5).join(', ')
+ : (err?.message ?? 'invalid');
+ res.status(400).json({ error: { message: `Invalid Gemini model map: ${detail}`, type: 'invalid_request_error' } });
+ }
+});
+
+const compatibilitySchema = z.object({
+ ollamaEmulation: z.enum(['off', 'open-loopback', 'key-required']).optional(),
+ exposeClaudeDiscoveryAliases: z.boolean().optional(),
+}).strict();
+
+settingsRouter.get('/agent-compatibility', (_req: Request, res: Response) => {
+ res.json({
+ ollamaEmulation: getOllamaEmulationMode(),
+ exposeClaudeDiscoveryAliases: getSetting('expose_cc_discovery_aliases') === '1',
+ });
+});
+
+settingsRouter.put('/agent-compatibility', (req: Request, res: Response) => {
+ const parsed = compatibilitySchema.safeParse(req.body);
+ if (!parsed.success) {
+ res.status(400).json({
+ error: {
+ message: `Invalid agent compatibility settings: ${parsed.error.errors.map(error => error.message).join(', ')}`,
+ type: 'invalid_request_error',
+ },
+ });
+ return;
+ }
+ if (parsed.data.ollamaEmulation) setSetting('ollama_emulation', parsed.data.ollamaEmulation);
+ if (parsed.data.exposeClaudeDiscoveryAliases !== undefined) {
+ setSetting('expose_cc_discovery_aliases', parsed.data.exposeClaudeDiscoveryAliases ? '1' : '0');
+ }
+ res.json({
+ ollamaEmulation: getOllamaEmulationMode(),
+ exposeClaudeDiscoveryAliases: getSetting('expose_cc_discovery_aliases') === '1',
+ });
+});
+
+settingsRouter.get('/url-tokens', (_req: Request, res: Response) => {
+ res.json({ tokens: listUrlTokens() });
+});
+
+settingsRouter.post('/url-tokens', (req: Request, res: Response) => {
+ const parsed = z.object({ label: z.string().max(120).optional() }).safeParse(req.body);
+ if (!parsed.success) {
+ res.status(400).json({ error: { message: 'Invalid URL token label', type: 'invalid_request_error' } });
+ return;
+ }
+ res.status(201).json(mintUrlToken(parsed.data.label ?? ''));
+});
+
+settingsRouter.delete('/url-tokens/:id', (req: Request, res: Response) => {
+ const id = Number.parseInt(String(req.params.id), 10);
+ if (!Number.isInteger(id) || id <= 0) {
+ res.status(400).json({ error: { message: 'Invalid URL token id', type: 'invalid_request_error' } });
+ return;
+ }
+ if (!revokeUrlToken(id)) {
+ res.status(404).json({ error: { message: 'Active URL token not found', type: 'not_found_error' } });
+ return;
+ }
+ res.status(204).end();
+});
+
// Get the request guardrails (per-request token budget + failover circuit
// breaker). Both default to 0 = disabled; see lib/guardrails.ts.
settingsRouter.get('/guardrails', (_req: Request, res: Response) => {
diff --git a/server/src/routes/url-tokens.ts b/server/src/routes/url-tokens.ts
new file mode 100644
index 00000000..6fb3f9a6
--- /dev/null
+++ b/server/src/routes/url-tokens.ts
@@ -0,0 +1,35 @@
+import { Router } from 'express';
+import type { NextFunction, Request, Response } from 'express';
+import { getUnifiedApiKey } from '../db/index.js';
+import { ollamaRouter } from './ollama.js';
+import { proxyRouter } from './proxy.js';
+import { responsesRouter } from './responses.js';
+import { validateUrlToken } from '../services/url-tokens.js';
+
+export const urlTokenRouter = Router({ mergeParams: true });
+
+urlTokenRouter.use((req: Request, res: Response, next: NextFunction) => {
+ const token = String(req.params.token ?? '');
+ if (!validateUrlToken(token)) {
+ res.status(401).json({
+ error: {
+ message: 'Invalid or revoked URL token',
+ type: 'authentication_error',
+ },
+ });
+ return;
+ }
+ // Downstream protocol routers retain their normal authentication checks.
+ // Supply the unified key internally only after the separately revocable URL
+ // token was verified; it never appears in the public URL.
+ req.headers.authorization = `Bearer ${getUnifiedApiKey()}`;
+ (req as Request & { urlTokenAuthenticated?: boolean }).urlTokenAuthenticated = true;
+ next();
+});
+
+// OpenAI models/chat and Responses under /v1/t/{token}/...
+urlTokenRouter.use(proxyRouter);
+urlTokenRouter.use(responsesRouter);
+
+// Headerless clients may also use /v1/t/{token}/api/chat and /api/tags.
+urlTokenRouter.use(ollamaRouter);
diff --git a/server/src/services/embeddings.ts b/server/src/services/embeddings.ts
index 7b422706..ba515470 100644
--- a/server/src/services/embeddings.ts
+++ b/server/src/services/embeddings.ts
@@ -251,9 +251,9 @@ function logEmbeddingRequest(
try {
const client = getClientContext();
getDb().prepare(`
- INSERT INTO requests (platform, model_id, key_id, status, input_tokens, output_tokens, latency_ms, error, request_type, client_ip, client_user_agent)
- VALUES (?, ?, ?, ?, ?, 0, ?, ?, 'embedding', ?, ?)
- `).run(row.platform, row.model_id, keyId, status, inputTokens, latencyMs, error, client.ip, client.userAgent);
+ INSERT INTO requests (platform, model_id, key_id, status, input_tokens, output_tokens, latency_ms, error, request_type, client_ip, client_user_agent, client_agent)
+ VALUES (?, ?, ?, ?, ?, 0, ?, ?, 'embedding', ?, ?, ?)
+ `).run(row.platform, row.model_id, keyId, status, inputTokens, latencyMs, error, client.ip, client.userAgent, client.agent);
} catch (e) {
console.error('Failed to log embedding request:', e);
}
diff --git a/server/src/services/gemini-map.ts b/server/src/services/gemini-map.ts
new file mode 100644
index 00000000..ae83005e
--- /dev/null
+++ b/server/src/services/gemini-map.ts
@@ -0,0 +1,81 @@
+import { z } from 'zod';
+import { getDb, getSetting, setSetting } from '../db/index.js';
+
+const SETTING_KEY = 'gemini_model_map';
+
+export const GEMINI_FAMILIES = ['default', 'pro', 'flash', 'flashLite'] as const;
+export type GeminiFamily = (typeof GEMINI_FAMILIES)[number];
+export type GeminiModelMap = Record<GeminiFamily, string>;
+
+const DEFAULT_MAP: GeminiModelMap = {
+ default: 'auto',
+ pro: 'auto',
+ flash: 'auto',
+ flashLite: 'auto',
+};
+
+const schema = z.object({
+ default: z.string().min(1).optional(),
+ pro: z.string().min(1).optional(),
+ flash: z.string().min(1).optional(),
+ flashLite: z.string().min(1).optional(),
+}).strict();
+
+export function getGeminiModelMap(): GeminiModelMap {
+ const raw = getSetting(SETTING_KEY);
+ if (!raw) return { ...DEFAULT_MAP };
+ try {
+ const parsed = JSON.parse(raw) as Partial<GeminiModelMap>;
+ return {
+ default: parsed.default || 'auto',
+ pro: parsed.pro || 'auto',
+ flash: parsed.flash || 'auto',
+ flashLite: parsed.flashLite || 'auto',
+ };
+ } catch {
+ return { ...DEFAULT_MAP };
+ }
+}
+
+export function setGeminiModelMap(input: unknown): GeminiModelMap {
+ const patch = schema.parse(input);
+ const current = getGeminiModelMap();
+ const next = {
+ default: patch.default ?? current.default,
+ pro: patch.pro ?? current.pro,
+ flash: patch.flash ?? current.flash,
+ flashLite: patch.flashLite ?? current.flashLite,
+ };
+ setSetting(SETTING_KEY, JSON.stringify(next));
+ return next;
+}
+
+export function classifyGeminiFamily(model?: string): GeminiFamily | null {
+ const normalized = (model ?? '').trim().toLowerCase().replace(/^models\//, '');
+ if (!normalized || normalized === 'auto') return 'default';
+ if (!normalized.startsWith('gemini')) return null;
+ if (/flash[-_]?lite/.test(normalized)) return 'flashLite';
+ if (normalized.includes('flash')) return 'flash';
+ if (normalized.includes('pro')) return 'pro';
+ return 'default';
+}
+
+/**
+ * Resolve a Gemini-family request to the operator's selected catalog id.
+ * Returning `auto` leaves routing unpinned; concrete non-Gemini catalog ids
+ * still pass through unchanged for native clients that select the gateway's
+ * advertised ids.
+ */
+export function resolveGeminiModel(model?: string): string {
+ const raw = (model ?? '').trim().replace(/^models\//, '');
+ const family = classifyGeminiFamily(raw);
+ if (family) {
+ const target = getGeminiModelMap()[family];
+ if (!target || target === 'auto') return 'auto';
+ const exists = getDb().prepare(
+ 'SELECT 1 FROM models WHERE model_id = ? AND enabled = 1',
+ ).get(target);
+ return exists ? target : 'auto';
+ }
+ return raw || 'auto';
+}
diff --git a/server/src/services/media.ts b/server/src/services/media.ts
index da08cd43..d681cecd 100644
--- a/server/src/services/media.ts
+++ b/server/src/services/media.ts
@@ -485,9 +485,9 @@ function logMedia(row: Pick<MediaModelRow, 'platform' | 'model_id' | 'modality'>
try {
const client = getClientContext();
getDb()
- .prepare(`INSERT INTO requests (platform, model_id, key_id, status, input_tokens, output_tokens, latency_ms, error, request_type, client_ip, client_user_agent)
- VALUES (?, ?, ?, ?, 0, 0, ?, ?, ?, ?, ?)`)
- .run(row.platform, row.model_id, keyId, status, latencyMs, error, row.modality, client.ip, client.userAgent);
+ .prepare(`INSERT INTO requests (platform, model_id, key_id, status, input_tokens, output_tokens, latency_ms, error, request_type, client_ip, client_user_agent, client_agent)
+ VALUES (?, ?, ?, ?, 0, 0, ?, ?, ?, ?, ?, ?)`)
+ .run(row.platform, row.model_id, keyId, status, latencyMs, error, row.modality, client.ip, client.userAgent, client.agent);
} catch (e) {
console.error('Failed to log media request:', e);
}
diff --git a/server/src/services/url-tokens.ts b/server/src/services/url-tokens.ts
new file mode 100644
index 00000000..d07a76a6
--- /dev/null
+++ b/server/src/services/url-tokens.ts
@@ -0,0 +1,76 @@
+import crypto from 'crypto';
+import { getDb, getUnifiedApiKey } from '../db/index.js';
+import { timingSafeStringEqual } from '../routes/proxy.js';
+
+function hashToken(token: string): string {
+ return crypto.createHash('sha256').update(token).digest('hex');
+}
+
+export interface UrlTokenRow {
+ id: number;
+ label: string;
+ tokenPrefix: string;
+ createdAt: string;
+ lastUsedAt: string | null;
+ revokedAt: string | null;
+}
+
+export function listUrlTokens(): UrlTokenRow[] {
+ const rows = getDb().prepare(`
+ SELECT id, label, token_prefix, created_at, last_used_at, revoked_at
+ FROM url_tokens
+ ORDER BY id DESC
+ `).all() as Array<{
+ id: number;
+ label: string;
+ token_prefix: string;
+ created_at: string;
+ last_used_at: string | null;
+ revoked_at: string | null;
+ }>;
+ return rows.map(row => ({
+ id: row.id,
+ label: row.label,
+ tokenPrefix: row.token_prefix,
+ createdAt: row.created_at,
+ lastUsedAt: row.last_used_at,
+ revokedAt: row.revoked_at,
+ }));
+}
+
+export function mintUrlToken(label: string): UrlTokenRow & { token: string } {
+ const token = `flmurl_${crypto.randomBytes(24).toString('base64url')}`;
+ const prefix = `${token.slice(0, 12)}…`;
+ const result = getDb().prepare(`
+ INSERT INTO url_tokens (token_hash, label, token_prefix)
+ VALUES (?, ?, ?)
+ `).run(hashToken(token), label.trim(), prefix);
+ const row = listUrlTokens().find(entry => entry.id === Number(result.lastInsertRowid))!;
+ return { ...row, token };
+}
+
+export function revokeUrlToken(id: number): boolean {
+ return getDb().prepare(`
+ UPDATE url_tokens SET revoked_at = datetime('now')
+ WHERE id = ? AND revoked_at IS NULL
+ `).run(id).changes > 0;
+}
+
+export function validateUrlToken(token: string): boolean {
+ if (!token || timingSafeStringEqual(token, getUnifiedApiKey())) {
+ if (token) {
+ console.warn('[URL tokens] Rejected a raw unified API key in a tokenized URL');
+ }
+ return false;
+ }
+ const hash = hashToken(token);
+ const row = getDb().prepare(`
+ SELECT id FROM url_tokens
+ WHERE token_hash = ? AND revoked_at IS NULL
+ `).get(hash) as { id: number } | undefined;
+ if (!row) return false;
+ getDb().prepare(
+ "UPDATE url_tokens SET last_used_at = datetime('now') WHERE id = ?",
+ ).run(row.id);
+ return true;
+}