Skip to content

docs: add authentication page to AI Gateway docs#25459

Open
nickvigilante wants to merge 2 commits into
mainfrom
vigilante/docs-148-document-ai-gateway-coder-server-auth-protocol-and-token
Open

docs: add authentication page to AI Gateway docs#25459
nickvigilante wants to merge 2 commits into
mainfrom
vigilante/docs-148-document-ai-gateway-coder-server-auth-protocol-and-token

Conversation

@nickvigilante
Copy link
Copy Markdown
Contributor

Closes DOCS-148.

Adds docs/ai-coder/ai-gateway/auth.md covering how clients authenticate to AI Gateway.

What's in this PR

New page: docs/ai-coder/ai-gateway/auth.md

  • Token format: opaque ID-secret strings (not JWTs)
  • 7-step server-side validation sequence in aibridged
  • Two auth paths: direct API (Authorization/X-Api-Key) and proxy mode (Proxy-Authorization CONNECT handshake)
  • Credential modes: centralized vs. BYOK
  • Token lifecycle: expiry, revocation, rotation

docs/manifest.json inserts auth.md after setup.md in the AI Gateway nav.

docs/ai-coder/ai-gateway/setup.md adds a Next steps section with links to auth, clients, and audit.

docs/ai-coder/ai-gateway/audit.md adds cross-link to auth.md in the existing Next steps section, and converts em-dashes to colons (lint requirement).

Research notes

Key source files reviewed:

  • coderd/httpmw/apikey.go (SplitAPIToken) for token format
  • enterprise/aibridgedserver/aibridgedserver.go (IsAuthorized) for the validation sequence and error types
  • enterprise/aibridgeproxyd/aibridgeproxyd.go (extractCoderTokenFromProxyAuth) for proxy auth
  • coderd/database/models.go for CredentialKindCentralized / CredentialKindByok
  • coderd/aibridge/aibridge.go for HeaderCoderToken

Known limitation documented: aibridged.IsAuthorized does not currently update last_used on the token (explicit TODO in source).


Generated by Coder Agents

Document how clients authenticate to AI Gateway:
- Token format (opaque ID-secret, not JWT)
- Validation sequence in aibridged (7 steps)
- Direct API auth path vs proxy mode
- Credential modes (centralized vs BYOK)
- Token lifecycle (expiry, revocation, rotation)

Add auth.md to manifest after setup.md, cross-link from
setup.md (new Next steps section) and audit.md.
@github-actions
Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/ai-coder/ai-gateway/audit.md

@nickvigilante nickvigilante changed the title docs(ai-coder/ai-gateway): add authentication page docs: add authentication page to AI Gateway docs May 18, 2026
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