Configuration Options
| Parameter | Type | Default | Description |
|---|---|---|---|
port | integer | 8317 | The port number on which the server will listen. |
auth-dir | string | "~/.cli-proxy-api" | Directory where authentication tokens are stored. Supports using ~ for the home directory. If you use Windows, please set the directory like this: C:/cli-proxy-api/ |
proxy-url | string | "" | Proxy URL. Supports socks5/http/https protocols. Example: socks5://user:[email protected]:1080/ |
request-retry | integer | 0 | Number of times to retry a request. Retries will occur if the HTTP response code is 403, 408, 500, 502, 503, or 504. |
remote-management.allow-remote | boolean | false | Whether to allow remote (non-localhost) access to the management API. If false, only localhost can access. A management key is still required for localhost. |
remote-management.secret-key | string | "" | Management key. If a plaintext value is provided, it will be hashed on startup using bcrypt and persisted back to the config file. If empty, the entire management API is disabled (404). |
remote-management.disable-control-panel | boolean | false | When true, skip downloading management.html and return 404 for /management.html, effectively disabling the bundled management UI. |
ampcode | object | {} | Amp CLI integration block. Legacy amp-upstream-* keys are auto-migrated into this structure on load and rewritten. |
ampcode.upstream-url | string | "" | Amp control plane URL. When empty, only provider aliases are registered (management proxy disabled). |
ampcode.upstream-api-key | string | "" | Optional ampcode.com API key override with highest precedence. |
ampcode.restrict-management-to-localhost | boolean | true | Whether to restrict Amp management routes to localhost only. |
ampcode.model-mappings | object[] | [] | Amp model fallback mappings: map requested model (from) to an available local model (to). |
ampcode.model-mappings.*.from | string | "" | Model name requested by Amp CLI. |
ampcode.model-mappings.*.to | string | "" | Local or proxy-available model to route to instead. |
quota-exceeded | object | {} | Configuration for handling quota exceeded. |
quota-exceeded.switch-project | boolean | true | Whether to automatically switch to another project when a quota is exceeded. |
quota-exceeded.switch-preview-model | boolean | true | Whether to automatically switch to a preview model when a quota is exceeded. |
debug | boolean | false | Enable debug mode for verbose logging. |
logging-to-file | boolean | true | Write application logs to rotating files instead of stdout. Set to false to log to stdout/stderr. |
usage-statistics-enabled | boolean | true | Enable in-memory usage aggregation for management APIs. Disable to drop all collected usage metrics. |
api-keys | string[] | [] | Legacy shorthand for inline API keys. Values are mirrored into the config-api-key provider for backwards compatibility. |
gemini-api-key | object[] | [] | Gemini API key entries with optional per-key base-url and proxy-url overrides. |
gemini-api-key.*.api-key | string | "" | Gemini API key. |
gemini-api-key.*.base-url | string | "" | Optional Gemini API endpoint override. |
gemini-api-key.*.headers | object | {} | Optional extra HTTP headers sent to the overridden Gemini endpoint only. |
gemini-api-key.*.proxy-url | string | "" | Optional per-key proxy override for the Gemini API key. |
generative-language-api-key | string[] | [] | (Legacy alias) Pure key list mirrored from gemini-api-key; loads migrate into gemini-api-key and the legacy field is removed on save. |
codex-api-key | object | {} | List of Codex API keys. |
codex-api-key.api-key | string | "" | Codex API key. |
codex-api-key.base-url | string | "" | Custom Codex API endpoint, if you use a third-party API endpoint. |
codex-api-key.proxy-url | string | "" | Proxy URL for this specific API key. Overrides the global proxy-url setting. Supports socks5/http/https protocols. |
claude-api-key | object | {} | List of Claude API keys. |
claude-api-key.api-key | string | "" | Claude API key. |
claude-api-key.base-url | string | "" | Custom Claude API endpoint, if you use a third-party API endpoint. |
claude-api-key.proxy-url | string | "" | Proxy URL for this specific API key. Overrides the global proxy-url setting. Supports socks5/http/https protocols. |
claude-api-key.models | object[] | [] | Model alias entries for this key. |
claude-api-key.models.*.name | string | "" | Upstream Claude model name invoked against the API. |
claude-api-key.models.*.alias | string | "" | Client-facing alias that maps to the upstream model name. |
openai-compatibility | object[] | [] | Upstream OpenAI-compatible providers configuration (name, base-url, API keys, models); only api-key-entries are persisted. |
openai-compatibility.*.name | string | "" | The name of the provider. It will be used in the user agent and other places. |
openai-compatibility.*.base-url | string | "" | The base URL of the provider. |
openai-compatibility.*.api-keys | string[] | [] | (Deprecated) Parsed for compatibility, migrated into api-key-entries, and removed on save. |
openai-compatibility.*.api-key-entries | object[] | [] | API key entries with optional per-key proxy configuration. Preferred over api-keys. |
openai-compatibility.*.api-key-entries.*.api-key | string | "" | The API key for this entry. |
openai-compatibility.*.api-key-entries.*.proxy-url | string | "" | Proxy URL for this specific API key. Overrides the global proxy-url setting. Supports socks5/http/https protocols. |
openai-compatibility.*.models | object[] | [] | Model alias definitions routing client aliases to upstream names. |
openai-compatibility.*.models.*.name | string | "" | Upstream model name invoked against the provider. |
openai-compatibility.*.models.*.alias | string | "" | Client alias routed to the upstream model. |
NOTE
When claude-api-key.models is specified, only the provided aliases are registered in the model registry (mirroring OpenAI compatibility behaviour), and the default Claude catalog is suppressed for that credential.