docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages - #348

Merged
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections
May 19, 2026
Merged

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages#348
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections

Conversation

@janiussyafiq

@janiussyafiqjaniussyafiq commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes#347. Five surgical corrections to the configuration-reference cluster:

  1. admin-api.md:76 — group label "health" → "livez". /livez is the public route; /admin/v1/health requires admin auth.
  2. api-keys.md:86 — rotate response example: 16-char key suffix replaced with a 32-char suffix matching what callers actually receive (Uuid::new_v4().as_simple() produces 32 hex chars).
  3. caching.md — explicit note that CachePolicy.backend is parsed and stored on each row but not consulted by any runtime consumer; the proxy uses the bootstrap-config (cache.backend) instead.
  4. models.md:80background_model_check.ignore_statuses default: Vec<u16> with #[serde(default)] resolves to Vec::new(), not [408, 429]. Re-presented [408, 429] as a recommended explicit setting.
  5. models.md:163Model.cost consumer split: AISIX Cloud's cp-api recomputes cost server-side; the standalone OSS proxy hard-codes cost_usd = 0.0 and does not consult the field.

Doc-only diff. No code, schemas, configs, or test fixtures touched.

Changes

FileChange
docs/configuration/admin-api.mdGroup label on line 76 changed from "public operator helpers: health, metrics, and OpenAPI discovery" to "public operator helpers: livez, metrics, and OpenAPI discovery".
docs/configuration/api-keys.mdRotate response example on line 86: sk-abcd1234ef567890 (16 hex) replaced with sk-550e8400e29b41d4a716446655440000 (32 hex) to match Uuid::new_v4().as_simple() output.
docs/configuration/caching.mdAdded a one-paragraph note after the CachePolicy.backend-conservative bullet (line 83) explicitly stating the field is parsed but not consulted by the runtime proxy, that the runtime backend selection comes from bootstrap-config (cache.backend), and that the field is preserved for forward compatibility.
docs/configuration/models.mdBullet on line 80 rewritten: removed the misleading [408, 429] default claim and stated that without an explicit value no probe statuses are ignored, then re-presented [408, 429] as a recommended explicit setting with the operational rationale (tolerates transient 408/429 during probes).
docs/configuration/models.mdBullet on line 163 rewritten: Model.cost description now makes the substrate split explicit — AISIX Cloud's cp-api consumes the field; the standalone OSS proxy does not consult it at request time and emits cost_usd=0.0; pricing-aware budget enforcement requires the Cloud control plane.

Net diff: 4 files, +6 / -4. Source: git diff --stat.

Test plan

Doc-only diff — no .rs files, schemas, configs, or test fixtures touched. The cargo trio was still run end-to-end as the canonical pre-merge gate. The first cargo test --workspace invocation OOMed under default parallelism (this VPS has 8 GB and the workspace compiles 30+ crate test binaries); re-ran with cargo test --workspace -j 2 (and CARGO_BUILD_JOBS=2) to cap compile concurrency — all suites green.

  • cargo fmt --check — PASS (exit 0).
  • cargo clippy --workspace --all-targets -- -D warnings — PASS (exit 0, 18.30s, no warnings).
  • cargo test --workspace -j 2 — PASS (exit 0, 33 suites all green; 1067 tests passed, 0 failed, 3 ignored).
  • grep -rln <each affected page> tests/e2e/ for all 4 pages returns empty. pnpm test under tests/e2e/ is not applicable for this diff.

cargo clippy tail

 Checking aisix-provider-azure-openai v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-provider-azure-openai)
Checking aisix-proxy v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-proxy)
Checking aisix-admin v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-admin)
Checking aisix-server v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-server)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.30s

cargo test summary

33 test-suite-result lines, all 'ok'. Aggregate: 1067 tests passed, 0 failed, 3 ignored across the workspace (unit suites + doc-tests). Tally is higher than the post-#338 baseline (1041) because PRs #341/#343/#345/#346 added test coverage for new Provider variants, Hub registrations, the OpenAI-adapter long-tail providers, and the Anthropic-shape error envelope on /v1/messages.

Affected pages

  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

Pre-merge-check verification log

Issue #347 called out three pre-merge checks. All three resolved as follows:

  1. ignore_statuses default re-verified at PR-time HEAD. Field declaration on origin/main at 71ea97e is at crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160 cited in the issue body — file reorganization between audit-window and PR-window; substance unchanged). Declaration is verbatim: #[serde(default, skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>. No custom default = "..." attribute, so the #[serde(default)] resolves to <Vec<u16> as Default>::default() = Vec::new(). Consumer at crates/aisix-proxy/src/background.rs:84,88 is unchanged: cfg.ignore_statuses.contains(&status) against the empty default, so the silent-failure mode is exactly as documented.
  2. Model.cost hard-code re-verified at PR-time HEAD.crates/aisix-proxy/src/chat.rs:989 still reads let cost_usd = 0.0;, preceded by the explanatory comment at :987-988: "cp-api recomputes cost server-side from its pricing catalog when ingesting telemetry; the DP just records 0.0 on the wire." The chat.rs file also hard-codes cost_usd: 0.0 at four additional call sites (:242, :648, :699, :832), confirming the pattern is workspace-wide, not just at one site. No Model.cost field read site exists in crates/aisix-proxy/.
  3. All 5 anchors re-grep'd against current HEAD. No consumer landed between the issue's audit window (71ea97e) and PR open (also 71ea97e):
    • /livez route mount on crates/aisix-admin/src/lib.rs:67
    • /admin/v1/health admin-scoped mount on crates/aisix-admin/src/lib.rs:145
    • Uuid::new_v4().as_simple() for rotate plaintext on crates/aisix-admin/src/apikeys_handlers.rs:168
    • Zero hits for entry.value.backend / policy.backend / cache_policy.backend consumers in crates/
    • cfg.ignore_statuses.contains(...) consumer on crates/aisix-proxy/src/background.rs:84,88
    • let cost_usd = 0.0; hard-code on crates/aisix-proxy/src/chat.rs:989

Model.cost example placeholder note

The 32-char replacement plaintext in the rotate example is sk-550e8400e29b41d4a716446655440000. The 32-hex segment is the canonical "all-zeros after the variant byte" UUID example value used as a placeholder across many published examples; it is structurally identical to a real Uuid::new_v4().as_simple() output (no hyphens, 32 hex chars) without being a copy of any real generated key.

Coexistence with PR #326 and PR #344

This PR's affected pages (admin-api.md, api-keys.md, caching.md, models.md) do not overlap with PR #326 or PR #344's affected files (which cover the overview / quickstart / bootstrap-config cluster). No git merge-tree collision check needed — disjoint file sets.

References

Summary by CodeRabbit

Documentation

  • Clarified public operator helper routes listed in admin API documentation
  • Updated API key rotation example in configuration guide
  • Added cache backend behavior clarification explaining runtime configuration precedence
  • Enhanced model configuration documentation with health check status handling and cost calculation details

Review Change Stack

…api-keys, caching, and models pages
Closes#347.
Five corrections, each anchored to a runtime consumer (or non-consumer)
verified on `origin/main` at `71ea97e`. The cluster mirrors the
consumer-trace discipline locked in by #326 / #344: for every behavioral
claim, verify the runtime consumer actually reads the documented value,
rather than only verifying the field exists with a default.
- admin-api.md:76 — group label "health" → "livez". The public route
is `/livez` (registered at crates/aisix-admin/src/lib.rs:67); the
`/admin/v1/health` endpoint requires admin auth (registered at :145).
- api-keys.md:86 — rotate response example: 16-char suffix replaced
with a 32-char suffix. Rotate handler at
crates/aisix-admin/src/apikeys_handlers.rs:168 uses
`Uuid::new_v4().as_simple()`, which produces 32 hex chars.
- caching.md — explicit note that `CachePolicy.backend` is parsed and
stored on each row but not consulted at runtime. No consumer of
`entry.value.backend` / `policy.backend` / `cache_policy.backend`
exists in `crates/`. The proxy uses the bootstrap-config
(`cache.backend`) instead.
- models.md:80 — `ignore_statuses` default. Field at
crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160
cited in the issue body) is declared `#[serde(default,
skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>`,
so the actual default is the empty vector — not `[408, 429]` as the
doc claimed. Re-presented `[408, 429]` as a recommended explicit
setting. Consumer at crates/aisix-proxy/src/background.rs:84,88 calls
`cfg.ignore_statuses.contains(...)` against the empty default.
- models.md:163 — `Model.cost` consumer split. Standalone OSS proxy
hard-codes `cost_usd = 0.0` at crates/aisix-proxy/src/chat.rs:989
(with comment "cp-api recomputes cost server-side from its pricing
catalog"). The `Model.cost` field is consumed by AISIX Cloud's
cp-api, not by the OSS proxy.
CopilotAI review requested due to automatic review settings May 18, 2026 20:51
@janiussyafiqjaniussyafiq added documentation Improvements or additions to documentation priority-normal labels May 18, 2026
@coderabbitai

coderabbitaiBot commented May 18, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 61d60a44-4de1-4072-a5cb-3a69eb7bf787

📥 Commits

Reviewing files that changed from the base of the PR and between 71ea97e and 11d58e5.

📒 Files selected for processing (4)
  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

📝 Walkthrough

Walkthrough

This PR updates four configuration documentation files to clarify operator-facing behavior: public API routes, API key examples, cache backend runtime semantics, and model health check and pricing behavior for both AISIX Cloud and OSS deployments.

Changes

Configuration Documentation Clarifications

Layer / File(s)Summary
Operator and API credential documentation
docs/configuration/admin-api.md, docs/configuration/api-keys.md
Admin API public operator helper routes are clarified to include livez, metrics, and OpenAPI discovery (removing health). API key rotation example is updated with a new sample plaintext token.
Cache and model configuration semantics
docs/configuration/caching.md, docs/configuration/models.md
CachePolicy.backend field is clarified as parsed but not used by the runtime proxy; runtime backend selection is driven by bootstrap configuration only. Model health check ignore_statuses behavior is clarified: omission means no statuses are ignored. Cost field semantics are updated to distinguish AISIX Cloud server-side recomputation from OSS proxy zero-cost behavior and AISIX Cloud control plane dependency.

🎯 1 (Trivial) | ⏱️ ~3 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This doc-only PR corrects several inaccuracies in the configuration reference docs to better reflect actual runtime behavior and response shapes across the admin API, API keys, caching, and models documentation.

Changes:

  • Rename the public operator helper label from health to livez to reflect the unauthenticated /livez route.
  • Update the API key rotation example to show a 32-hex UUID suffix consistent with Uuid::new_v4().as_simple().
  • Clarify runtime boundaries for CachePolicy.backend, background_model_check.ignore_statuses defaults, and Model.cost consumption.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
docs/configuration/admin-api.mdCorrects the public helper group label to livez.
docs/configuration/api-keys.mdFixes rotate response example to show a 32-char key suffix.
docs/configuration/caching.mdAdds an explicit note that CachePolicy.backend is currently parsed but not consulted by the proxy runtime.
docs/configuration/models.mdCorrects ignore_statuses default behavior and clarifies cost handling expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -160,7 +160,7 @@ curl -sS -X POST http://127.0.0.1:3001/admin/v1/models \
- `provider` currently supports `openai`, `anthropic`, `google`, `deepseek`, `cohere`, and `jina`.
@moonming
moonming merged commit 2c1d485 into mainMay 19, 2026
11 checks passed
janiussyafiq added a commit that referenced this pull request May 20, 2026
Integrate origin/main (commit 2c1d485 = post-PR-#326 / #348 plus
#330 / #341 / #343 / #345 / #346) into this branch via `git merge
--squash` to clear PR #344's lingering `mergeable: dirty` state.
Conflict on `docs/quickstart/self-hosted.md` was a 3-way-merge-base
artifact: base (3596c0a) read `- a reachable etcd instance`, main
changed `a` → `A` (via #326), this branch additionally inserted the
glossary link. Both changes are wanted; resolution per Umar's
approved plan was `git checkout --ours`, which preserves the branch's
self-hosted.md state (already integrates capital A + glossary link
+ first-time-build paragraph + keep-running framing). Other 4
overlapping doc files auto-merged cleanly (`bootstrap-config.md`,
`core-concepts.md`, `first-model-first-key-first-request.md`,
`openai-sdk.md`). Code files all auto-merged cleanly.
Additional Copilot review (post-`167196a` cycle) addressed:
- `docs/index.md:7` — change link display text from `[data-plane]`
to `[data plane]` to match the canonical glossary term. The URL
anchor `#data-plane` stays kebab-case (matches the glossary
heading's auto-anchor); only the display text changes. Comment
id 3271145422.
- `docs/quickstart/openai-sdk.md:43` — change `All three steps below`
to `All commands below`. The Install-the-SDK section has two
command blocks (mkdir+cd, npm install), not three; the prior
wording originated from a mental model (mkdir, cd, install)
that doesn't match the typographic count of code blocks under
the heading. Comment id 3271145458.
Copilot's third comment on `docs/overview/core-concepts.md`
Observability Exporter wording (id 3271145444) auto-resolves via
this merge — main's #326 rewrite supersedes the branch's pre-#326
wording at that location ("ships per-request span telemetry…
OTLP/HTTP-compatible backend…" replaces "Use this concept when
documenting…"). No separate edit needed; the merge IS the fix.
janiussyafiq added a commit that referenced this pull request May 20, 2026
…ickstart-polish
Resolve PR #344's lingering mergeable: dirty state by linking the
branch history to origin/main (2c1d485 = post-#326 / #348 / #330 /
#341 / #343 / #345 / #346).
The squash-merge commit landed earlier (e2af197) integrated main's
content into the branch tree but did not link the histories, so
GitHub's mergeable computation still saw the 3-way-merge-base
artifact conflict on docs/quickstart/self-hosted.md (a vs A + the
glossary link / "In another terminal" vs "Keep the gateway running"
framing). This explicit merge commit ties the branch to main's
history.
Self-hosted.md conflict resolved by taking OUR side — the branch's
edits already contain main's substantive changes (capital A,
first-time-build paragraph) plus this PR's additions (glossary
link, keep-running framing, YOUR_ADMIN_KEY note, config.yaml
location anchor).
The auto-merge of first-model-first-key-first-request.md duplicated
the :::warning callout that was already integrated via the squash
commit; removed the duplicate.
moonming pushed a commit that referenced this pull request May 22, 2026
@jarvis9443
jarvis9443 deleted the docs/issue-347-configuration-reference-corrections branch June 25, 2026 06:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationpriority-normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Configuration reference corrections across admin-api, api-keys, caching, and models pages

3 participants

@janiussyafiq@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages - #348

Merged
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections
May 19, 2026
Merged

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages#348
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections

Conversation

@janiussyafiq

@janiussyafiqjaniussyafiq commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes#347. Five surgical corrections to the configuration-reference cluster:

  1. admin-api.md:76 — group label "health" → "livez". /livez is the public route; /admin/v1/health requires admin auth.
  2. api-keys.md:86 — rotate response example: 16-char key suffix replaced with a 32-char suffix matching what callers actually receive (Uuid::new_v4().as_simple() produces 32 hex chars).
  3. caching.md — explicit note that CachePolicy.backend is parsed and stored on each row but not consulted by any runtime consumer; the proxy uses the bootstrap-config (cache.backend) instead.
  4. models.md:80background_model_check.ignore_statuses default: Vec<u16> with #[serde(default)] resolves to Vec::new(), not [408, 429]. Re-presented [408, 429] as a recommended explicit setting.
  5. models.md:163Model.cost consumer split: AISIX Cloud's cp-api recomputes cost server-side; the standalone OSS proxy hard-codes cost_usd = 0.0 and does not consult the field.

Doc-only diff. No code, schemas, configs, or test fixtures touched.

Changes

FileChange
docs/configuration/admin-api.mdGroup label on line 76 changed from "public operator helpers: health, metrics, and OpenAPI discovery" to "public operator helpers: livez, metrics, and OpenAPI discovery".
docs/configuration/api-keys.mdRotate response example on line 86: sk-abcd1234ef567890 (16 hex) replaced with sk-550e8400e29b41d4a716446655440000 (32 hex) to match Uuid::new_v4().as_simple() output.
docs/configuration/caching.mdAdded a one-paragraph note after the CachePolicy.backend-conservative bullet (line 83) explicitly stating the field is parsed but not consulted by the runtime proxy, that the runtime backend selection comes from bootstrap-config (cache.backend), and that the field is preserved for forward compatibility.
docs/configuration/models.mdBullet on line 80 rewritten: removed the misleading [408, 429] default claim and stated that without an explicit value no probe statuses are ignored, then re-presented [408, 429] as a recommended explicit setting with the operational rationale (tolerates transient 408/429 during probes).
docs/configuration/models.mdBullet on line 163 rewritten: Model.cost description now makes the substrate split explicit — AISIX Cloud's cp-api consumes the field; the standalone OSS proxy does not consult it at request time and emits cost_usd=0.0; pricing-aware budget enforcement requires the Cloud control plane.

Net diff: 4 files, +6 / -4. Source: git diff --stat.

Test plan

Doc-only diff — no .rs files, schemas, configs, or test fixtures touched. The cargo trio was still run end-to-end as the canonical pre-merge gate. The first cargo test --workspace invocation OOMed under default parallelism (this VPS has 8 GB and the workspace compiles 30+ crate test binaries); re-ran with cargo test --workspace -j 2 (and CARGO_BUILD_JOBS=2) to cap compile concurrency — all suites green.

  • cargo fmt --check — PASS (exit 0).
  • cargo clippy --workspace --all-targets -- -D warnings — PASS (exit 0, 18.30s, no warnings).
  • cargo test --workspace -j 2 — PASS (exit 0, 33 suites all green; 1067 tests passed, 0 failed, 3 ignored).
  • grep -rln <each affected page> tests/e2e/ for all 4 pages returns empty. pnpm test under tests/e2e/ is not applicable for this diff.

cargo clippy tail

 Checking aisix-provider-azure-openai v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-provider-azure-openai)
Checking aisix-proxy v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-proxy)
Checking aisix-admin v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-admin)
Checking aisix-server v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-server)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.30s

cargo test summary

33 test-suite-result lines, all 'ok'. Aggregate: 1067 tests passed, 0 failed, 3 ignored across the workspace (unit suites + doc-tests). Tally is higher than the post-#338 baseline (1041) because PRs #341/#343/#345/#346 added test coverage for new Provider variants, Hub registrations, the OpenAI-adapter long-tail providers, and the Anthropic-shape error envelope on /v1/messages.

Affected pages

  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

Pre-merge-check verification log

Issue #347 called out three pre-merge checks. All three resolved as follows:

  1. ignore_statuses default re-verified at PR-time HEAD. Field declaration on origin/main at 71ea97e is at crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160 cited in the issue body — file reorganization between audit-window and PR-window; substance unchanged). Declaration is verbatim: #[serde(default, skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>. No custom default = "..." attribute, so the #[serde(default)] resolves to <Vec<u16> as Default>::default() = Vec::new(). Consumer at crates/aisix-proxy/src/background.rs:84,88 is unchanged: cfg.ignore_statuses.contains(&status) against the empty default, so the silent-failure mode is exactly as documented.
  2. Model.cost hard-code re-verified at PR-time HEAD.crates/aisix-proxy/src/chat.rs:989 still reads let cost_usd = 0.0;, preceded by the explanatory comment at :987-988: "cp-api recomputes cost server-side from its pricing catalog when ingesting telemetry; the DP just records 0.0 on the wire." The chat.rs file also hard-codes cost_usd: 0.0 at four additional call sites (:242, :648, :699, :832), confirming the pattern is workspace-wide, not just at one site. No Model.cost field read site exists in crates/aisix-proxy/.
  3. All 5 anchors re-grep'd against current HEAD. No consumer landed between the issue's audit window (71ea97e) and PR open (also 71ea97e):
    • /livez route mount on crates/aisix-admin/src/lib.rs:67
    • /admin/v1/health admin-scoped mount on crates/aisix-admin/src/lib.rs:145
    • Uuid::new_v4().as_simple() for rotate plaintext on crates/aisix-admin/src/apikeys_handlers.rs:168
    • Zero hits for entry.value.backend / policy.backend / cache_policy.backend consumers in crates/
    • cfg.ignore_statuses.contains(...) consumer on crates/aisix-proxy/src/background.rs:84,88
    • let cost_usd = 0.0; hard-code on crates/aisix-proxy/src/chat.rs:989

Model.cost example placeholder note

The 32-char replacement plaintext in the rotate example is sk-550e8400e29b41d4a716446655440000. The 32-hex segment is the canonical "all-zeros after the variant byte" UUID example value used as a placeholder across many published examples; it is structurally identical to a real Uuid::new_v4().as_simple() output (no hyphens, 32 hex chars) without being a copy of any real generated key.

Coexistence with PR #326 and PR #344

This PR's affected pages (admin-api.md, api-keys.md, caching.md, models.md) do not overlap with PR #326 or PR #344's affected files (which cover the overview / quickstart / bootstrap-config cluster). No git merge-tree collision check needed — disjoint file sets.

References

Summary by CodeRabbit

Documentation

  • Clarified public operator helper routes listed in admin API documentation
  • Updated API key rotation example in configuration guide
  • Added cache backend behavior clarification explaining runtime configuration precedence
  • Enhanced model configuration documentation with health check status handling and cost calculation details

Review Change Stack

…api-keys, caching, and models pages
Closes#347.
Five corrections, each anchored to a runtime consumer (or non-consumer)
verified on `origin/main` at `71ea97e`. The cluster mirrors the
consumer-trace discipline locked in by #326 / #344: for every behavioral
claim, verify the runtime consumer actually reads the documented value,
rather than only verifying the field exists with a default.
- admin-api.md:76 — group label "health" → "livez". The public route
is `/livez` (registered at crates/aisix-admin/src/lib.rs:67); the
`/admin/v1/health` endpoint requires admin auth (registered at :145).
- api-keys.md:86 — rotate response example: 16-char suffix replaced
with a 32-char suffix. Rotate handler at
crates/aisix-admin/src/apikeys_handlers.rs:168 uses
`Uuid::new_v4().as_simple()`, which produces 32 hex chars.
- caching.md — explicit note that `CachePolicy.backend` is parsed and
stored on each row but not consulted at runtime. No consumer of
`entry.value.backend` / `policy.backend` / `cache_policy.backend`
exists in `crates/`. The proxy uses the bootstrap-config
(`cache.backend`) instead.
- models.md:80 — `ignore_statuses` default. Field at
crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160
cited in the issue body) is declared `#[serde(default,
skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>`,
so the actual default is the empty vector — not `[408, 429]` as the
doc claimed. Re-presented `[408, 429]` as a recommended explicit
setting. Consumer at crates/aisix-proxy/src/background.rs:84,88 calls
`cfg.ignore_statuses.contains(...)` against the empty default.
- models.md:163 — `Model.cost` consumer split. Standalone OSS proxy
hard-codes `cost_usd = 0.0` at crates/aisix-proxy/src/chat.rs:989
(with comment "cp-api recomputes cost server-side from its pricing
catalog"). The `Model.cost` field is consumed by AISIX Cloud's
cp-api, not by the OSS proxy.
CopilotAI review requested due to automatic review settings May 18, 2026 20:51
@janiussyafiqjaniussyafiq added documentation Improvements or additions to documentation priority-normal labels May 18, 2026
@coderabbitai

coderabbitaiBot commented May 18, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 61d60a44-4de1-4072-a5cb-3a69eb7bf787

📥 Commits

Reviewing files that changed from the base of the PR and between 71ea97e and 11d58e5.

📒 Files selected for processing (4)
  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

📝 Walkthrough

Walkthrough

This PR updates four configuration documentation files to clarify operator-facing behavior: public API routes, API key examples, cache backend runtime semantics, and model health check and pricing behavior for both AISIX Cloud and OSS deployments.

Changes

Configuration Documentation Clarifications

Layer / File(s)Summary
Operator and API credential documentation
docs/configuration/admin-api.md, docs/configuration/api-keys.md
Admin API public operator helper routes are clarified to include livez, metrics, and OpenAPI discovery (removing health). API key rotation example is updated with a new sample plaintext token.
Cache and model configuration semantics
docs/configuration/caching.md, docs/configuration/models.md
CachePolicy.backend field is clarified as parsed but not used by the runtime proxy; runtime backend selection is driven by bootstrap configuration only. Model health check ignore_statuses behavior is clarified: omission means no statuses are ignored. Cost field semantics are updated to distinguish AISIX Cloud server-side recomputation from OSS proxy zero-cost behavior and AISIX Cloud control plane dependency.

🎯 1 (Trivial) | ⏱️ ~3 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This doc-only PR corrects several inaccuracies in the configuration reference docs to better reflect actual runtime behavior and response shapes across the admin API, API keys, caching, and models documentation.

Changes:

  • Rename the public operator helper label from health to livez to reflect the unauthenticated /livez route.
  • Update the API key rotation example to show a 32-hex UUID suffix consistent with Uuid::new_v4().as_simple().
  • Clarify runtime boundaries for CachePolicy.backend, background_model_check.ignore_statuses defaults, and Model.cost consumption.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
docs/configuration/admin-api.mdCorrects the public helper group label to livez.
docs/configuration/api-keys.mdFixes rotate response example to show a 32-char key suffix.
docs/configuration/caching.mdAdds an explicit note that CachePolicy.backend is currently parsed but not consulted by the proxy runtime.
docs/configuration/models.mdCorrects ignore_statuses default behavior and clarifies cost handling expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -160,7 +160,7 @@ curl -sS -X POST http://127.0.0.1:3001/admin/v1/models \
- `provider` currently supports `openai`, `anthropic`, `google`, `deepseek`, `cohere`, and `jina`.
@moonming
moonming merged commit 2c1d485 into mainMay 19, 2026
11 checks passed
janiussyafiq added a commit that referenced this pull request May 20, 2026
Integrate origin/main (commit 2c1d485 = post-PR-#326 / #348 plus
#330 / #341 / #343 / #345 / #346) into this branch via `git merge
--squash` to clear PR #344's lingering `mergeable: dirty` state.
Conflict on `docs/quickstart/self-hosted.md` was a 3-way-merge-base
artifact: base (3596c0a) read `- a reachable etcd instance`, main
changed `a` → `A` (via #326), this branch additionally inserted the
glossary link. Both changes are wanted; resolution per Umar's
approved plan was `git checkout --ours`, which preserves the branch's
self-hosted.md state (already integrates capital A + glossary link
+ first-time-build paragraph + keep-running framing). Other 4
overlapping doc files auto-merged cleanly (`bootstrap-config.md`,
`core-concepts.md`, `first-model-first-key-first-request.md`,
`openai-sdk.md`). Code files all auto-merged cleanly.
Additional Copilot review (post-`167196a` cycle) addressed:
- `docs/index.md:7` — change link display text from `[data-plane]`
to `[data plane]` to match the canonical glossary term. The URL
anchor `#data-plane` stays kebab-case (matches the glossary
heading's auto-anchor); only the display text changes. Comment
id 3271145422.
- `docs/quickstart/openai-sdk.md:43` — change `All three steps below`
to `All commands below`. The Install-the-SDK section has two
command blocks (mkdir+cd, npm install), not three; the prior
wording originated from a mental model (mkdir, cd, install)
that doesn't match the typographic count of code blocks under
the heading. Comment id 3271145458.
Copilot's third comment on `docs/overview/core-concepts.md`
Observability Exporter wording (id 3271145444) auto-resolves via
this merge — main's #326 rewrite supersedes the branch's pre-#326
wording at that location ("ships per-request span telemetry…
OTLP/HTTP-compatible backend…" replaces "Use this concept when
documenting…"). No separate edit needed; the merge IS the fix.
janiussyafiq added a commit that referenced this pull request May 20, 2026
…ickstart-polish
Resolve PR #344's lingering mergeable: dirty state by linking the
branch history to origin/main (2c1d485 = post-#326 / #348 / #330 /
#341 / #343 / #345 / #346).
The squash-merge commit landed earlier (e2af197) integrated main's
content into the branch tree but did not link the histories, so
GitHub's mergeable computation still saw the 3-way-merge-base
artifact conflict on docs/quickstart/self-hosted.md (a vs A + the
glossary link / "In another terminal" vs "Keep the gateway running"
framing). This explicit merge commit ties the branch to main's
history.
Self-hosted.md conflict resolved by taking OUR side — the branch's
edits already contain main's substantive changes (capital A,
first-time-build paragraph) plus this PR's additions (glossary
link, keep-running framing, YOUR_ADMIN_KEY note, config.yaml
location anchor).
The auto-merge of first-model-first-key-first-request.md duplicated
the :::warning callout that was already integrated via the squash
commit; removed the duplicate.
moonming pushed a commit that referenced this pull request May 22, 2026
@jarvis9443
jarvis9443 deleted the docs/issue-347-configuration-reference-corrections branch June 25, 2026 06:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationpriority-normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Configuration reference corrections across admin-api, api-keys, caching, and models pages

3 participants

@janiussyafiq@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages - #348

Merged
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections
May 19, 2026
Merged

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages#348
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections

Conversation

@janiussyafiq

@janiussyafiqjaniussyafiq commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes#347. Five surgical corrections to the configuration-reference cluster:

  1. admin-api.md:76 — group label "health" → "livez". /livez is the public route; /admin/v1/health requires admin auth.
  2. api-keys.md:86 — rotate response example: 16-char key suffix replaced with a 32-char suffix matching what callers actually receive (Uuid::new_v4().as_simple() produces 32 hex chars).
  3. caching.md — explicit note that CachePolicy.backend is parsed and stored on each row but not consulted by any runtime consumer; the proxy uses the bootstrap-config (cache.backend) instead.
  4. models.md:80background_model_check.ignore_statuses default: Vec<u16> with #[serde(default)] resolves to Vec::new(), not [408, 429]. Re-presented [408, 429] as a recommended explicit setting.
  5. models.md:163Model.cost consumer split: AISIX Cloud's cp-api recomputes cost server-side; the standalone OSS proxy hard-codes cost_usd = 0.0 and does not consult the field.

Doc-only diff. No code, schemas, configs, or test fixtures touched.

Changes

FileChange
docs/configuration/admin-api.mdGroup label on line 76 changed from "public operator helpers: health, metrics, and OpenAPI discovery" to "public operator helpers: livez, metrics, and OpenAPI discovery".
docs/configuration/api-keys.mdRotate response example on line 86: sk-abcd1234ef567890 (16 hex) replaced with sk-550e8400e29b41d4a716446655440000 (32 hex) to match Uuid::new_v4().as_simple() output.
docs/configuration/caching.mdAdded a one-paragraph note after the CachePolicy.backend-conservative bullet (line 83) explicitly stating the field is parsed but not consulted by the runtime proxy, that the runtime backend selection comes from bootstrap-config (cache.backend), and that the field is preserved for forward compatibility.
docs/configuration/models.mdBullet on line 80 rewritten: removed the misleading [408, 429] default claim and stated that without an explicit value no probe statuses are ignored, then re-presented [408, 429] as a recommended explicit setting with the operational rationale (tolerates transient 408/429 during probes).
docs/configuration/models.mdBullet on line 163 rewritten: Model.cost description now makes the substrate split explicit — AISIX Cloud's cp-api consumes the field; the standalone OSS proxy does not consult it at request time and emits cost_usd=0.0; pricing-aware budget enforcement requires the Cloud control plane.

Net diff: 4 files, +6 / -4. Source: git diff --stat.

Test plan

Doc-only diff — no .rs files, schemas, configs, or test fixtures touched. The cargo trio was still run end-to-end as the canonical pre-merge gate. The first cargo test --workspace invocation OOMed under default parallelism (this VPS has 8 GB and the workspace compiles 30+ crate test binaries); re-ran with cargo test --workspace -j 2 (and CARGO_BUILD_JOBS=2) to cap compile concurrency — all suites green.

  • cargo fmt --check — PASS (exit 0).
  • cargo clippy --workspace --all-targets -- -D warnings — PASS (exit 0, 18.30s, no warnings).
  • cargo test --workspace -j 2 — PASS (exit 0, 33 suites all green; 1067 tests passed, 0 failed, 3 ignored).
  • grep -rln <each affected page> tests/e2e/ for all 4 pages returns empty. pnpm test under tests/e2e/ is not applicable for this diff.

cargo clippy tail

 Checking aisix-provider-azure-openai v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-provider-azure-openai)
Checking aisix-proxy v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-proxy)
Checking aisix-admin v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-admin)
Checking aisix-server v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-server)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.30s

cargo test summary

33 test-suite-result lines, all 'ok'. Aggregate: 1067 tests passed, 0 failed, 3 ignored across the workspace (unit suites + doc-tests). Tally is higher than the post-#338 baseline (1041) because PRs #341/#343/#345/#346 added test coverage for new Provider variants, Hub registrations, the OpenAI-adapter long-tail providers, and the Anthropic-shape error envelope on /v1/messages.

Affected pages

  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

Pre-merge-check verification log

Issue #347 called out three pre-merge checks. All three resolved as follows:

  1. ignore_statuses default re-verified at PR-time HEAD. Field declaration on origin/main at 71ea97e is at crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160 cited in the issue body — file reorganization between audit-window and PR-window; substance unchanged). Declaration is verbatim: #[serde(default, skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>. No custom default = "..." attribute, so the #[serde(default)] resolves to <Vec<u16> as Default>::default() = Vec::new(). Consumer at crates/aisix-proxy/src/background.rs:84,88 is unchanged: cfg.ignore_statuses.contains(&status) against the empty default, so the silent-failure mode is exactly as documented.
  2. Model.cost hard-code re-verified at PR-time HEAD.crates/aisix-proxy/src/chat.rs:989 still reads let cost_usd = 0.0;, preceded by the explanatory comment at :987-988: "cp-api recomputes cost server-side from its pricing catalog when ingesting telemetry; the DP just records 0.0 on the wire." The chat.rs file also hard-codes cost_usd: 0.0 at four additional call sites (:242, :648, :699, :832), confirming the pattern is workspace-wide, not just at one site. No Model.cost field read site exists in crates/aisix-proxy/.
  3. All 5 anchors re-grep'd against current HEAD. No consumer landed between the issue's audit window (71ea97e) and PR open (also 71ea97e):
    • /livez route mount on crates/aisix-admin/src/lib.rs:67
    • /admin/v1/health admin-scoped mount on crates/aisix-admin/src/lib.rs:145
    • Uuid::new_v4().as_simple() for rotate plaintext on crates/aisix-admin/src/apikeys_handlers.rs:168
    • Zero hits for entry.value.backend / policy.backend / cache_policy.backend consumers in crates/
    • cfg.ignore_statuses.contains(...) consumer on crates/aisix-proxy/src/background.rs:84,88
    • let cost_usd = 0.0; hard-code on crates/aisix-proxy/src/chat.rs:989

Model.cost example placeholder note

The 32-char replacement plaintext in the rotate example is sk-550e8400e29b41d4a716446655440000. The 32-hex segment is the canonical "all-zeros after the variant byte" UUID example value used as a placeholder across many published examples; it is structurally identical to a real Uuid::new_v4().as_simple() output (no hyphens, 32 hex chars) without being a copy of any real generated key.

Coexistence with PR #326 and PR #344

This PR's affected pages (admin-api.md, api-keys.md, caching.md, models.md) do not overlap with PR #326 or PR #344's affected files (which cover the overview / quickstart / bootstrap-config cluster). No git merge-tree collision check needed — disjoint file sets.

References

Summary by CodeRabbit

Documentation

  • Clarified public operator helper routes listed in admin API documentation
  • Updated API key rotation example in configuration guide
  • Added cache backend behavior clarification explaining runtime configuration precedence
  • Enhanced model configuration documentation with health check status handling and cost calculation details

Review Change Stack

…api-keys, caching, and models pages
Closes#347.
Five corrections, each anchored to a runtime consumer (or non-consumer)
verified on `origin/main` at `71ea97e`. The cluster mirrors the
consumer-trace discipline locked in by #326 / #344: for every behavioral
claim, verify the runtime consumer actually reads the documented value,
rather than only verifying the field exists with a default.
- admin-api.md:76 — group label "health" → "livez". The public route
is `/livez` (registered at crates/aisix-admin/src/lib.rs:67); the
`/admin/v1/health` endpoint requires admin auth (registered at :145).
- api-keys.md:86 — rotate response example: 16-char suffix replaced
with a 32-char suffix. Rotate handler at
crates/aisix-admin/src/apikeys_handlers.rs:168 uses
`Uuid::new_v4().as_simple()`, which produces 32 hex chars.
- caching.md — explicit note that `CachePolicy.backend` is parsed and
stored on each row but not consulted at runtime. No consumer of
`entry.value.backend` / `policy.backend` / `cache_policy.backend`
exists in `crates/`. The proxy uses the bootstrap-config
(`cache.backend`) instead.
- models.md:80 — `ignore_statuses` default. Field at
crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160
cited in the issue body) is declared `#[serde(default,
skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>`,
so the actual default is the empty vector — not `[408, 429]` as the
doc claimed. Re-presented `[408, 429]` as a recommended explicit
setting. Consumer at crates/aisix-proxy/src/background.rs:84,88 calls
`cfg.ignore_statuses.contains(...)` against the empty default.
- models.md:163 — `Model.cost` consumer split. Standalone OSS proxy
hard-codes `cost_usd = 0.0` at crates/aisix-proxy/src/chat.rs:989
(with comment "cp-api recomputes cost server-side from its pricing
catalog"). The `Model.cost` field is consumed by AISIX Cloud's
cp-api, not by the OSS proxy.
CopilotAI review requested due to automatic review settings May 18, 2026 20:51
@janiussyafiqjaniussyafiq added documentation Improvements or additions to documentation priority-normal labels May 18, 2026
@coderabbitai

coderabbitaiBot commented May 18, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 61d60a44-4de1-4072-a5cb-3a69eb7bf787

📥 Commits

Reviewing files that changed from the base of the PR and between 71ea97e and 11d58e5.

📒 Files selected for processing (4)
  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

📝 Walkthrough

Walkthrough

This PR updates four configuration documentation files to clarify operator-facing behavior: public API routes, API key examples, cache backend runtime semantics, and model health check and pricing behavior for both AISIX Cloud and OSS deployments.

Changes

Configuration Documentation Clarifications

Layer / File(s)Summary
Operator and API credential documentation
docs/configuration/admin-api.md, docs/configuration/api-keys.md
Admin API public operator helper routes are clarified to include livez, metrics, and OpenAPI discovery (removing health). API key rotation example is updated with a new sample plaintext token.
Cache and model configuration semantics
docs/configuration/caching.md, docs/configuration/models.md
CachePolicy.backend field is clarified as parsed but not used by the runtime proxy; runtime backend selection is driven by bootstrap configuration only. Model health check ignore_statuses behavior is clarified: omission means no statuses are ignored. Cost field semantics are updated to distinguish AISIX Cloud server-side recomputation from OSS proxy zero-cost behavior and AISIX Cloud control plane dependency.

🎯 1 (Trivial) | ⏱️ ~3 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This doc-only PR corrects several inaccuracies in the configuration reference docs to better reflect actual runtime behavior and response shapes across the admin API, API keys, caching, and models documentation.

Changes:

  • Rename the public operator helper label from health to livez to reflect the unauthenticated /livez route.
  • Update the API key rotation example to show a 32-hex UUID suffix consistent with Uuid::new_v4().as_simple().
  • Clarify runtime boundaries for CachePolicy.backend, background_model_check.ignore_statuses defaults, and Model.cost consumption.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
docs/configuration/admin-api.mdCorrects the public helper group label to livez.
docs/configuration/api-keys.mdFixes rotate response example to show a 32-char key suffix.
docs/configuration/caching.mdAdds an explicit note that CachePolicy.backend is currently parsed but not consulted by the proxy runtime.
docs/configuration/models.mdCorrects ignore_statuses default behavior and clarifies cost handling expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -160,7 +160,7 @@ curl -sS -X POST http://127.0.0.1:3001/admin/v1/models \
- `provider` currently supports `openai`, `anthropic`, `google`, `deepseek`, `cohere`, and `jina`.
@moonming
moonming merged commit 2c1d485 into mainMay 19, 2026
11 checks passed
janiussyafiq added a commit that referenced this pull request May 20, 2026
Integrate origin/main (commit 2c1d485 = post-PR-#326 / #348 plus
#330 / #341 / #343 / #345 / #346) into this branch via `git merge
--squash` to clear PR #344's lingering `mergeable: dirty` state.
Conflict on `docs/quickstart/self-hosted.md` was a 3-way-merge-base
artifact: base (3596c0a) read `- a reachable etcd instance`, main
changed `a` → `A` (via #326), this branch additionally inserted the
glossary link. Both changes are wanted; resolution per Umar's
approved plan was `git checkout --ours`, which preserves the branch's
self-hosted.md state (already integrates capital A + glossary link
+ first-time-build paragraph + keep-running framing). Other 4
overlapping doc files auto-merged cleanly (`bootstrap-config.md`,
`core-concepts.md`, `first-model-first-key-first-request.md`,
`openai-sdk.md`). Code files all auto-merged cleanly.
Additional Copilot review (post-`167196a` cycle) addressed:
- `docs/index.md:7` — change link display text from `[data-plane]`
to `[data plane]` to match the canonical glossary term. The URL
anchor `#data-plane` stays kebab-case (matches the glossary
heading's auto-anchor); only the display text changes. Comment
id 3271145422.
- `docs/quickstart/openai-sdk.md:43` — change `All three steps below`
to `All commands below`. The Install-the-SDK section has two
command blocks (mkdir+cd, npm install), not three; the prior
wording originated from a mental model (mkdir, cd, install)
that doesn't match the typographic count of code blocks under
the heading. Comment id 3271145458.
Copilot's third comment on `docs/overview/core-concepts.md`
Observability Exporter wording (id 3271145444) auto-resolves via
this merge — main's #326 rewrite supersedes the branch's pre-#326
wording at that location ("ships per-request span telemetry…
OTLP/HTTP-compatible backend…" replaces "Use this concept when
documenting…"). No separate edit needed; the merge IS the fix.
janiussyafiq added a commit that referenced this pull request May 20, 2026
…ickstart-polish
Resolve PR #344's lingering mergeable: dirty state by linking the
branch history to origin/main (2c1d485 = post-#326 / #348 / #330 /
#341 / #343 / #345 / #346).
The squash-merge commit landed earlier (e2af197) integrated main's
content into the branch tree but did not link the histories, so
GitHub's mergeable computation still saw the 3-way-merge-base
artifact conflict on docs/quickstart/self-hosted.md (a vs A + the
glossary link / "In another terminal" vs "Keep the gateway running"
framing). This explicit merge commit ties the branch to main's
history.
Self-hosted.md conflict resolved by taking OUR side — the branch's
edits already contain main's substantive changes (capital A,
first-time-build paragraph) plus this PR's additions (glossary
link, keep-running framing, YOUR_ADMIN_KEY note, config.yaml
location anchor).
The auto-merge of first-model-first-key-first-request.md duplicated
the :::warning callout that was already integrated via the squash
commit; removed the duplicate.
moonming pushed a commit that referenced this pull request May 22, 2026
@jarvis9443
jarvis9443 deleted the docs/issue-347-configuration-reference-corrections branch June 25, 2026 06:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationpriority-normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Configuration reference corrections across admin-api, api-keys, caching, and models pages

3 participants

@janiussyafiq@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages - #348

Merged
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections
May 19, 2026
Merged

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages#348
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections

Conversation

@janiussyafiq

@janiussyafiqjaniussyafiq commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes#347. Five surgical corrections to the configuration-reference cluster:

  1. admin-api.md:76 — group label "health" → "livez". /livez is the public route; /admin/v1/health requires admin auth.
  2. api-keys.md:86 — rotate response example: 16-char key suffix replaced with a 32-char suffix matching what callers actually receive (Uuid::new_v4().as_simple() produces 32 hex chars).
  3. caching.md — explicit note that CachePolicy.backend is parsed and stored on each row but not consulted by any runtime consumer; the proxy uses the bootstrap-config (cache.backend) instead.
  4. models.md:80background_model_check.ignore_statuses default: Vec<u16> with #[serde(default)] resolves to Vec::new(), not [408, 429]. Re-presented [408, 429] as a recommended explicit setting.
  5. models.md:163Model.cost consumer split: AISIX Cloud's cp-api recomputes cost server-side; the standalone OSS proxy hard-codes cost_usd = 0.0 and does not consult the field.

Doc-only diff. No code, schemas, configs, or test fixtures touched.

Changes

FileChange
docs/configuration/admin-api.mdGroup label on line 76 changed from "public operator helpers: health, metrics, and OpenAPI discovery" to "public operator helpers: livez, metrics, and OpenAPI discovery".
docs/configuration/api-keys.mdRotate response example on line 86: sk-abcd1234ef567890 (16 hex) replaced with sk-550e8400e29b41d4a716446655440000 (32 hex) to match Uuid::new_v4().as_simple() output.
docs/configuration/caching.mdAdded a one-paragraph note after the CachePolicy.backend-conservative bullet (line 83) explicitly stating the field is parsed but not consulted by the runtime proxy, that the runtime backend selection comes from bootstrap-config (cache.backend), and that the field is preserved for forward compatibility.
docs/configuration/models.mdBullet on line 80 rewritten: removed the misleading [408, 429] default claim and stated that without an explicit value no probe statuses are ignored, then re-presented [408, 429] as a recommended explicit setting with the operational rationale (tolerates transient 408/429 during probes).
docs/configuration/models.mdBullet on line 163 rewritten: Model.cost description now makes the substrate split explicit — AISIX Cloud's cp-api consumes the field; the standalone OSS proxy does not consult it at request time and emits cost_usd=0.0; pricing-aware budget enforcement requires the Cloud control plane.

Net diff: 4 files, +6 / -4. Source: git diff --stat.

Test plan

Doc-only diff — no .rs files, schemas, configs, or test fixtures touched. The cargo trio was still run end-to-end as the canonical pre-merge gate. The first cargo test --workspace invocation OOMed under default parallelism (this VPS has 8 GB and the workspace compiles 30+ crate test binaries); re-ran with cargo test --workspace -j 2 (and CARGO_BUILD_JOBS=2) to cap compile concurrency — all suites green.

  • cargo fmt --check — PASS (exit 0).
  • cargo clippy --workspace --all-targets -- -D warnings — PASS (exit 0, 18.30s, no warnings).
  • cargo test --workspace -j 2 — PASS (exit 0, 33 suites all green; 1067 tests passed, 0 failed, 3 ignored).
  • grep -rln <each affected page> tests/e2e/ for all 4 pages returns empty. pnpm test under tests/e2e/ is not applicable for this diff.

cargo clippy tail

 Checking aisix-provider-azure-openai v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-provider-azure-openai)
Checking aisix-proxy v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-proxy)
Checking aisix-admin v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-admin)
Checking aisix-server v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-server)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.30s

cargo test summary

33 test-suite-result lines, all 'ok'. Aggregate: 1067 tests passed, 0 failed, 3 ignored across the workspace (unit suites + doc-tests). Tally is higher than the post-#338 baseline (1041) because PRs #341/#343/#345/#346 added test coverage for new Provider variants, Hub registrations, the OpenAI-adapter long-tail providers, and the Anthropic-shape error envelope on /v1/messages.

Affected pages

  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

Pre-merge-check verification log

Issue #347 called out three pre-merge checks. All three resolved as follows:

  1. ignore_statuses default re-verified at PR-time HEAD. Field declaration on origin/main at 71ea97e is at crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160 cited in the issue body — file reorganization between audit-window and PR-window; substance unchanged). Declaration is verbatim: #[serde(default, skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>. No custom default = "..." attribute, so the #[serde(default)] resolves to <Vec<u16> as Default>::default() = Vec::new(). Consumer at crates/aisix-proxy/src/background.rs:84,88 is unchanged: cfg.ignore_statuses.contains(&status) against the empty default, so the silent-failure mode is exactly as documented.
  2. Model.cost hard-code re-verified at PR-time HEAD.crates/aisix-proxy/src/chat.rs:989 still reads let cost_usd = 0.0;, preceded by the explanatory comment at :987-988: "cp-api recomputes cost server-side from its pricing catalog when ingesting telemetry; the DP just records 0.0 on the wire." The chat.rs file also hard-codes cost_usd: 0.0 at four additional call sites (:242, :648, :699, :832), confirming the pattern is workspace-wide, not just at one site. No Model.cost field read site exists in crates/aisix-proxy/.
  3. All 5 anchors re-grep'd against current HEAD. No consumer landed between the issue's audit window (71ea97e) and PR open (also 71ea97e):
    • /livez route mount on crates/aisix-admin/src/lib.rs:67
    • /admin/v1/health admin-scoped mount on crates/aisix-admin/src/lib.rs:145
    • Uuid::new_v4().as_simple() for rotate plaintext on crates/aisix-admin/src/apikeys_handlers.rs:168
    • Zero hits for entry.value.backend / policy.backend / cache_policy.backend consumers in crates/
    • cfg.ignore_statuses.contains(...) consumer on crates/aisix-proxy/src/background.rs:84,88
    • let cost_usd = 0.0; hard-code on crates/aisix-proxy/src/chat.rs:989

Model.cost example placeholder note

The 32-char replacement plaintext in the rotate example is sk-550e8400e29b41d4a716446655440000. The 32-hex segment is the canonical "all-zeros after the variant byte" UUID example value used as a placeholder across many published examples; it is structurally identical to a real Uuid::new_v4().as_simple() output (no hyphens, 32 hex chars) without being a copy of any real generated key.

Coexistence with PR #326 and PR #344

This PR's affected pages (admin-api.md, api-keys.md, caching.md, models.md) do not overlap with PR #326 or PR #344's affected files (which cover the overview / quickstart / bootstrap-config cluster). No git merge-tree collision check needed — disjoint file sets.

References

Summary by CodeRabbit

Documentation

  • Clarified public operator helper routes listed in admin API documentation
  • Updated API key rotation example in configuration guide
  • Added cache backend behavior clarification explaining runtime configuration precedence
  • Enhanced model configuration documentation with health check status handling and cost calculation details

Review Change Stack

…api-keys, caching, and models pages
Closes#347.
Five corrections, each anchored to a runtime consumer (or non-consumer)
verified on `origin/main` at `71ea97e`. The cluster mirrors the
consumer-trace discipline locked in by #326 / #344: for every behavioral
claim, verify the runtime consumer actually reads the documented value,
rather than only verifying the field exists with a default.
- admin-api.md:76 — group label "health" → "livez". The public route
is `/livez` (registered at crates/aisix-admin/src/lib.rs:67); the
`/admin/v1/health` endpoint requires admin auth (registered at :145).
- api-keys.md:86 — rotate response example: 16-char suffix replaced
with a 32-char suffix. Rotate handler at
crates/aisix-admin/src/apikeys_handlers.rs:168 uses
`Uuid::new_v4().as_simple()`, which produces 32 hex chars.
- caching.md — explicit note that `CachePolicy.backend` is parsed and
stored on each row but not consulted at runtime. No consumer of
`entry.value.backend` / `policy.backend` / `cache_policy.backend`
exists in `crates/`. The proxy uses the bootstrap-config
(`cache.backend`) instead.
- models.md:80 — `ignore_statuses` default. Field at
crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160
cited in the issue body) is declared `#[serde(default,
skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>`,
so the actual default is the empty vector — not `[408, 429]` as the
doc claimed. Re-presented `[408, 429]` as a recommended explicit
setting. Consumer at crates/aisix-proxy/src/background.rs:84,88 calls
`cfg.ignore_statuses.contains(...)` against the empty default.
- models.md:163 — `Model.cost` consumer split. Standalone OSS proxy
hard-codes `cost_usd = 0.0` at crates/aisix-proxy/src/chat.rs:989
(with comment "cp-api recomputes cost server-side from its pricing
catalog"). The `Model.cost` field is consumed by AISIX Cloud's
cp-api, not by the OSS proxy.
CopilotAI review requested due to automatic review settings May 18, 2026 20:51
@janiussyafiqjaniussyafiq added documentation Improvements or additions to documentation priority-normal labels May 18, 2026
@coderabbitai

coderabbitaiBot commented May 18, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 61d60a44-4de1-4072-a5cb-3a69eb7bf787

📥 Commits

Reviewing files that changed from the base of the PR and between 71ea97e and 11d58e5.

📒 Files selected for processing (4)
  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

📝 Walkthrough

Walkthrough

This PR updates four configuration documentation files to clarify operator-facing behavior: public API routes, API key examples, cache backend runtime semantics, and model health check and pricing behavior for both AISIX Cloud and OSS deployments.

Changes

Configuration Documentation Clarifications

Layer / File(s)Summary
Operator and API credential documentation
docs/configuration/admin-api.md, docs/configuration/api-keys.md
Admin API public operator helper routes are clarified to include livez, metrics, and OpenAPI discovery (removing health). API key rotation example is updated with a new sample plaintext token.
Cache and model configuration semantics
docs/configuration/caching.md, docs/configuration/models.md
CachePolicy.backend field is clarified as parsed but not used by the runtime proxy; runtime backend selection is driven by bootstrap configuration only. Model health check ignore_statuses behavior is clarified: omission means no statuses are ignored. Cost field semantics are updated to distinguish AISIX Cloud server-side recomputation from OSS proxy zero-cost behavior and AISIX Cloud control plane dependency.

🎯 1 (Trivial) | ⏱️ ~3 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This doc-only PR corrects several inaccuracies in the configuration reference docs to better reflect actual runtime behavior and response shapes across the admin API, API keys, caching, and models documentation.

Changes:

  • Rename the public operator helper label from health to livez to reflect the unauthenticated /livez route.
  • Update the API key rotation example to show a 32-hex UUID suffix consistent with Uuid::new_v4().as_simple().
  • Clarify runtime boundaries for CachePolicy.backend, background_model_check.ignore_statuses defaults, and Model.cost consumption.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
docs/configuration/admin-api.mdCorrects the public helper group label to livez.
docs/configuration/api-keys.mdFixes rotate response example to show a 32-char key suffix.
docs/configuration/caching.mdAdds an explicit note that CachePolicy.backend is currently parsed but not consulted by the proxy runtime.
docs/configuration/models.mdCorrects ignore_statuses default behavior and clarifies cost handling expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -160,7 +160,7 @@ curl -sS -X POST http://127.0.0.1:3001/admin/v1/models \
- `provider` currently supports `openai`, `anthropic`, `google`, `deepseek`, `cohere`, and `jina`.
@moonming
moonming merged commit 2c1d485 into mainMay 19, 2026
11 checks passed
janiussyafiq added a commit that referenced this pull request May 20, 2026
Integrate origin/main (commit 2c1d485 = post-PR-#326 / #348 plus
#330 / #341 / #343 / #345 / #346) into this branch via `git merge
--squash` to clear PR #344's lingering `mergeable: dirty` state.
Conflict on `docs/quickstart/self-hosted.md` was a 3-way-merge-base
artifact: base (3596c0a) read `- a reachable etcd instance`, main
changed `a` → `A` (via #326), this branch additionally inserted the
glossary link. Both changes are wanted; resolution per Umar's
approved plan was `git checkout --ours`, which preserves the branch's
self-hosted.md state (already integrates capital A + glossary link
+ first-time-build paragraph + keep-running framing). Other 4
overlapping doc files auto-merged cleanly (`bootstrap-config.md`,
`core-concepts.md`, `first-model-first-key-first-request.md`,
`openai-sdk.md`). Code files all auto-merged cleanly.
Additional Copilot review (post-`167196a` cycle) addressed:
- `docs/index.md:7` — change link display text from `[data-plane]`
to `[data plane]` to match the canonical glossary term. The URL
anchor `#data-plane` stays kebab-case (matches the glossary
heading's auto-anchor); only the display text changes. Comment
id 3271145422.
- `docs/quickstart/openai-sdk.md:43` — change `All three steps below`
to `All commands below`. The Install-the-SDK section has two
command blocks (mkdir+cd, npm install), not three; the prior
wording originated from a mental model (mkdir, cd, install)
that doesn't match the typographic count of code blocks under
the heading. Comment id 3271145458.
Copilot's third comment on `docs/overview/core-concepts.md`
Observability Exporter wording (id 3271145444) auto-resolves via
this merge — main's #326 rewrite supersedes the branch's pre-#326
wording at that location ("ships per-request span telemetry…
OTLP/HTTP-compatible backend…" replaces "Use this concept when
documenting…"). No separate edit needed; the merge IS the fix.
janiussyafiq added a commit that referenced this pull request May 20, 2026
…ickstart-polish
Resolve PR #344's lingering mergeable: dirty state by linking the
branch history to origin/main (2c1d485 = post-#326 / #348 / #330 /
#341 / #343 / #345 / #346).
The squash-merge commit landed earlier (e2af197) integrated main's
content into the branch tree but did not link the histories, so
GitHub's mergeable computation still saw the 3-way-merge-base
artifact conflict on docs/quickstart/self-hosted.md (a vs A + the
glossary link / "In another terminal" vs "Keep the gateway running"
framing). This explicit merge commit ties the branch to main's
history.
Self-hosted.md conflict resolved by taking OUR side — the branch's
edits already contain main's substantive changes (capital A,
first-time-build paragraph) plus this PR's additions (glossary
link, keep-running framing, YOUR_ADMIN_KEY note, config.yaml
location anchor).
The auto-merge of first-model-first-key-first-request.md duplicated
the :::warning callout that was already integrated via the squash
commit; removed the duplicate.
moonming pushed a commit that referenced this pull request May 22, 2026
@jarvis9443
jarvis9443 deleted the docs/issue-347-configuration-reference-corrections branch June 25, 2026 06:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationpriority-normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Configuration reference corrections across admin-api, api-keys, caching, and models pages

3 participants

@janiussyafiq@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages - #348

Merged
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections
May 19, 2026
Merged

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages#348
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections

Conversation

@janiussyafiq

@janiussyafiqjaniussyafiq commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes#347. Five surgical corrections to the configuration-reference cluster:

  1. admin-api.md:76 — group label "health" → "livez". /livez is the public route; /admin/v1/health requires admin auth.
  2. api-keys.md:86 — rotate response example: 16-char key suffix replaced with a 32-char suffix matching what callers actually receive (Uuid::new_v4().as_simple() produces 32 hex chars).
  3. caching.md — explicit note that CachePolicy.backend is parsed and stored on each row but not consulted by any runtime consumer; the proxy uses the bootstrap-config (cache.backend) instead.
  4. models.md:80background_model_check.ignore_statuses default: Vec<u16> with #[serde(default)] resolves to Vec::new(), not [408, 429]. Re-presented [408, 429] as a recommended explicit setting.
  5. models.md:163Model.cost consumer split: AISIX Cloud's cp-api recomputes cost server-side; the standalone OSS proxy hard-codes cost_usd = 0.0 and does not consult the field.

Doc-only diff. No code, schemas, configs, or test fixtures touched.

Changes

FileChange
docs/configuration/admin-api.mdGroup label on line 76 changed from "public operator helpers: health, metrics, and OpenAPI discovery" to "public operator helpers: livez, metrics, and OpenAPI discovery".
docs/configuration/api-keys.mdRotate response example on line 86: sk-abcd1234ef567890 (16 hex) replaced with sk-550e8400e29b41d4a716446655440000 (32 hex) to match Uuid::new_v4().as_simple() output.
docs/configuration/caching.mdAdded a one-paragraph note after the CachePolicy.backend-conservative bullet (line 83) explicitly stating the field is parsed but not consulted by the runtime proxy, that the runtime backend selection comes from bootstrap-config (cache.backend), and that the field is preserved for forward compatibility.
docs/configuration/models.mdBullet on line 80 rewritten: removed the misleading [408, 429] default claim and stated that without an explicit value no probe statuses are ignored, then re-presented [408, 429] as a recommended explicit setting with the operational rationale (tolerates transient 408/429 during probes).
docs/configuration/models.mdBullet on line 163 rewritten: Model.cost description now makes the substrate split explicit — AISIX Cloud's cp-api consumes the field; the standalone OSS proxy does not consult it at request time and emits cost_usd=0.0; pricing-aware budget enforcement requires the Cloud control plane.

Net diff: 4 files, +6 / -4. Source: git diff --stat.

Test plan

Doc-only diff — no .rs files, schemas, configs, or test fixtures touched. The cargo trio was still run end-to-end as the canonical pre-merge gate. The first cargo test --workspace invocation OOMed under default parallelism (this VPS has 8 GB and the workspace compiles 30+ crate test binaries); re-ran with cargo test --workspace -j 2 (and CARGO_BUILD_JOBS=2) to cap compile concurrency — all suites green.

  • cargo fmt --check — PASS (exit 0).
  • cargo clippy --workspace --all-targets -- -D warnings — PASS (exit 0, 18.30s, no warnings).
  • cargo test --workspace -j 2 — PASS (exit 0, 33 suites all green; 1067 tests passed, 0 failed, 3 ignored).
  • grep -rln <each affected page> tests/e2e/ for all 4 pages returns empty. pnpm test under tests/e2e/ is not applicable for this diff.

cargo clippy tail

 Checking aisix-provider-azure-openai v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-provider-azure-openai)
Checking aisix-proxy v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-proxy)
Checking aisix-admin v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-admin)
Checking aisix-server v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-server)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.30s

cargo test summary

33 test-suite-result lines, all 'ok'. Aggregate: 1067 tests passed, 0 failed, 3 ignored across the workspace (unit suites + doc-tests). Tally is higher than the post-#338 baseline (1041) because PRs #341/#343/#345/#346 added test coverage for new Provider variants, Hub registrations, the OpenAI-adapter long-tail providers, and the Anthropic-shape error envelope on /v1/messages.

Affected pages

  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

Pre-merge-check verification log

Issue #347 called out three pre-merge checks. All three resolved as follows:

  1. ignore_statuses default re-verified at PR-time HEAD. Field declaration on origin/main at 71ea97e is at crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160 cited in the issue body — file reorganization between audit-window and PR-window; substance unchanged). Declaration is verbatim: #[serde(default, skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>. No custom default = "..." attribute, so the #[serde(default)] resolves to <Vec<u16> as Default>::default() = Vec::new(). Consumer at crates/aisix-proxy/src/background.rs:84,88 is unchanged: cfg.ignore_statuses.contains(&status) against the empty default, so the silent-failure mode is exactly as documented.
  2. Model.cost hard-code re-verified at PR-time HEAD.crates/aisix-proxy/src/chat.rs:989 still reads let cost_usd = 0.0;, preceded by the explanatory comment at :987-988: "cp-api recomputes cost server-side from its pricing catalog when ingesting telemetry; the DP just records 0.0 on the wire." The chat.rs file also hard-codes cost_usd: 0.0 at four additional call sites (:242, :648, :699, :832), confirming the pattern is workspace-wide, not just at one site. No Model.cost field read site exists in crates/aisix-proxy/.
  3. All 5 anchors re-grep'd against current HEAD. No consumer landed between the issue's audit window (71ea97e) and PR open (also 71ea97e):
    • /livez route mount on crates/aisix-admin/src/lib.rs:67
    • /admin/v1/health admin-scoped mount on crates/aisix-admin/src/lib.rs:145
    • Uuid::new_v4().as_simple() for rotate plaintext on crates/aisix-admin/src/apikeys_handlers.rs:168
    • Zero hits for entry.value.backend / policy.backend / cache_policy.backend consumers in crates/
    • cfg.ignore_statuses.contains(...) consumer on crates/aisix-proxy/src/background.rs:84,88
    • let cost_usd = 0.0; hard-code on crates/aisix-proxy/src/chat.rs:989

Model.cost example placeholder note

The 32-char replacement plaintext in the rotate example is sk-550e8400e29b41d4a716446655440000. The 32-hex segment is the canonical "all-zeros after the variant byte" UUID example value used as a placeholder across many published examples; it is structurally identical to a real Uuid::new_v4().as_simple() output (no hyphens, 32 hex chars) without being a copy of any real generated key.

Coexistence with PR #326 and PR #344

This PR's affected pages (admin-api.md, api-keys.md, caching.md, models.md) do not overlap with PR #326 or PR #344's affected files (which cover the overview / quickstart / bootstrap-config cluster). No git merge-tree collision check needed — disjoint file sets.

References

Summary by CodeRabbit

Documentation

  • Clarified public operator helper routes listed in admin API documentation
  • Updated API key rotation example in configuration guide
  • Added cache backend behavior clarification explaining runtime configuration precedence
  • Enhanced model configuration documentation with health check status handling and cost calculation details

Review Change Stack

…api-keys, caching, and models pages
Closes#347.
Five corrections, each anchored to a runtime consumer (or non-consumer)
verified on `origin/main` at `71ea97e`. The cluster mirrors the
consumer-trace discipline locked in by #326 / #344: for every behavioral
claim, verify the runtime consumer actually reads the documented value,
rather than only verifying the field exists with a default.
- admin-api.md:76 — group label "health" → "livez". The public route
is `/livez` (registered at crates/aisix-admin/src/lib.rs:67); the
`/admin/v1/health` endpoint requires admin auth (registered at :145).
- api-keys.md:86 — rotate response example: 16-char suffix replaced
with a 32-char suffix. Rotate handler at
crates/aisix-admin/src/apikeys_handlers.rs:168 uses
`Uuid::new_v4().as_simple()`, which produces 32 hex chars.
- caching.md — explicit note that `CachePolicy.backend` is parsed and
stored on each row but not consulted at runtime. No consumer of
`entry.value.backend` / `policy.backend` / `cache_policy.backend`
exists in `crates/`. The proxy uses the bootstrap-config
(`cache.backend`) instead.
- models.md:80 — `ignore_statuses` default. Field at
crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160
cited in the issue body) is declared `#[serde(default,
skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>`,
so the actual default is the empty vector — not `[408, 429]` as the
doc claimed. Re-presented `[408, 429]` as a recommended explicit
setting. Consumer at crates/aisix-proxy/src/background.rs:84,88 calls
`cfg.ignore_statuses.contains(...)` against the empty default.
- models.md:163 — `Model.cost` consumer split. Standalone OSS proxy
hard-codes `cost_usd = 0.0` at crates/aisix-proxy/src/chat.rs:989
(with comment "cp-api recomputes cost server-side from its pricing
catalog"). The `Model.cost` field is consumed by AISIX Cloud's
cp-api, not by the OSS proxy.
CopilotAI review requested due to automatic review settings May 18, 2026 20:51
@janiussyafiqjaniussyafiq added documentation Improvements or additions to documentation priority-normal labels May 18, 2026
@coderabbitai

coderabbitaiBot commented May 18, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 61d60a44-4de1-4072-a5cb-3a69eb7bf787

📥 Commits

Reviewing files that changed from the base of the PR and between 71ea97e and 11d58e5.

📒 Files selected for processing (4)
  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

📝 Walkthrough

Walkthrough

This PR updates four configuration documentation files to clarify operator-facing behavior: public API routes, API key examples, cache backend runtime semantics, and model health check and pricing behavior for both AISIX Cloud and OSS deployments.

Changes

Configuration Documentation Clarifications

Layer / File(s)Summary
Operator and API credential documentation
docs/configuration/admin-api.md, docs/configuration/api-keys.md
Admin API public operator helper routes are clarified to include livez, metrics, and OpenAPI discovery (removing health). API key rotation example is updated with a new sample plaintext token.
Cache and model configuration semantics
docs/configuration/caching.md, docs/configuration/models.md
CachePolicy.backend field is clarified as parsed but not used by the runtime proxy; runtime backend selection is driven by bootstrap configuration only. Model health check ignore_statuses behavior is clarified: omission means no statuses are ignored. Cost field semantics are updated to distinguish AISIX Cloud server-side recomputation from OSS proxy zero-cost behavior and AISIX Cloud control plane dependency.

🎯 1 (Trivial) | ⏱️ ~3 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This doc-only PR corrects several inaccuracies in the configuration reference docs to better reflect actual runtime behavior and response shapes across the admin API, API keys, caching, and models documentation.

Changes:

  • Rename the public operator helper label from health to livez to reflect the unauthenticated /livez route.
  • Update the API key rotation example to show a 32-hex UUID suffix consistent with Uuid::new_v4().as_simple().
  • Clarify runtime boundaries for CachePolicy.backend, background_model_check.ignore_statuses defaults, and Model.cost consumption.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
docs/configuration/admin-api.mdCorrects the public helper group label to livez.
docs/configuration/api-keys.mdFixes rotate response example to show a 32-char key suffix.
docs/configuration/caching.mdAdds an explicit note that CachePolicy.backend is currently parsed but not consulted by the proxy runtime.
docs/configuration/models.mdCorrects ignore_statuses default behavior and clarifies cost handling expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -160,7 +160,7 @@ curl -sS -X POST http://127.0.0.1:3001/admin/v1/models \
- `provider` currently supports `openai`, `anthropic`, `google`, `deepseek`, `cohere`, and `jina`.
@moonming
moonming merged commit 2c1d485 into mainMay 19, 2026
11 checks passed
janiussyafiq added a commit that referenced this pull request May 20, 2026
Integrate origin/main (commit 2c1d485 = post-PR-#326 / #348 plus
#330 / #341 / #343 / #345 / #346) into this branch via `git merge
--squash` to clear PR #344's lingering `mergeable: dirty` state.
Conflict on `docs/quickstart/self-hosted.md` was a 3-way-merge-base
artifact: base (3596c0a) read `- a reachable etcd instance`, main
changed `a` → `A` (via #326), this branch additionally inserted the
glossary link. Both changes are wanted; resolution per Umar's
approved plan was `git checkout --ours`, which preserves the branch's
self-hosted.md state (already integrates capital A + glossary link
+ first-time-build paragraph + keep-running framing). Other 4
overlapping doc files auto-merged cleanly (`bootstrap-config.md`,
`core-concepts.md`, `first-model-first-key-first-request.md`,
`openai-sdk.md`). Code files all auto-merged cleanly.
Additional Copilot review (post-`167196a` cycle) addressed:
- `docs/index.md:7` — change link display text from `[data-plane]`
to `[data plane]` to match the canonical glossary term. The URL
anchor `#data-plane` stays kebab-case (matches the glossary
heading's auto-anchor); only the display text changes. Comment
id 3271145422.
- `docs/quickstart/openai-sdk.md:43` — change `All three steps below`
to `All commands below`. The Install-the-SDK section has two
command blocks (mkdir+cd, npm install), not three; the prior
wording originated from a mental model (mkdir, cd, install)
that doesn't match the typographic count of code blocks under
the heading. Comment id 3271145458.
Copilot's third comment on `docs/overview/core-concepts.md`
Observability Exporter wording (id 3271145444) auto-resolves via
this merge — main's #326 rewrite supersedes the branch's pre-#326
wording at that location ("ships per-request span telemetry…
OTLP/HTTP-compatible backend…" replaces "Use this concept when
documenting…"). No separate edit needed; the merge IS the fix.
janiussyafiq added a commit that referenced this pull request May 20, 2026
…ickstart-polish
Resolve PR #344's lingering mergeable: dirty state by linking the
branch history to origin/main (2c1d485 = post-#326 / #348 / #330 /
#341 / #343 / #345 / #346).
The squash-merge commit landed earlier (e2af197) integrated main's
content into the branch tree but did not link the histories, so
GitHub's mergeable computation still saw the 3-way-merge-base
artifact conflict on docs/quickstart/self-hosted.md (a vs A + the
glossary link / "In another terminal" vs "Keep the gateway running"
framing). This explicit merge commit ties the branch to main's
history.
Self-hosted.md conflict resolved by taking OUR side — the branch's
edits already contain main's substantive changes (capital A,
first-time-build paragraph) plus this PR's additions (glossary
link, keep-running framing, YOUR_ADMIN_KEY note, config.yaml
location anchor).
The auto-merge of first-model-first-key-first-request.md duplicated
the :::warning callout that was already integrated via the squash
commit; removed the duplicate.
moonming pushed a commit that referenced this pull request May 22, 2026
@jarvis9443
jarvis9443 deleted the docs/issue-347-configuration-reference-corrections branch June 25, 2026 06:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationpriority-normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Configuration reference corrections across admin-api, api-keys, caching, and models pages

3 participants

@janiussyafiq@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages - #348

Merged
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections
May 19, 2026
Merged

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages#348
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections

Conversation

@janiussyafiq

@janiussyafiqjaniussyafiq commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes#347. Five surgical corrections to the configuration-reference cluster:

  1. admin-api.md:76 — group label "health" → "livez". /livez is the public route; /admin/v1/health requires admin auth.
  2. api-keys.md:86 — rotate response example: 16-char key suffix replaced with a 32-char suffix matching what callers actually receive (Uuid::new_v4().as_simple() produces 32 hex chars).
  3. caching.md — explicit note that CachePolicy.backend is parsed and stored on each row but not consulted by any runtime consumer; the proxy uses the bootstrap-config (cache.backend) instead.
  4. models.md:80background_model_check.ignore_statuses default: Vec<u16> with #[serde(default)] resolves to Vec::new(), not [408, 429]. Re-presented [408, 429] as a recommended explicit setting.
  5. models.md:163Model.cost consumer split: AISIX Cloud's cp-api recomputes cost server-side; the standalone OSS proxy hard-codes cost_usd = 0.0 and does not consult the field.

Doc-only diff. No code, schemas, configs, or test fixtures touched.

Changes

FileChange
docs/configuration/admin-api.mdGroup label on line 76 changed from "public operator helpers: health, metrics, and OpenAPI discovery" to "public operator helpers: livez, metrics, and OpenAPI discovery".
docs/configuration/api-keys.mdRotate response example on line 86: sk-abcd1234ef567890 (16 hex) replaced with sk-550e8400e29b41d4a716446655440000 (32 hex) to match Uuid::new_v4().as_simple() output.
docs/configuration/caching.mdAdded a one-paragraph note after the CachePolicy.backend-conservative bullet (line 83) explicitly stating the field is parsed but not consulted by the runtime proxy, that the runtime backend selection comes from bootstrap-config (cache.backend), and that the field is preserved for forward compatibility.
docs/configuration/models.mdBullet on line 80 rewritten: removed the misleading [408, 429] default claim and stated that without an explicit value no probe statuses are ignored, then re-presented [408, 429] as a recommended explicit setting with the operational rationale (tolerates transient 408/429 during probes).
docs/configuration/models.mdBullet on line 163 rewritten: Model.cost description now makes the substrate split explicit — AISIX Cloud's cp-api consumes the field; the standalone OSS proxy does not consult it at request time and emits cost_usd=0.0; pricing-aware budget enforcement requires the Cloud control plane.

Net diff: 4 files, +6 / -4. Source: git diff --stat.

Test plan

Doc-only diff — no .rs files, schemas, configs, or test fixtures touched. The cargo trio was still run end-to-end as the canonical pre-merge gate. The first cargo test --workspace invocation OOMed under default parallelism (this VPS has 8 GB and the workspace compiles 30+ crate test binaries); re-ran with cargo test --workspace -j 2 (and CARGO_BUILD_JOBS=2) to cap compile concurrency — all suites green.

  • cargo fmt --check — PASS (exit 0).
  • cargo clippy --workspace --all-targets -- -D warnings — PASS (exit 0, 18.30s, no warnings).
  • cargo test --workspace -j 2 — PASS (exit 0, 33 suites all green; 1067 tests passed, 0 failed, 3 ignored).
  • grep -rln <each affected page> tests/e2e/ for all 4 pages returns empty. pnpm test under tests/e2e/ is not applicable for this diff.

cargo clippy tail

 Checking aisix-provider-azure-openai v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-provider-azure-openai)
Checking aisix-proxy v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-proxy)
Checking aisix-admin v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-admin)
Checking aisix-server v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-server)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.30s

cargo test summary

33 test-suite-result lines, all 'ok'. Aggregate: 1067 tests passed, 0 failed, 3 ignored across the workspace (unit suites + doc-tests). Tally is higher than the post-#338 baseline (1041) because PRs #341/#343/#345/#346 added test coverage for new Provider variants, Hub registrations, the OpenAI-adapter long-tail providers, and the Anthropic-shape error envelope on /v1/messages.

Affected pages

  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

Pre-merge-check verification log

Issue #347 called out three pre-merge checks. All three resolved as follows:

  1. ignore_statuses default re-verified at PR-time HEAD. Field declaration on origin/main at 71ea97e is at crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160 cited in the issue body — file reorganization between audit-window and PR-window; substance unchanged). Declaration is verbatim: #[serde(default, skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>. No custom default = "..." attribute, so the #[serde(default)] resolves to <Vec<u16> as Default>::default() = Vec::new(). Consumer at crates/aisix-proxy/src/background.rs:84,88 is unchanged: cfg.ignore_statuses.contains(&status) against the empty default, so the silent-failure mode is exactly as documented.
  2. Model.cost hard-code re-verified at PR-time HEAD.crates/aisix-proxy/src/chat.rs:989 still reads let cost_usd = 0.0;, preceded by the explanatory comment at :987-988: "cp-api recomputes cost server-side from its pricing catalog when ingesting telemetry; the DP just records 0.0 on the wire." The chat.rs file also hard-codes cost_usd: 0.0 at four additional call sites (:242, :648, :699, :832), confirming the pattern is workspace-wide, not just at one site. No Model.cost field read site exists in crates/aisix-proxy/.
  3. All 5 anchors re-grep'd against current HEAD. No consumer landed between the issue's audit window (71ea97e) and PR open (also 71ea97e):
    • /livez route mount on crates/aisix-admin/src/lib.rs:67
    • /admin/v1/health admin-scoped mount on crates/aisix-admin/src/lib.rs:145
    • Uuid::new_v4().as_simple() for rotate plaintext on crates/aisix-admin/src/apikeys_handlers.rs:168
    • Zero hits for entry.value.backend / policy.backend / cache_policy.backend consumers in crates/
    • cfg.ignore_statuses.contains(...) consumer on crates/aisix-proxy/src/background.rs:84,88
    • let cost_usd = 0.0; hard-code on crates/aisix-proxy/src/chat.rs:989

Model.cost example placeholder note

The 32-char replacement plaintext in the rotate example is sk-550e8400e29b41d4a716446655440000. The 32-hex segment is the canonical "all-zeros after the variant byte" UUID example value used as a placeholder across many published examples; it is structurally identical to a real Uuid::new_v4().as_simple() output (no hyphens, 32 hex chars) without being a copy of any real generated key.

Coexistence with PR #326 and PR #344

This PR's affected pages (admin-api.md, api-keys.md, caching.md, models.md) do not overlap with PR #326 or PR #344's affected files (which cover the overview / quickstart / bootstrap-config cluster). No git merge-tree collision check needed — disjoint file sets.

References

Summary by CodeRabbit

Documentation

  • Clarified public operator helper routes listed in admin API documentation
  • Updated API key rotation example in configuration guide
  • Added cache backend behavior clarification explaining runtime configuration precedence
  • Enhanced model configuration documentation with health check status handling and cost calculation details

Review Change Stack

…api-keys, caching, and models pages
Closes#347.
Five corrections, each anchored to a runtime consumer (or non-consumer)
verified on `origin/main` at `71ea97e`. The cluster mirrors the
consumer-trace discipline locked in by #326 / #344: for every behavioral
claim, verify the runtime consumer actually reads the documented value,
rather than only verifying the field exists with a default.
- admin-api.md:76 — group label "health" → "livez". The public route
is `/livez` (registered at crates/aisix-admin/src/lib.rs:67); the
`/admin/v1/health` endpoint requires admin auth (registered at :145).
- api-keys.md:86 — rotate response example: 16-char suffix replaced
with a 32-char suffix. Rotate handler at
crates/aisix-admin/src/apikeys_handlers.rs:168 uses
`Uuid::new_v4().as_simple()`, which produces 32 hex chars.
- caching.md — explicit note that `CachePolicy.backend` is parsed and
stored on each row but not consulted at runtime. No consumer of
`entry.value.backend` / `policy.backend` / `cache_policy.backend`
exists in `crates/`. The proxy uses the bootstrap-config
(`cache.backend`) instead.
- models.md:80 — `ignore_statuses` default. Field at
crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160
cited in the issue body) is declared `#[serde(default,
skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>`,
so the actual default is the empty vector — not `[408, 429]` as the
doc claimed. Re-presented `[408, 429]` as a recommended explicit
setting. Consumer at crates/aisix-proxy/src/background.rs:84,88 calls
`cfg.ignore_statuses.contains(...)` against the empty default.
- models.md:163 — `Model.cost` consumer split. Standalone OSS proxy
hard-codes `cost_usd = 0.0` at crates/aisix-proxy/src/chat.rs:989
(with comment "cp-api recomputes cost server-side from its pricing
catalog"). The `Model.cost` field is consumed by AISIX Cloud's
cp-api, not by the OSS proxy.
CopilotAI review requested due to automatic review settings May 18, 2026 20:51
@janiussyafiqjaniussyafiq added documentation Improvements or additions to documentation priority-normal labels May 18, 2026
@coderabbitai

coderabbitaiBot commented May 18, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 61d60a44-4de1-4072-a5cb-3a69eb7bf787

📥 Commits

Reviewing files that changed from the base of the PR and between 71ea97e and 11d58e5.

📒 Files selected for processing (4)
  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

📝 Walkthrough

Walkthrough

This PR updates four configuration documentation files to clarify operator-facing behavior: public API routes, API key examples, cache backend runtime semantics, and model health check and pricing behavior for both AISIX Cloud and OSS deployments.

Changes

Configuration Documentation Clarifications

Layer / File(s)Summary
Operator and API credential documentation
docs/configuration/admin-api.md, docs/configuration/api-keys.md
Admin API public operator helper routes are clarified to include livez, metrics, and OpenAPI discovery (removing health). API key rotation example is updated with a new sample plaintext token.
Cache and model configuration semantics
docs/configuration/caching.md, docs/configuration/models.md
CachePolicy.backend field is clarified as parsed but not used by the runtime proxy; runtime backend selection is driven by bootstrap configuration only. Model health check ignore_statuses behavior is clarified: omission means no statuses are ignored. Cost field semantics are updated to distinguish AISIX Cloud server-side recomputation from OSS proxy zero-cost behavior and AISIX Cloud control plane dependency.

🎯 1 (Trivial) | ⏱️ ~3 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This doc-only PR corrects several inaccuracies in the configuration reference docs to better reflect actual runtime behavior and response shapes across the admin API, API keys, caching, and models documentation.

Changes:

  • Rename the public operator helper label from health to livez to reflect the unauthenticated /livez route.
  • Update the API key rotation example to show a 32-hex UUID suffix consistent with Uuid::new_v4().as_simple().
  • Clarify runtime boundaries for CachePolicy.backend, background_model_check.ignore_statuses defaults, and Model.cost consumption.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
docs/configuration/admin-api.mdCorrects the public helper group label to livez.
docs/configuration/api-keys.mdFixes rotate response example to show a 32-char key suffix.
docs/configuration/caching.mdAdds an explicit note that CachePolicy.backend is currently parsed but not consulted by the proxy runtime.
docs/configuration/models.mdCorrects ignore_statuses default behavior and clarifies cost handling expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -160,7 +160,7 @@ curl -sS -X POST http://127.0.0.1:3001/admin/v1/models \
- `provider` currently supports `openai`, `anthropic`, `google`, `deepseek`, `cohere`, and `jina`.
@moonming
moonming merged commit 2c1d485 into mainMay 19, 2026
11 checks passed
janiussyafiq added a commit that referenced this pull request May 20, 2026
Integrate origin/main (commit 2c1d485 = post-PR-#326 / #348 plus
#330 / #341 / #343 / #345 / #346) into this branch via `git merge
--squash` to clear PR #344's lingering `mergeable: dirty` state.
Conflict on `docs/quickstart/self-hosted.md` was a 3-way-merge-base
artifact: base (3596c0a) read `- a reachable etcd instance`, main
changed `a` → `A` (via #326), this branch additionally inserted the
glossary link. Both changes are wanted; resolution per Umar's
approved plan was `git checkout --ours`, which preserves the branch's
self-hosted.md state (already integrates capital A + glossary link
+ first-time-build paragraph + keep-running framing). Other 4
overlapping doc files auto-merged cleanly (`bootstrap-config.md`,
`core-concepts.md`, `first-model-first-key-first-request.md`,
`openai-sdk.md`). Code files all auto-merged cleanly.
Additional Copilot review (post-`167196a` cycle) addressed:
- `docs/index.md:7` — change link display text from `[data-plane]`
to `[data plane]` to match the canonical glossary term. The URL
anchor `#data-plane` stays kebab-case (matches the glossary
heading's auto-anchor); only the display text changes. Comment
id 3271145422.
- `docs/quickstart/openai-sdk.md:43` — change `All three steps below`
to `All commands below`. The Install-the-SDK section has two
command blocks (mkdir+cd, npm install), not three; the prior
wording originated from a mental model (mkdir, cd, install)
that doesn't match the typographic count of code blocks under
the heading. Comment id 3271145458.
Copilot's third comment on `docs/overview/core-concepts.md`
Observability Exporter wording (id 3271145444) auto-resolves via
this merge — main's #326 rewrite supersedes the branch's pre-#326
wording at that location ("ships per-request span telemetry…
OTLP/HTTP-compatible backend…" replaces "Use this concept when
documenting…"). No separate edit needed; the merge IS the fix.
janiussyafiq added a commit that referenced this pull request May 20, 2026
…ickstart-polish
Resolve PR #344's lingering mergeable: dirty state by linking the
branch history to origin/main (2c1d485 = post-#326 / #348 / #330 /
#341 / #343 / #345 / #346).
The squash-merge commit landed earlier (e2af197) integrated main's
content into the branch tree but did not link the histories, so
GitHub's mergeable computation still saw the 3-way-merge-base
artifact conflict on docs/quickstart/self-hosted.md (a vs A + the
glossary link / "In another terminal" vs "Keep the gateway running"
framing). This explicit merge commit ties the branch to main's
history.
Self-hosted.md conflict resolved by taking OUR side — the branch's
edits already contain main's substantive changes (capital A,
first-time-build paragraph) plus this PR's additions (glossary
link, keep-running framing, YOUR_ADMIN_KEY note, config.yaml
location anchor).
The auto-merge of first-model-first-key-first-request.md duplicated
the :::warning callout that was already integrated via the squash
commit; removed the duplicate.
moonming pushed a commit that referenced this pull request May 22, 2026
@jarvis9443
jarvis9443 deleted the docs/issue-347-configuration-reference-corrections branch June 25, 2026 06:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationpriority-normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Configuration reference corrections across admin-api, api-keys, caching, and models pages

3 participants

@janiussyafiq@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages - #348

Merged
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections
May 19, 2026
Merged

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages#348
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections

Conversation

@janiussyafiq

@janiussyafiqjaniussyafiq commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes#347. Five surgical corrections to the configuration-reference cluster:

  1. admin-api.md:76 — group label "health" → "livez". /livez is the public route; /admin/v1/health requires admin auth.
  2. api-keys.md:86 — rotate response example: 16-char key suffix replaced with a 32-char suffix matching what callers actually receive (Uuid::new_v4().as_simple() produces 32 hex chars).
  3. caching.md — explicit note that CachePolicy.backend is parsed and stored on each row but not consulted by any runtime consumer; the proxy uses the bootstrap-config (cache.backend) instead.
  4. models.md:80background_model_check.ignore_statuses default: Vec<u16> with #[serde(default)] resolves to Vec::new(), not [408, 429]. Re-presented [408, 429] as a recommended explicit setting.
  5. models.md:163Model.cost consumer split: AISIX Cloud's cp-api recomputes cost server-side; the standalone OSS proxy hard-codes cost_usd = 0.0 and does not consult the field.

Doc-only diff. No code, schemas, configs, or test fixtures touched.

Changes

FileChange
docs/configuration/admin-api.mdGroup label on line 76 changed from "public operator helpers: health, metrics, and OpenAPI discovery" to "public operator helpers: livez, metrics, and OpenAPI discovery".
docs/configuration/api-keys.mdRotate response example on line 86: sk-abcd1234ef567890 (16 hex) replaced with sk-550e8400e29b41d4a716446655440000 (32 hex) to match Uuid::new_v4().as_simple() output.
docs/configuration/caching.mdAdded a one-paragraph note after the CachePolicy.backend-conservative bullet (line 83) explicitly stating the field is parsed but not consulted by the runtime proxy, that the runtime backend selection comes from bootstrap-config (cache.backend), and that the field is preserved for forward compatibility.
docs/configuration/models.mdBullet on line 80 rewritten: removed the misleading [408, 429] default claim and stated that without an explicit value no probe statuses are ignored, then re-presented [408, 429] as a recommended explicit setting with the operational rationale (tolerates transient 408/429 during probes).
docs/configuration/models.mdBullet on line 163 rewritten: Model.cost description now makes the substrate split explicit — AISIX Cloud's cp-api consumes the field; the standalone OSS proxy does not consult it at request time and emits cost_usd=0.0; pricing-aware budget enforcement requires the Cloud control plane.

Net diff: 4 files, +6 / -4. Source: git diff --stat.

Test plan

Doc-only diff — no .rs files, schemas, configs, or test fixtures touched. The cargo trio was still run end-to-end as the canonical pre-merge gate. The first cargo test --workspace invocation OOMed under default parallelism (this VPS has 8 GB and the workspace compiles 30+ crate test binaries); re-ran with cargo test --workspace -j 2 (and CARGO_BUILD_JOBS=2) to cap compile concurrency — all suites green.

  • cargo fmt --check — PASS (exit 0).
  • cargo clippy --workspace --all-targets -- -D warnings — PASS (exit 0, 18.30s, no warnings).
  • cargo test --workspace -j 2 — PASS (exit 0, 33 suites all green; 1067 tests passed, 0 failed, 3 ignored).
  • grep -rln <each affected page> tests/e2e/ for all 4 pages returns empty. pnpm test under tests/e2e/ is not applicable for this diff.

cargo clippy tail

 Checking aisix-provider-azure-openai v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-provider-azure-openai)
Checking aisix-proxy v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-proxy)
Checking aisix-admin v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-admin)
Checking aisix-server v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-server)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.30s

cargo test summary

33 test-suite-result lines, all 'ok'. Aggregate: 1067 tests passed, 0 failed, 3 ignored across the workspace (unit suites + doc-tests). Tally is higher than the post-#338 baseline (1041) because PRs #341/#343/#345/#346 added test coverage for new Provider variants, Hub registrations, the OpenAI-adapter long-tail providers, and the Anthropic-shape error envelope on /v1/messages.

Affected pages

  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

Pre-merge-check verification log

Issue #347 called out three pre-merge checks. All three resolved as follows:

  1. ignore_statuses default re-verified at PR-time HEAD. Field declaration on origin/main at 71ea97e is at crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160 cited in the issue body — file reorganization between audit-window and PR-window; substance unchanged). Declaration is verbatim: #[serde(default, skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>. No custom default = "..." attribute, so the #[serde(default)] resolves to <Vec<u16> as Default>::default() = Vec::new(). Consumer at crates/aisix-proxy/src/background.rs:84,88 is unchanged: cfg.ignore_statuses.contains(&status) against the empty default, so the silent-failure mode is exactly as documented.
  2. Model.cost hard-code re-verified at PR-time HEAD.crates/aisix-proxy/src/chat.rs:989 still reads let cost_usd = 0.0;, preceded by the explanatory comment at :987-988: "cp-api recomputes cost server-side from its pricing catalog when ingesting telemetry; the DP just records 0.0 on the wire." The chat.rs file also hard-codes cost_usd: 0.0 at four additional call sites (:242, :648, :699, :832), confirming the pattern is workspace-wide, not just at one site. No Model.cost field read site exists in crates/aisix-proxy/.
  3. All 5 anchors re-grep'd against current HEAD. No consumer landed between the issue's audit window (71ea97e) and PR open (also 71ea97e):
    • /livez route mount on crates/aisix-admin/src/lib.rs:67
    • /admin/v1/health admin-scoped mount on crates/aisix-admin/src/lib.rs:145
    • Uuid::new_v4().as_simple() for rotate plaintext on crates/aisix-admin/src/apikeys_handlers.rs:168
    • Zero hits for entry.value.backend / policy.backend / cache_policy.backend consumers in crates/
    • cfg.ignore_statuses.contains(...) consumer on crates/aisix-proxy/src/background.rs:84,88
    • let cost_usd = 0.0; hard-code on crates/aisix-proxy/src/chat.rs:989

Model.cost example placeholder note

The 32-char replacement plaintext in the rotate example is sk-550e8400e29b41d4a716446655440000. The 32-hex segment is the canonical "all-zeros after the variant byte" UUID example value used as a placeholder across many published examples; it is structurally identical to a real Uuid::new_v4().as_simple() output (no hyphens, 32 hex chars) without being a copy of any real generated key.

Coexistence with PR #326 and PR #344

This PR's affected pages (admin-api.md, api-keys.md, caching.md, models.md) do not overlap with PR #326 or PR #344's affected files (which cover the overview / quickstart / bootstrap-config cluster). No git merge-tree collision check needed — disjoint file sets.

References

Summary by CodeRabbit

Documentation

  • Clarified public operator helper routes listed in admin API documentation
  • Updated API key rotation example in configuration guide
  • Added cache backend behavior clarification explaining runtime configuration precedence
  • Enhanced model configuration documentation with health check status handling and cost calculation details

Review Change Stack

…api-keys, caching, and models pages
Closes#347.
Five corrections, each anchored to a runtime consumer (or non-consumer)
verified on `origin/main` at `71ea97e`. The cluster mirrors the
consumer-trace discipline locked in by #326 / #344: for every behavioral
claim, verify the runtime consumer actually reads the documented value,
rather than only verifying the field exists with a default.
- admin-api.md:76 — group label "health" → "livez". The public route
is `/livez` (registered at crates/aisix-admin/src/lib.rs:67); the
`/admin/v1/health` endpoint requires admin auth (registered at :145).
- api-keys.md:86 — rotate response example: 16-char suffix replaced
with a 32-char suffix. Rotate handler at
crates/aisix-admin/src/apikeys_handlers.rs:168 uses
`Uuid::new_v4().as_simple()`, which produces 32 hex chars.
- caching.md — explicit note that `CachePolicy.backend` is parsed and
stored on each row but not consulted at runtime. No consumer of
`entry.value.backend` / `policy.backend` / `cache_policy.backend`
exists in `crates/`. The proxy uses the bootstrap-config
(`cache.backend`) instead.
- models.md:80 — `ignore_statuses` default. Field at
crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160
cited in the issue body) is declared `#[serde(default,
skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>`,
so the actual default is the empty vector — not `[408, 429]` as the
doc claimed. Re-presented `[408, 429]` as a recommended explicit
setting. Consumer at crates/aisix-proxy/src/background.rs:84,88 calls
`cfg.ignore_statuses.contains(...)` against the empty default.
- models.md:163 — `Model.cost` consumer split. Standalone OSS proxy
hard-codes `cost_usd = 0.0` at crates/aisix-proxy/src/chat.rs:989
(with comment "cp-api recomputes cost server-side from its pricing
catalog"). The `Model.cost` field is consumed by AISIX Cloud's
cp-api, not by the OSS proxy.
CopilotAI review requested due to automatic review settings May 18, 2026 20:51
@janiussyafiqjaniussyafiq added documentation Improvements or additions to documentation priority-normal labels May 18, 2026
@coderabbitai

coderabbitaiBot commented May 18, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 61d60a44-4de1-4072-a5cb-3a69eb7bf787

📥 Commits

Reviewing files that changed from the base of the PR and between 71ea97e and 11d58e5.

📒 Files selected for processing (4)
  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

📝 Walkthrough

Walkthrough

This PR updates four configuration documentation files to clarify operator-facing behavior: public API routes, API key examples, cache backend runtime semantics, and model health check and pricing behavior for both AISIX Cloud and OSS deployments.

Changes

Configuration Documentation Clarifications

Layer / File(s)Summary
Operator and API credential documentation
docs/configuration/admin-api.md, docs/configuration/api-keys.md
Admin API public operator helper routes are clarified to include livez, metrics, and OpenAPI discovery (removing health). API key rotation example is updated with a new sample plaintext token.
Cache and model configuration semantics
docs/configuration/caching.md, docs/configuration/models.md
CachePolicy.backend field is clarified as parsed but not used by the runtime proxy; runtime backend selection is driven by bootstrap configuration only. Model health check ignore_statuses behavior is clarified: omission means no statuses are ignored. Cost field semantics are updated to distinguish AISIX Cloud server-side recomputation from OSS proxy zero-cost behavior and AISIX Cloud control plane dependency.

🎯 1 (Trivial) | ⏱️ ~3 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This doc-only PR corrects several inaccuracies in the configuration reference docs to better reflect actual runtime behavior and response shapes across the admin API, API keys, caching, and models documentation.

Changes:

  • Rename the public operator helper label from health to livez to reflect the unauthenticated /livez route.
  • Update the API key rotation example to show a 32-hex UUID suffix consistent with Uuid::new_v4().as_simple().
  • Clarify runtime boundaries for CachePolicy.backend, background_model_check.ignore_statuses defaults, and Model.cost consumption.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
docs/configuration/admin-api.mdCorrects the public helper group label to livez.
docs/configuration/api-keys.mdFixes rotate response example to show a 32-char key suffix.
docs/configuration/caching.mdAdds an explicit note that CachePolicy.backend is currently parsed but not consulted by the proxy runtime.
docs/configuration/models.mdCorrects ignore_statuses default behavior and clarifies cost handling expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -160,7 +160,7 @@ curl -sS -X POST http://127.0.0.1:3001/admin/v1/models \
- `provider` currently supports `openai`, `anthropic`, `google`, `deepseek`, `cohere`, and `jina`.
@moonming
moonming merged commit 2c1d485 into mainMay 19, 2026
11 checks passed
janiussyafiq added a commit that referenced this pull request May 20, 2026
Integrate origin/main (commit 2c1d485 = post-PR-#326 / #348 plus
#330 / #341 / #343 / #345 / #346) into this branch via `git merge
--squash` to clear PR #344's lingering `mergeable: dirty` state.
Conflict on `docs/quickstart/self-hosted.md` was a 3-way-merge-base
artifact: base (3596c0a) read `- a reachable etcd instance`, main
changed `a` → `A` (via #326), this branch additionally inserted the
glossary link. Both changes are wanted; resolution per Umar's
approved plan was `git checkout --ours`, which preserves the branch's
self-hosted.md state (already integrates capital A + glossary link
+ first-time-build paragraph + keep-running framing). Other 4
overlapping doc files auto-merged cleanly (`bootstrap-config.md`,
`core-concepts.md`, `first-model-first-key-first-request.md`,
`openai-sdk.md`). Code files all auto-merged cleanly.
Additional Copilot review (post-`167196a` cycle) addressed:
- `docs/index.md:7` — change link display text from `[data-plane]`
to `[data plane]` to match the canonical glossary term. The URL
anchor `#data-plane` stays kebab-case (matches the glossary
heading's auto-anchor); only the display text changes. Comment
id 3271145422.
- `docs/quickstart/openai-sdk.md:43` — change `All three steps below`
to `All commands below`. The Install-the-SDK section has two
command blocks (mkdir+cd, npm install), not three; the prior
wording originated from a mental model (mkdir, cd, install)
that doesn't match the typographic count of code blocks under
the heading. Comment id 3271145458.
Copilot's third comment on `docs/overview/core-concepts.md`
Observability Exporter wording (id 3271145444) auto-resolves via
this merge — main's #326 rewrite supersedes the branch's pre-#326
wording at that location ("ships per-request span telemetry…
OTLP/HTTP-compatible backend…" replaces "Use this concept when
documenting…"). No separate edit needed; the merge IS the fix.
janiussyafiq added a commit that referenced this pull request May 20, 2026
…ickstart-polish
Resolve PR #344's lingering mergeable: dirty state by linking the
branch history to origin/main (2c1d485 = post-#326 / #348 / #330 /
#341 / #343 / #345 / #346).
The squash-merge commit landed earlier (e2af197) integrated main's
content into the branch tree but did not link the histories, so
GitHub's mergeable computation still saw the 3-way-merge-base
artifact conflict on docs/quickstart/self-hosted.md (a vs A + the
glossary link / "In another terminal" vs "Keep the gateway running"
framing). This explicit merge commit ties the branch to main's
history.
Self-hosted.md conflict resolved by taking OUR side — the branch's
edits already contain main's substantive changes (capital A,
first-time-build paragraph) plus this PR's additions (glossary
link, keep-running framing, YOUR_ADMIN_KEY note, config.yaml
location anchor).
The auto-merge of first-model-first-key-first-request.md duplicated
the :::warning callout that was already integrated via the squash
commit; removed the duplicate.
moonming pushed a commit that referenced this pull request May 22, 2026
@jarvis9443
jarvis9443 deleted the docs/issue-347-configuration-reference-corrections branch June 25, 2026 06:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationpriority-normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Configuration reference corrections across admin-api, api-keys, caching, and models pages

3 participants

@janiussyafiq@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages - #348

Merged
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections
May 19, 2026
Merged

docs: correct configuration reference inaccuracies across admin-api, api-keys, caching, and models pages#348
moonming merged 1 commit into
mainfrom
docs/issue-347-configuration-reference-corrections

Conversation

@janiussyafiq

@janiussyafiqjaniussyafiq commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes#347. Five surgical corrections to the configuration-reference cluster:

  1. admin-api.md:76 — group label "health" → "livez". /livez is the public route; /admin/v1/health requires admin auth.
  2. api-keys.md:86 — rotate response example: 16-char key suffix replaced with a 32-char suffix matching what callers actually receive (Uuid::new_v4().as_simple() produces 32 hex chars).
  3. caching.md — explicit note that CachePolicy.backend is parsed and stored on each row but not consulted by any runtime consumer; the proxy uses the bootstrap-config (cache.backend) instead.
  4. models.md:80background_model_check.ignore_statuses default: Vec<u16> with #[serde(default)] resolves to Vec::new(), not [408, 429]. Re-presented [408, 429] as a recommended explicit setting.
  5. models.md:163Model.cost consumer split: AISIX Cloud's cp-api recomputes cost server-side; the standalone OSS proxy hard-codes cost_usd = 0.0 and does not consult the field.

Doc-only diff. No code, schemas, configs, or test fixtures touched.

Changes

FileChange
docs/configuration/admin-api.mdGroup label on line 76 changed from "public operator helpers: health, metrics, and OpenAPI discovery" to "public operator helpers: livez, metrics, and OpenAPI discovery".
docs/configuration/api-keys.mdRotate response example on line 86: sk-abcd1234ef567890 (16 hex) replaced with sk-550e8400e29b41d4a716446655440000 (32 hex) to match Uuid::new_v4().as_simple() output.
docs/configuration/caching.mdAdded a one-paragraph note after the CachePolicy.backend-conservative bullet (line 83) explicitly stating the field is parsed but not consulted by the runtime proxy, that the runtime backend selection comes from bootstrap-config (cache.backend), and that the field is preserved for forward compatibility.
docs/configuration/models.mdBullet on line 80 rewritten: removed the misleading [408, 429] default claim and stated that without an explicit value no probe statuses are ignored, then re-presented [408, 429] as a recommended explicit setting with the operational rationale (tolerates transient 408/429 during probes).
docs/configuration/models.mdBullet on line 163 rewritten: Model.cost description now makes the substrate split explicit — AISIX Cloud's cp-api consumes the field; the standalone OSS proxy does not consult it at request time and emits cost_usd=0.0; pricing-aware budget enforcement requires the Cloud control plane.

Net diff: 4 files, +6 / -4. Source: git diff --stat.

Test plan

Doc-only diff — no .rs files, schemas, configs, or test fixtures touched. The cargo trio was still run end-to-end as the canonical pre-merge gate. The first cargo test --workspace invocation OOMed under default parallelism (this VPS has 8 GB and the workspace compiles 30+ crate test binaries); re-ran with cargo test --workspace -j 2 (and CARGO_BUILD_JOBS=2) to cap compile concurrency — all suites green.

  • cargo fmt --check — PASS (exit 0).
  • cargo clippy --workspace --all-targets -- -D warnings — PASS (exit 0, 18.30s, no warnings).
  • cargo test --workspace -j 2 — PASS (exit 0, 33 suites all green; 1067 tests passed, 0 failed, 3 ignored).
  • grep -rln <each affected page> tests/e2e/ for all 4 pages returns empty. pnpm test under tests/e2e/ is not applicable for this diff.

cargo clippy tail

 Checking aisix-provider-azure-openai v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-provider-azure-openai)
Checking aisix-proxy v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-proxy)
Checking aisix-admin v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-admin)
Checking aisix-server v0.1.0 (/root/GitHub/ai-gateway/crates/aisix-server)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.30s

cargo test summary

33 test-suite-result lines, all 'ok'. Aggregate: 1067 tests passed, 0 failed, 3 ignored across the workspace (unit suites + doc-tests). Tally is higher than the post-#338 baseline (1041) because PRs #341/#343/#345/#346 added test coverage for new Provider variants, Hub registrations, the OpenAI-adapter long-tail providers, and the Anthropic-shape error envelope on /v1/messages.

Affected pages

  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

Pre-merge-check verification log

Issue #347 called out three pre-merge checks. All three resolved as follows:

  1. ignore_statuses default re-verified at PR-time HEAD. Field declaration on origin/main at 71ea97e is at crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160 cited in the issue body — file reorganization between audit-window and PR-window; substance unchanged). Declaration is verbatim: #[serde(default, skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>. No custom default = "..." attribute, so the #[serde(default)] resolves to <Vec<u16> as Default>::default() = Vec::new(). Consumer at crates/aisix-proxy/src/background.rs:84,88 is unchanged: cfg.ignore_statuses.contains(&status) against the empty default, so the silent-failure mode is exactly as documented.
  2. Model.cost hard-code re-verified at PR-time HEAD.crates/aisix-proxy/src/chat.rs:989 still reads let cost_usd = 0.0;, preceded by the explanatory comment at :987-988: "cp-api recomputes cost server-side from its pricing catalog when ingesting telemetry; the DP just records 0.0 on the wire." The chat.rs file also hard-codes cost_usd: 0.0 at four additional call sites (:242, :648, :699, :832), confirming the pattern is workspace-wide, not just at one site. No Model.cost field read site exists in crates/aisix-proxy/.
  3. All 5 anchors re-grep'd against current HEAD. No consumer landed between the issue's audit window (71ea97e) and PR open (also 71ea97e):
    • /livez route mount on crates/aisix-admin/src/lib.rs:67
    • /admin/v1/health admin-scoped mount on crates/aisix-admin/src/lib.rs:145
    • Uuid::new_v4().as_simple() for rotate plaintext on crates/aisix-admin/src/apikeys_handlers.rs:168
    • Zero hits for entry.value.backend / policy.backend / cache_policy.backend consumers in crates/
    • cfg.ignore_statuses.contains(...) consumer on crates/aisix-proxy/src/background.rs:84,88
    • let cost_usd = 0.0; hard-code on crates/aisix-proxy/src/chat.rs:989

Model.cost example placeholder note

The 32-char replacement plaintext in the rotate example is sk-550e8400e29b41d4a716446655440000. The 32-hex segment is the canonical "all-zeros after the variant byte" UUID example value used as a placeholder across many published examples; it is structurally identical to a real Uuid::new_v4().as_simple() output (no hyphens, 32 hex chars) without being a copy of any real generated key.

Coexistence with PR #326 and PR #344

This PR's affected pages (admin-api.md, api-keys.md, caching.md, models.md) do not overlap with PR #326 or PR #344's affected files (which cover the overview / quickstart / bootstrap-config cluster). No git merge-tree collision check needed — disjoint file sets.

References

Summary by CodeRabbit

Documentation

  • Clarified public operator helper routes listed in admin API documentation
  • Updated API key rotation example in configuration guide
  • Added cache backend behavior clarification explaining runtime configuration precedence
  • Enhanced model configuration documentation with health check status handling and cost calculation details

Review Change Stack

…api-keys, caching, and models pages
Closes#347.
Five corrections, each anchored to a runtime consumer (or non-consumer)
verified on `origin/main` at `71ea97e`. The cluster mirrors the
consumer-trace discipline locked in by #326 / #344: for every behavioral
claim, verify the runtime consumer actually reads the documented value,
rather than only verifying the field exists with a default.
- admin-api.md:76 — group label "health" → "livez". The public route
is `/livez` (registered at crates/aisix-admin/src/lib.rs:67); the
`/admin/v1/health` endpoint requires admin auth (registered at :145).
- api-keys.md:86 — rotate response example: 16-char suffix replaced
with a 32-char suffix. Rotate handler at
crates/aisix-admin/src/apikeys_handlers.rs:168 uses
`Uuid::new_v4().as_simple()`, which produces 32 hex chars.
- caching.md — explicit note that `CachePolicy.backend` is parsed and
stored on each row but not consulted at runtime. No consumer of
`entry.value.backend` / `policy.backend` / `cache_policy.backend`
exists in `crates/`. The proxy uses the bootstrap-config
(`cache.backend`) instead.
- models.md:80 — `ignore_statuses` default. Field at
crates/aisix-core/src/models/model.rs:259-260 (drifted from :159-160
cited in the issue body) is declared `#[serde(default,
skip_serializing_if = "Vec::is_empty")] pub ignore_statuses: Vec<u16>`,
so the actual default is the empty vector — not `[408, 429]` as the
doc claimed. Re-presented `[408, 429]` as a recommended explicit
setting. Consumer at crates/aisix-proxy/src/background.rs:84,88 calls
`cfg.ignore_statuses.contains(...)` against the empty default.
- models.md:163 — `Model.cost` consumer split. Standalone OSS proxy
hard-codes `cost_usd = 0.0` at crates/aisix-proxy/src/chat.rs:989
(with comment "cp-api recomputes cost server-side from its pricing
catalog"). The `Model.cost` field is consumed by AISIX Cloud's
cp-api, not by the OSS proxy.
CopilotAI review requested due to automatic review settings May 18, 2026 20:51
@janiussyafiqjaniussyafiq added documentation Improvements or additions to documentation priority-normal labels May 18, 2026
@coderabbitai

coderabbitaiBot commented May 18, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 61d60a44-4de1-4072-a5cb-3a69eb7bf787

📥 Commits

Reviewing files that changed from the base of the PR and between 71ea97e and 11d58e5.

📒 Files selected for processing (4)
  • docs/configuration/admin-api.md
  • docs/configuration/api-keys.md
  • docs/configuration/caching.md
  • docs/configuration/models.md

📝 Walkthrough

Walkthrough

This PR updates four configuration documentation files to clarify operator-facing behavior: public API routes, API key examples, cache backend runtime semantics, and model health check and pricing behavior for both AISIX Cloud and OSS deployments.

Changes

Configuration Documentation Clarifications

Layer / File(s)Summary
Operator and API credential documentation
docs/configuration/admin-api.md, docs/configuration/api-keys.md
Admin API public operator helper routes are clarified to include livez, metrics, and OpenAPI discovery (removing health). API key rotation example is updated with a new sample plaintext token.
Cache and model configuration semantics
docs/configuration/caching.md, docs/configuration/models.md
CachePolicy.backend field is clarified as parsed but not used by the runtime proxy; runtime backend selection is driven by bootstrap configuration only. Model health check ignore_statuses behavior is clarified: omission means no statuses are ignored. Cost field semantics are updated to distinguish AISIX Cloud server-side recomputation from OSS proxy zero-cost behavior and AISIX Cloud control plane dependency.

🎯 1 (Trivial) | ⏱️ ~3 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This doc-only PR corrects several inaccuracies in the configuration reference docs to better reflect actual runtime behavior and response shapes across the admin API, API keys, caching, and models documentation.

Changes:

  • Rename the public operator helper label from health to livez to reflect the unauthenticated /livez route.
  • Update the API key rotation example to show a 32-hex UUID suffix consistent with Uuid::new_v4().as_simple().
  • Clarify runtime boundaries for CachePolicy.backend, background_model_check.ignore_statuses defaults, and Model.cost consumption.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
docs/configuration/admin-api.mdCorrects the public helper group label to livez.
docs/configuration/api-keys.mdFixes rotate response example to show a 32-char key suffix.
docs/configuration/caching.mdAdds an explicit note that CachePolicy.backend is currently parsed but not consulted by the proxy runtime.
docs/configuration/models.mdCorrects ignore_statuses default behavior and clarifies cost handling expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -160,7 +160,7 @@ curl -sS -X POST http://127.0.0.1:3001/admin/v1/models \
- `provider` currently supports `openai`, `anthropic`, `google`, `deepseek`, `cohere`, and `jina`.
@moonming
moonming merged commit 2c1d485 into mainMay 19, 2026
11 checks passed
janiussyafiq added a commit that referenced this pull request May 20, 2026
Integrate origin/main (commit 2c1d485 = post-PR-#326 / #348 plus
#330 / #341 / #343 / #345 / #346) into this branch via `git merge
--squash` to clear PR #344's lingering `mergeable: dirty` state.
Conflict on `docs/quickstart/self-hosted.md` was a 3-way-merge-base
artifact: base (3596c0a) read `- a reachable etcd instance`, main
changed `a` → `A` (via #326), this branch additionally inserted the
glossary link. Both changes are wanted; resolution per Umar's
approved plan was `git checkout --ours`, which preserves the branch's
self-hosted.md state (already integrates capital A + glossary link
+ first-time-build paragraph + keep-running framing). Other 4
overlapping doc files auto-merged cleanly (`bootstrap-config.md`,
`core-concepts.md`, `first-model-first-key-first-request.md`,
`openai-sdk.md`). Code files all auto-merged cleanly.
Additional Copilot review (post-`167196a` cycle) addressed:
- `docs/index.md:7` — change link display text from `[data-plane]`
to `[data plane]` to match the canonical glossary term. The URL
anchor `#data-plane` stays kebab-case (matches the glossary
heading's auto-anchor); only the display text changes. Comment
id 3271145422.
- `docs/quickstart/openai-sdk.md:43` — change `All three steps below`
to `All commands below`. The Install-the-SDK section has two
command blocks (mkdir+cd, npm install), not three; the prior
wording originated from a mental model (mkdir, cd, install)
that doesn't match the typographic count of code blocks under
the heading. Comment id 3271145458.
Copilot's third comment on `docs/overview/core-concepts.md`
Observability Exporter wording (id 3271145444) auto-resolves via
this merge — main's #326 rewrite supersedes the branch's pre-#326
wording at that location ("ships per-request span telemetry…
OTLP/HTTP-compatible backend…" replaces "Use this concept when
documenting…"). No separate edit needed; the merge IS the fix.
janiussyafiq added a commit that referenced this pull request May 20, 2026
…ickstart-polish
Resolve PR #344's lingering mergeable: dirty state by linking the
branch history to origin/main (2c1d485 = post-#326 / #348 / #330 /
#341 / #343 / #345 / #346).
The squash-merge commit landed earlier (e2af197) integrated main's
content into the branch tree but did not link the histories, so
GitHub's mergeable computation still saw the 3-way-merge-base
artifact conflict on docs/quickstart/self-hosted.md (a vs A + the
glossary link / "In another terminal" vs "Keep the gateway running"
framing). This explicit merge commit ties the branch to main's
history.
Self-hosted.md conflict resolved by taking OUR side — the branch's
edits already contain main's substantive changes (capital A,
first-time-build paragraph) plus this PR's additions (glossary
link, keep-running framing, YOUR_ADMIN_KEY note, config.yaml
location anchor).
The auto-merge of first-model-first-key-first-request.md duplicated
the :::warning callout that was already integrated via the squash
commit; removed the duplicate.
moonming pushed a commit that referenced this pull request May 22, 2026
@jarvis9443
jarvis9443 deleted the docs/issue-347-configuration-reference-corrections branch June 25, 2026 06:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationpriority-normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Configuration reference corrections across admin-api, api-keys, caching, and models pages

3 participants

@janiussyafiq@moonming