Skip to content

Configuration Options

Defaults and available fields are aligned with config.example.yaml.

Core

ParameterTypeDefaultDescription
hoststring""Bind address; "" listens on all IPv4/IPv6 interfaces. Use 127.0.0.1 or localhost for local-only access.
portinteger8317Server port.
tls.enablebooleanfalseEnable HTTPS.
tls.cert / tls.keystring""TLS certificate and private-key paths.
auth-dirstring"~/.cli-proxy-api"Credential directory; ~ is supported.
api-keysstring[][]API keys accepted by this proxy.
debugbooleanfalseEnable debug logging.
request-logbooleanfalseEnable detailed request and response logging.
pprof.enablebooleanfalseEnable the pprof HTTP debug server.
pprof.addrstring"127.0.0.1:8316"pprof bind address; keep it local.
commercial-modebooleanfalseDisable high-overhead request logging and middleware to reduce memory use.
logging-to-filebooleanfalseWrite rotating application logs instead of stdout.
logs-max-total-size-mbinteger0Total log-directory size limit in MB; 0 disables the limit.
error-logs-max-filesinteger10Maximum retained error-log files when request logging is disabled; 0 disables cleanup.
usage-statistics-enabledbooleanfalseEnable in-memory usage aggregation.
redis-usage-queue-retention-secondsinteger60Retain usage-queue items in memory for this many seconds; maximum 3600.
proxy-urlstring""Global outbound proxy (socks5, http, or https). Per-credential proxy-url accepts direct or none to bypass it and environment proxies.
force-model-prefixbooleanfalseWhen true, unprefixed model requests use only credentials without a prefix (except when the prefix equals the model name).
passthrough-headersbooleanfalseForward filtered upstream response headers to clients.
request-retryinteger3Retry count for 403/408/500/502/503/504 responses.
max-retry-credentialsinteger0Maximum credentials tried for one failed request; 0 keeps the legacy “try all” behavior.
max-retry-intervalinteger30Maximum seconds to wait for a cooled-down credential before retrying.
disable-coolingbooleanfalseGlobally disable credential/model cooldown scheduling.
save-cooldown-statusbooleanfalsePersist credential cooldown state in .cds files next to auth files.
transient-error-cooldown-secondsinteger0Cooldown for transient 408/500/502/503/504 errors; 0 uses the legacy 60 seconds and -1 disables it.
disable-claude-cloak-modebooleanfalseDisable Claude request cloaking globally; individual credentials can override it.
disable-image-generationboolean | "chat" | "passthrough"falsetrue disables image generation everywhere and makes /v1/images/* return 404; "chat" disables injection only outside image endpoints; "passthrough" leaves non-image client payloads unchanged and behaves as "chat" for image endpoints.
gpt-image-2-base-modelstring"gpt-5.4-mini"Base model for the legacy hosted image-generation path. Must start with gpt-.
video-result-auth-cache-ttlstring"3h"How long video IDs remain bound to the credential that created them.
auth-auto-refresh-workersinteger16OAuth/file-auth refresh worker count; values greater than 0 override the default.
ws-authbooleantrueRequire authentication for /v1/ws.
nonstream-keepalive-intervalinteger0Emit blank lines every N seconds for non-streaming responses; 0 disables it.
streaming.keepalive-secondsinteger0SSE keep-alive interval; values ≤ 0 disable it.
streaming.bootstrap-retriesinteger0Safe streaming retries before the first byte is sent.
antigravity-signature-cache-enabledbooleantruePrefer and validate cached thinking-block signatures; set false only to use bypass mode.
antigravity-signature-bypass-strictbooleanfalseIn bypass mode, validate the full Claude protobuf signature structure instead of only basic format.

Management API

ParameterTypeDefaultDescription
remote-management.allow-remotebooleanfalsePermit non-localhost management access.
remote-management.secret-keystring""Management key; plaintext is hashed on startup. Empty disables all /v0/management routes (404).
remote-management.disable-control-panelbooleanfalseDisable bundled management-panel assets and routes.
remote-management.disable-auto-update-panelbooleanfalseDisable periodic background updates of the management panel. It is still fetched on first access when missing.
remote-management.panel-github-repositorystring"https://github.com/router-for-me/Cli-Proxy-API-Management-Center"Repository or releases API URL for the management panel bundle.

Plugins

ParameterTypeDefaultDescription
plugins.enabledbooleanfalseEnable trusted in-process dynamic plugins.
plugins.dirstring"plugins"Plugin discovery directory.
plugins.store-sourcesstring[][]Additional plugin-store registry URLs; the official registry is always included.
plugins.store-auth[].matchstring""URL prefix matched by a plugin-store authentication rule; HTTP requires allow-insecure: true.
plugins.store-auth[].apply-tostring[][]Request kinds to authenticate: registry, metadata, and/or artifact.
plugins.store-auth[].typestring""Authentication type: none, bearer, basic, header, or github-token.
plugins.store-auth[].token-envstring""Environment variable containing a bearer, GitHub, or other token.
plugins.store-auth[].username-env / password-envstring""Environment variables for basic authentication.
plugins.store-auth[].header-name / header-value-envstring""Header name and environment variable containing its value for header authentication.
plugins.store-auth[].allow-insecurebooleanfalseAllow insecure authentication configuration where supported.
plugins.configs.<plugin-id>.enabledbooleanfalseEnable one plugin instance; this does not change plugins.enabled.
plugins.configs.<plugin-id>.priorityinteger0Plugin startup and routing priority.

Quota, Routing, and Codex

ParameterTypeDefaultDescription
quota-exceeded.switch-projectbooleantrueSwitch projects automatically on quota exhaustion.
quota-exceeded.switch-preview-modelbooleantrueSwitch automatically to a preview model on exhaustion.
quota-exceeded.antigravity-creditsbooleantrueLast-resort Claude fallback: use an auth with Google One AI credits after free-tier auths are exhausted (429/503).
routing.strategystring"round-robin"Credential-selection strategy: round-robin or fill-first.
routing.session-affinitybooleanfalseBind sessions to credentials. IDs come from metadata.user_id, X-Session-ID, Session_id, X-Client-Request-Id, conversation_id, or a message hash; failover remains enabled.
routing.session-affinity-ttlstring"1h"Session-to-credential binding TTL.
codex.identity-confusebooleanfalseWith fill-first or session affinity, remap Codex cache and installation identifiers for the selected auth.

Provider Credentials

All provider lists default to []. priority defaults to 0; a higher value is preferred. models.*.display-name is the optional catalog label, and models.*.force-mapping rewrites upstream response model fields to the client alias.

Gemini and Native Interactions

gemini-api-key[] and interactions-api-key[] use the same fields. The latter is used only for direct /v1beta/interactions execution.

ParameterTypeDefaultDescription
<provider>.*.api-keystring""API key.
<provider>.*.priorityinteger0Credential selection priority.
<provider>.*.prefixstring""Optional prefix; call as prefix/model.
<provider>.*.disable-coolingbooleanfalseDisable cooldown scheduling for this credential.
<provider>.*.base-urlstring"https://generativelanguage.googleapis.com"Custom endpoint.
<provider>.*.headersobject{}Extra request headers.
<provider>.*.proxy-urlstring""Per-key proxy override.
<provider>.*.models.*.name / aliasstring""Upstream model name and client alias.
<provider>.*.models.*.display-namestring""Human-readable model-catalog label.
<provider>.*.models.*.force-mappingbooleanfalseReturn the alias in upstream response model fields.
<provider>.*.excluded-modelsstring[][]Excluded models; wildcards are supported.

Codex and xAI

codex-api-key[] and xai-api-key[] use the following fields; xAI uses the native xAI executor.

ParameterTypeDefaultDescription
<provider>.*.api-key, priority, prefix, disable-cooling, headers, proxy-url, excluded-modelsmixedSame meaning as the Gemini credential fields above.
<provider>.*.base-urlstringRequired custom endpoint; entries without a non-empty value are discarded.
<provider>.*.websocketsbooleanfalseUse the upstream Responses API WebSocket transport.
<provider>.*.models.*.name / alias / display-name / force-mappingmixedSame model-mapping fields as above.

Claude

ParameterTypeDefaultDescription
claude-api-key.*.api-key, priority, prefix, disable-cooling, base-url, headers, proxy-url, excluded-modelsmixedSame meaning as the Gemini credential fields above.
claude-api-key.*.models.*.name / alias / display-name / force-mappingmixedUpstream mapping and response-model rewrite controls.
claude-api-key.*.rebuild-mid-system-messagebooleanfalseMove messages with role system into Claude's top-level system field.
claude-api-key.*.cloak.modestring"auto"Cloaking mode: auto (non-Claude Code clients), always, or never.
claude-api-key.*.cloak.strict-modebooleanfalseStrip user system messages and retain only the Claude Code prompt.
claude-api-key.*.cloak.sensitive-wordsstring[][]Words to obfuscate with zero-width characters.
claude-api-key.*.cloak.cache-user-idbooleanfalseReuse a cached user_id for this API key.
claude-api-key.*.experimental-cch-signingbooleanfalseSign the final cloaked /v1/messages body with the current Claude Code CCH algorithm.

OpenAI Compatibility

ParameterTypeDefaultDescription
openai-compatibility.*.name, priority, prefix, base-url, headersmixedProvider identifier, selection priority, optional prefix, endpoint, and headers.
openai-compatibility.*.disabled / disable-coolingbooleanfalseDisable this provider, or disable cooldown scheduling for it.
openai-compatibility.*.api-key-entries.*.api-key / proxy-urlstring""Provider API key and optional per-key proxy.
openai-compatibility.*.models.*.name / alias / display-name / force-mappingmixedUpstream mapping and response-model rewrite controls.
openai-compatibility.*.models.*.imagebooleanfalseAllow the model on /v1/images/generations and /v1/images/edits.
openai-compatibility.*.models.*.input-modalities / output-modalitiesstring[][]Declared input/output capabilities, such as text and image.
openai-compatibility.*.models.*.thinking.levelsstring[]["low", "medium", "high"]Supported reasoning-effort levels.

Vertex-Compatible API Keys

ParameterTypeDefaultDescription
vertex-api-key.*.api-key, priority, prefix, base-url, headers, proxy-url, excluded-modelsmixedVertex-compatible credential and routing settings.
vertex-api-key.*.models.*.name / alias / display-name / force-mappingmixedUpstream mapping and response-model rewrite controls.

OAuth Model Controls and Header Defaults

ParameterTypeDefaultDescription
oauth-model-aliasobject{}Model aliases by OAuth channel: vertex, aistudio, antigravity, claude, codex, kimi, xai, or an OAuth plugin provider key.
oauth-model-alias.*.*.name / aliasstring""Upstream and client-visible model IDs.
oauth-model-alias.*.*.forkbooleanfalseKeep the upstream model and expose the alias as an additional model.
oauth-model-alias.*.*.display-namestring""Catalog label for the alias.
oauth-model-alias.*.*.force-mappingbooleanfalseReturn the client-visible alias in upstream response model fields.
oauth-excluded-modelsobject{}Excluded OAuth models by channel; wildcards are supported.
claude-header-defaults.user-agent, package-version, runtime-version, timeoutstring""Fallback Claude OAuth request headers when clients omit them.
claude-header-defaults.os / archstring""Runtime-derived by default; used as the pinned platform baseline when device-profile stabilization is enabled.
claude-header-defaults.stabilize-device-profilebooleanfalsePin OS/architecture to the configured baseline for each auth.
codex-header-defaults.user-agent / beta-featuresstring""Fallback Codex OAuth headers; beta-features applies only to WebSocket requests.

Payload Rules

payload.default, default-raw, override, override-raw, and filter are arrays of rules. default* writes only missing values, override* always writes values, and filter removes paths. *-raw values must be valid JSON.

ParameterTypeDefaultDescription
payload.<rule>[].models[].namestring""Matching model name; wildcards are supported.
payload.<rule>[].models[].protocolstring""Target protocol: openai, responses, gemini, claude, codex, or antigravity.
payload.<rule>[].models[].from-protocolstring""Restrict the source protocol: openai, responses, gemini, or claude.
payload.<rule>[].models[].headersobject{}Required request-header patterns; values support * wildcards.
payload.<rule>[].models[].match / not-matchobject[][]JSON-path conditions that must equal, or must not equal, the configured values.
payload.<rule>[].models[].exist / not-existstring[][]JSON paths that must exist and be non-null, or be missing/null.
payload.default[].params / payload.override[].paramsobject{}JSON path → value.
payload.default-raw[].params / payload.override-raw[].paramsobject{}JSON path → raw JSON value.
payload.filter[].paramsstring[][]JSON paths to remove.

Released under the MIT License.