Endpoint and capability declarations
Every built-in preset's manifest.llm declares a fixed set of fields; this
child names what each one is and is not, so provider children can link here
instead of re-explaining the shape every time.
Declaration fields (non-credential)
provider — one of the four families the kernel accepts: openai,
anthropic, codex, claude-code. It selects the adapter; it is not
itself a credential. Vendor-named providers (custom, deepseek,
minimax, openrouter, ...) are rejected by the kernel; other vendors are
reached through openai/anthropic with their compatible base_url.
model — the exact model string sent to the endpoint. codex and
claude-code use curated picker catalogs (Codex OAuth models, Claude CLI
aliases); openai and anthropic are free text because the endpoint is
arbitrary.
base_url — the endpoint the adapter calls. Optional for openai
(official https://api.openai.com/v1, SDK-style with its own version path)
and anthropic (official https://api.anthropic.com, /v1/... appended);
codex uses its /backend-api/codex route; claude-code has none.
wire_api — openai family only: chat_completions (default,
written explicitly) or responses; responses_transport (http default,
or websocket) applies only to the Responses wire. The retired
api_compat field is no longer read by the kernel and is never written by
the TUI.
thinking / service_tier — standard reasoning effort for openai
and anthropic (none..xhigh, omitted = kernel default); Codex keeps its
low..xhigh ladder with an explicit xhigh default. service_tier
(fast → priority) applies to openai and codex only.
capabilities.vision / capabilities.web_search / capabilities.skills
— opt-in capability declarations, not proof the underlying model actually
performs an image/search call correctly. Templates declare
web_search: duckduckgo and vision: inherit (the agent's own provider and
credentials) rather than any per-vendor capability provider. A capability
being wired only means the kernel will attempt the corresponding route;
whether the live call succeeds is a runtime fact, not a manifest fact.
Distinct from credentials and live probes
These declaration fields answer "what will be called and how" — they are
distinct from:
- Credentials —
api_key_env (env-var name, not a value),
codex_auth_path (which bound OAuth token file, not its contents), or
local CLI login state (claude-code). See ResolveRefsWithAuth
(tui/internal/preset/preset.go) for how credential validity
(not the declaration) is judged per-provider — keyed providers check
existingKeys[envName], codex checks OAuth state
(per-account when AuthState.CodexAuthDir is set, else the global
CodexOAuthConfigured bool), claude-code checks
ClaudeCodeAuthConfigured.
- Live probes — an actual HTTP call proving the declared endpoint,
model, and credential currently work together. This is a
/doctor /
runtime concept, not something Save performs — see
reference/operations/availability-save-gate/SKILL.md.
A preset can be declaration-complete and credential-valid yet still fail a
live probe (provider outage, model retired, quota exhausted) — route a
"does this actually work" question to /doctor, not this skill, and
route "what value/env-var/endpoint does this template even use"
back to the specific provider child instead of guessing here.
Codex OAuth quota inspection
This is proven, verified evidence about the installed Codex CLI's own quota
surface — not an assertion that a particular TUI/kernel adapter or
running session exposes it. The direct app-server operation below remains
the source route; verify any adapter-facing convenience surface against the
running implementation instead of inferring it from this manual.
How an agent actually queries this — the exact operation sequence
An agent that needs live Codex OAuth quota/rate-limit data must:
- Complete the app-server
initialize handshake first (clientInfo
required; capabilities optional) — account/rateLimits/read is only
valid after initialize, not before.
- Send the
account/rateLimits/read request. Its params are
structurally null — the JSON-RPC schema fixes
"params": {"type": "null"} for this method, so the call carries no
request body beyond id/method. Do not invent request fields for it.
- Read the response as a
GetAccountRateLimitsResponse: a required
rateLimits (backward-compatible single-bucket RateLimitSnapshot),
optional rateLimitsByLimitId (the same snapshot shape keyed by
limit_id, e.g. "codex"), and optional rateLimitResetCredits.
Each RateLimitSnapshot carries primary/secondary RateLimitWindow
objects (usedPercent required; windowDurationMins/resetsAt
nullable), plus planType, limitId, limitName,
rateLimitReachedType, credits (CreditsSnapshot: hasCredits,
unlimited, nullable balance), and individualLimit
(SpendControlLimitSnapshot).
- Optionally also subscribe to the
account/rateLimits/updated
server notification for the same AccountRateLimitsUpdatedNotification
shape (a rateLimits snapshot) — but treat it as a sparse rolling
merge signal, not a substitute for step 2: per its own schema
description, a client should merge available values into the most
recent account/rateLimits/read response (or refetch), and a nullable
field being absent in one notification does not mean it cleared a
previously observed value.
- Interactively, the same account-level facts are surfaced by the
official
/status slash command inside the Codex TUI — useful for a
human to cross-check, not a programmatic substitute for step 2.
codex doctor --json does NOT expose any of this. It emits a
redacted installation/config/auth/runtime health report with no
rate-limit, quota, or usedPercent-shaped field. Do not route an agent
there for quota.
Secret-safe fields and limitations
- Every field above (
usedPercent, windowDurationMins, resetsAt,
planType, limitId, limitName, rateLimitReachedType, the
CreditsSnapshot/SpendControlLimitSnapshot fields) is account-level
usage/plan metadata — none of it is a token or credential, and none
of it should ever be paired with the OAuth token file's contents or
absolute path when reported back to a user.
- The response schema carries no field for the account's identity beyond
what the existing
codex display rules already allow
(label → email → default/slug) — do not read account identity out of
this response; it is a rate-limit/credits payload, not an identity one.
rateLimitResetCredits.credits can be null (only availableCount
known) even when credits exist — do not infer "no reset credits" from a
missing credits array.
Official vs. measured context-window capacity — do not conflate them
Two different numbers answer two different questions; keep them
separately qualified and never let one stand in for the other:
- Official current metadata/changelog figure: 272K tokens. This is
what to cite as the vendor-published number, and it is the only number
that may be presented as "current official Codex context window" without
further qualification.
- Measured live A/B boundary: ~372,000 total tokens (date/route/model/CLI-qualified).
This is not an official published limit — it is one synthetic
probe's observed acceptance boundary and must always carry its
qualifiers: OAuth Codex route, model
gpt-5.6-sol, codex-cli 0.144.3,
low reasoning effort, synthetic filler payload, measured 2026-07-19.
Evidence (tokenizer o200k_base 0.12.0, all values from live
turn.completed/error events, not estimated):
- 300,000 user tokens → PASS (
turn.completed.input_tokens=312684,
cached_input_tokens=9984, output_tokens=12,
reasoning_output_tokens=0).
- 359,000 user tokens → PASS (agent reply
CONTEXT_PROBE_359K_OK; total input 371684, cached 9984, output
12, reasoning 0).
- 360,000 user tokens → FAIL — "Codex ran out of room in the
model's context window." (same-setup predicted total, if per-request
overhead stayed constant at 12,684:
372684).
- 500,000 user tokens → FAIL — same context-window error.
- Reading: the empirical bracket for this exact setup is 371,684 total
tokens accepted (359K user payload) and approximately 372,684 total
tokens rejected (360K user payload plus the same 12,684-token
overhead). The shorthand ~372,000 total-token boundary locates that
1,000-token interval; it is not an exact measured ceiling. Subtracting
the measured 12,684-token setup overhead from the rounded 372,000
shorthand yields the correction's roughly 359,316-token same-setup
user-payload reading, while the exact empirical claim remains only
"359,000 passed; 360,000 failed." LingTai's 300K working default is
safely below this measured bracket and therefore underuses the observed
route capacity.
- Never present 272K as live proof of anything measured, and never
present 372K (or the ~359,316 user-payload derivation) as timeless or
universal. The 372K figure is one dated, route/model/CLI-qualified
synthetic A/B result, not a vendor commitment, and it can change on any
Codex release, account plan, or route change. Always carry the
qualifiers when citing it; never round it into "the Codex context
window" unqualified.
Discovery method (read-only, no tokens touched)
The app-server request/response/notification shapes above come from the
Codex app-server's own generated JSON Schema definitions
(GetAccountRateLimitsResponse, AccountRateLimitsUpdatedNotification,
InitializeParams, and the ClientRequest/ServerNotification protocol
union listing the exact account/rateLimits/read /
account/rateLimits/updated method names and the request's params: null
shape) — read directly, not reconstructed from binary strings. The
context-window PASS/FAIL evidence above comes from a targeted, read-only
synthetic probe directory (JSON-RPC event logs plus prompt manifests
recording tokenizer, verified_user_tokens, and sha256 per probe);
its exact machine-local path is intentionally not reproduced in this
skill's portable frontmatter/prose — describe it as "the 2026-07-19
Codex OAuth context-window probe evidence" if a pointer is needed.
For the installed-CLI facts (codex --version → codex-cli 0.144.3,
codex doctor --json's actual redacted-report scope), read-only discovery
was run directly against the locally installed @openai/codex package —
codex doctor --json was executed and its output inspected for any
rate-limit/quota/usedPercent-shaped key (none present); codex doctor --help confirms --json is scoped to "a redacted machine-readable
report" about installation/config/auth/runtime, not usage/quota.
Re-verify both the schema shapes and the measured boundary against the
actually-installed Codex version and current date before relying on exact
field names or the 372K figure in new code — the schema is
app-server-internal surface, not a versioned public API, and the measured
boundary is a snapshot, not a specification.
Display contract if this is ever implemented
If an adapter/runtime consumer of this data is built later, per-OAuth
account:
- Show
remaining = max(0, 100 - usedPercent) as the headline number.
- Also retain — do not collapse away — the reset time, window
duration, and limit-id fields explicitly; a bare "remaining %" without
its window/reset context is not enough to act on.
- Never expose auth paths or tokens while displaying this — the same
discipline as the Codex credential display rules (label → email →
default/slug, never the raw path or token).
This section documents the direct Codex source operation independently of
any adapter convenience surface. If the running adapter exposes equivalent
quota telemetry, verify its fields and version against this source contract;
otherwise use the exact app-server sequence above. See
reference/codex/SKILL.md for the provider-specific routing and
account-safety boundaries.
Operations
For why Save never tests these declarations against a real provider
call — and where that live diagnosis actually happens — see
reference/operations/availability-save-gate/SKILL.md.
1---2name: preset-skill-op-endpoint-capabilities3description: Base URL / wire / provider / model / capability declaration shape versus credentials and live probes; includes proven Codex OAuth quota inspection with exact agent query routing and dated official-vs-measured context-window evidence.4version: 2.0.05last_changed_at: "2026-09-29T00:00:00Z"6related_files:7 - tui/internal/preset/preset.go8 - tui/internal/tui/doctor.go9 - tui/internal/preset/preset_skill_router_test.go10maintenance: "If you find stale or incorrect information here, use the lingtai-issue-report skill to assemble evidence and obtain per-issue human consent before filing an issue. Never include secrets, credentials, tokens, or private paths."11metadata:12 source: https://skillmd.com/skills/lingtai-ai/preset-skill-op-endpoint-capabilities13---1415# Endpoint and capability declarations1617Every built-in preset's `manifest.llm` declares a fixed set of fields; this18child names what each one is and is not, so provider children can link here19instead of re-explaining the shape every time.2021## Declaration fields (non-credential)2223- **`provider`** — one of the four families the kernel accepts: `openai`,24 `anthropic`, `codex`, `claude-code`. It selects the adapter; it is not25 itself a credential. Vendor-named providers (`custom`, `deepseek`,26 `minimax`, `openrouter`, ...) are rejected by the kernel; other vendors are27 reached through `openai`/`anthropic` with their compatible `base_url`.28- **`model`** — the exact model string sent to the endpoint. `codex` and29 `claude-code` use curated picker catalogs (Codex OAuth models, Claude CLI30 aliases); `openai` and `anthropic` are free text because the endpoint is31 arbitrary.32- **`base_url`** — the endpoint the adapter calls. Optional for `openai`33 (official `https://api.openai.com/v1`, SDK-style with its own version path)34 and `anthropic` (official `https://api.anthropic.com`, `/v1/...` appended);35 `codex` uses its `/backend-api/codex` route; `claude-code` has none.36- **`wire_api`** — `openai` family only: `chat_completions` (default,37 written explicitly) or `responses`; `responses_transport` (`http` default,38 or `websocket`) applies only to the Responses wire. The retired39 `api_compat` field is no longer read by the kernel and is never written by40 the TUI.41- **`thinking` / `service_tier`** — standard reasoning effort for `openai`42 and `anthropic` (`none`..`xhigh`, omitted = kernel default); Codex keeps its43 `low`..`xhigh` ladder with an explicit `xhigh` default. `service_tier`44 (`fast` → priority) applies to `openai` and `codex` only.45- **`capabilities.vision` / `capabilities.web_search` / `capabilities.skills`**46 — opt-in capability declarations, not proof the underlying model actually47 performs an image/search call correctly. Templates declare48 `web_search: duckduckgo` and `vision: inherit` (the agent's own provider and49 credentials) rather than any per-vendor capability provider. A capability50 being wired only means the kernel *will attempt* the corresponding route;51 whether the live call succeeds is a runtime fact, not a manifest fact.5253## Distinct from credentials and live probes5455These declaration fields answer "what will be called and how" — they are56**distinct from**:5758- **Credentials** — `api_key_env` (env-var name, not a value),59 `codex_auth_path` (which bound OAuth token file, not its contents), or60 local CLI login state (`claude-code`). See `ResolveRefsWithAuth`61 (`tui/internal/preset/preset.go`) for how credential *validity*62 (not the declaration) is judged per-provider — keyed providers check63 `existingKeys[envName]`, `codex` checks OAuth state64 (per-account when `AuthState.CodexAuthDir` is set, else the global65 `CodexOAuthConfigured` bool), `claude-code` checks66 `ClaudeCodeAuthConfigured`.67- **Live probes** — an actual HTTP call proving the declared endpoint,68 model, and credential currently work together. This is a `/doctor` /69 runtime concept, not something Save performs — see70 `reference/operations/availability-save-gate/SKILL.md`.7172A preset can be declaration-complete and credential-valid yet still fail a73live probe (provider outage, model retired, quota exhausted) — route a74"does this actually work" question to `/doctor`, not this skill, and75route "what value/env-var/endpoint does this template even use"76back to the specific provider child instead of guessing here.7778## Codex OAuth quota inspection7980This is proven, verified evidence about the installed Codex CLI's own quota81surface — **not** an assertion that a particular TUI/kernel adapter or82running session exposes it. The direct app-server operation below remains83the source route; verify any adapter-facing convenience surface against the84running implementation instead of inferring it from this manual.8586### How an agent actually queries this — the exact operation sequence8788An agent that needs live Codex OAuth quota/rate-limit data must:89901. Complete the app-server `initialize` handshake first (`clientInfo`91 required; `capabilities` optional) — `account/rateLimits/read` is only92 valid after initialize, not before.932. Send the `account/rateLimits/read` **request**. Its params are94 structurally `null` — the JSON-RPC schema fixes95 `"params": {"type": "null"}` for this method, so the call carries no96 request body beyond `id`/`method`. Do not invent request fields for it.973. Read the response as a `GetAccountRateLimitsResponse`: a required98 `rateLimits` (backward-compatible single-bucket `RateLimitSnapshot`),99 optional `rateLimitsByLimitId` (the same snapshot shape keyed by100 `limit_id`, e.g. `"codex"`), and optional `rateLimitResetCredits`.101 Each `RateLimitSnapshot` carries `primary`/`secondary` `RateLimitWindow`102 objects (`usedPercent` required; `windowDurationMins`/`resetsAt`103 nullable), plus `planType`, `limitId`, `limitName`,104 `rateLimitReachedType`, `credits` (`CreditsSnapshot`: `hasCredits`,105 `unlimited`, nullable `balance`), and `individualLimit`106 (`SpendControlLimitSnapshot`).1074. Optionally also subscribe to the **`account/rateLimits/updated`**108 server notification for the same `AccountRateLimitsUpdatedNotification`109 shape (a `rateLimits` snapshot) — but treat it as a **sparse rolling110 merge signal, not a substitute for step 2**: per its own schema111 description, a client should merge available values into the most112 recent `account/rateLimits/read` response (or refetch), and a nullable113 field being absent in one notification does not mean it cleared a114 previously observed value.1155. Interactively, the same account-level facts are surfaced by the116 official `/status` slash command inside the Codex TUI — useful for a117 human to cross-check, not a programmatic substitute for step 2.1186. **`codex doctor --json` does NOT expose any of this.** It emits a119 redacted installation/config/auth/runtime health report with no120 rate-limit, quota, or `usedPercent`-shaped field. Do not route an agent121 there for quota.122123### Secret-safe fields and limitations124125- Every field above (`usedPercent`, `windowDurationMins`, `resetsAt`,126 `planType`, `limitId`, `limitName`, `rateLimitReachedType`, the127 `CreditsSnapshot`/`SpendControlLimitSnapshot` fields) is account-level128 usage/plan metadata — **none of it is a token or credential**, and none129 of it should ever be paired with the OAuth token file's contents or130 absolute path when reported back to a user.131- The response schema carries no field for the account's identity beyond132 what the existing `codex` display rules already allow133 (label → email → default/slug) — do not read account identity out of134 this response; it is a rate-limit/credits payload, not an identity one.135- `rateLimitResetCredits.credits` can be `null` (only `availableCount`136 known) even when credits exist — do not infer "no reset credits" from a137 missing `credits` array.138139### Official vs. measured context-window capacity — do not conflate them140141Two different numbers answer two different questions; keep them142separately qualified and never let one stand in for the other:143144- **Official current metadata/changelog figure: 272K tokens.** This is145 what to cite as the vendor-published number, and it is the only number146 that may be presented as "current official Codex context window" without147 further qualification.148- **Measured live A/B boundary: ~372,000 total tokens (date/route/model/CLI-qualified).**149 This is **not** an official published limit — it is one synthetic150 probe's observed acceptance boundary and must always carry its151 qualifiers: OAuth Codex route, model `gpt-5.6-sol`, codex-cli `0.144.3`,152 low reasoning effort, synthetic filler payload, measured 2026-07-19.153 Evidence (tokenizer `o200k_base 0.12.0`, all values from live154 `turn.completed`/error events, not estimated):155 - 300,000 user tokens → **PASS** (`turn.completed.input_tokens=312684`,156 `cached_input_tokens=9984`, `output_tokens=12`,157 `reasoning_output_tokens=0`).158 - 359,000 user tokens → **PASS** (agent reply159 `CONTEXT_PROBE_359K_OK`; total input `371684`, cached `9984`, output160 `12`, reasoning `0`).161 - 360,000 user tokens → **FAIL** — "Codex ran out of room in the162 model's context window." (same-setup predicted total, if per-request163 overhead stayed constant at 12,684: `372684`).164 - 500,000 user tokens → **FAIL** — same context-window error.165 - Reading: the empirical bracket for this exact setup is **371,684 total166 tokens accepted** (359K user payload) and approximately **372,684 total167 tokens rejected** (360K user payload plus the same 12,684-token168 overhead). The shorthand **~372,000 total-token boundary** locates that169 1,000-token interval; it is not an exact measured ceiling. Subtracting170 the measured **12,684-token setup overhead** from the rounded 372,000171 shorthand yields the correction's roughly **359,316-token same-setup172 user-payload** reading, while the exact empirical claim remains only173 "359,000 passed; 360,000 failed." LingTai's 300K working default is174 safely below this measured bracket and therefore underuses the observed175 route capacity.176- **Never present 272K as live proof of anything measured, and never177 present 372K (or the ~359,316 user-payload derivation) as timeless or178 universal.** The 372K figure is one dated, route/model/CLI-qualified179 synthetic A/B result, not a vendor commitment, and it can change on any180 Codex release, account plan, or route change. Always carry the181 qualifiers when citing it; never round it into "the Codex context182 window" unqualified.183184### Discovery method (read-only, no tokens touched)185186The app-server request/response/notification shapes above come from the187Codex app-server's own generated JSON Schema definitions188(`GetAccountRateLimitsResponse`, `AccountRateLimitsUpdatedNotification`,189`InitializeParams`, and the `ClientRequest`/`ServerNotification` protocol190union listing the exact `account/rateLimits/read` /191`account/rateLimits/updated` method names and the request's `params: null`192shape) — read directly, not reconstructed from binary strings. The193context-window PASS/FAIL evidence above comes from a targeted, read-only194synthetic probe directory (JSON-RPC event logs plus prompt manifests195recording `tokenizer`, `verified_user_tokens`, and `sha256` per probe);196its exact machine-local path is intentionally not reproduced in this197skill's portable frontmatter/prose — describe it as "the 2026-07-19198Codex OAuth context-window probe evidence" if a pointer is needed.199200For the installed-CLI facts (`codex --version` → `codex-cli 0.144.3`,201`codex doctor --json`'s actual redacted-report scope), read-only discovery202was run directly against the locally installed `@openai/codex` package —203`codex doctor --json` was executed and its output inspected for any204rate-limit/quota/`usedPercent`-shaped key (none present); `codex doctor205--help` confirms `--json` is scoped to "a redacted machine-readable206report" about installation/config/auth/runtime, not usage/quota.207208Re-verify both the schema shapes and the measured boundary against the209actually-installed Codex version and current date before relying on exact210field names or the 372K figure in new code — the schema is211app-server-internal surface, not a versioned public API, and the measured212boundary is a snapshot, not a specification.213214### Display contract if this is ever implemented215216If an adapter/runtime consumer of this data is built later, per-OAuth217account:218219- Show **`remaining = max(0, 100 - usedPercent)`** as the headline number.220- **Also retain** — do not collapse away — the reset time, window221 duration, and limit-id fields explicitly; a bare "remaining %" without222 its window/reset context is not enough to act on.223- **Never expose auth paths or tokens** while displaying this — the same224 discipline as the Codex credential display rules (label → email →225 default/slug, never the raw path or token).226227This section documents the direct Codex source operation independently of228any adapter convenience surface. If the running adapter exposes equivalent229quota telemetry, verify its fields and version against this source contract;230otherwise use the exact app-server sequence above. See231`reference/codex/SKILL.md` for the provider-specific routing and232account-safety boundaries.233234## Operations235236For why Save never tests these declarations against a real provider237call — and where that live diagnosis actually happens — see238`reference/operations/availability-save-gate/SKILL.md`.