Skip to content

docs(credentials): re-measure the account token on both gateway families - #193

Merged
viztor merged 1 commit into
mainfrom
docs/credential-slots
Nov 19, 2026
Merged

viztor merged 1 commit into
mainfrom
docs/credential-slots

Conversation

@viztor

@viztor viztor commented Nov 19, 2026

Copy link
Copy Markdown
Owner

The credential docs carry a measurement from 2026-10 — "an OAuth token is not an API key on the Zen model endpoint" — that was made with a JWT-shaped string, not the account's real token, and that has since been superseded. This re-measures it against the live gateway and corrects the record.

The device-flow access token authenticates a real completion on both endpoint families, on the Go plane where the controls are unambiguous (model beam-free, with the turn's x-opencode-session header as the client sends it):

Credential sent POST /zen/go/v1/chat/completions (legacy) POST /inference/go/v1/chat/completions (modern)
none 401 OpenCode Go requires an API key 401 OpenCode Go requires an API key
Bearer [REDACTED] 401 Invalid credential 401 Invalid credential
Bearer <the account's access token> 200, a completion 200, a completion

The same token answers the Console API (GET /console/api/user and /api/orgs: 200; garbage and no credential: 401 Unauthorized) and the Go quota endpoint on both families (200, three windows). The Zen free rows answer 429 FreeUsageLimitError with the token and keyless alike — both reach the entitlement check — while garbage stays 401.

What that means for the plugin, and why this is docs-only:

  • No credential-kind gate is needed. An API key and an account's access token both authenticate the gateway today; the plugin's existing policy is right — filter placeholders (usableKey), send the value in the wire's own slot, and let the endpoint answer (401 auth, 403 EntitlementError, 429 free tier).
  • No Console exchange is needed. The old conclusion — that a login's models need the Console to exchange the token for a key — is superseded; the token the Console issues is itself a working gateway credential.
  • The shape of the string still decides nothing, for the same reason the prefix does not name a tier: what separates credentials is the endpoint's answer, not its format.

Scope of the measurement: one account, one day (2026-11-19), the Go free model for the model-call rows and the Zen free rows for the free-tier behaviour; no paid model was called. The org header is not required for the token measured — it authenticates without one, and credentialOrg stays an explicit override.

The docs/deep-dive.md V1/V2 diagram gains the same correction beside it: the credential split is a product shape, not a hard boundary between the two endpoint levels.

No source, config or generated data changes; the unit tests that reference the two documents pass.

@viztor
viztor merged commit 4460500 into main Nov 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant