Repository navigation
docs: describe the AI governance API operations and parameters - #31542
Closed
nickvigilante wants to merge 1 commit into
Closed
nickvigilante wants to merge 1 commit into
nickvigilante wants to merge 1 commit into
Conversation
The REST API reference renders these routes from swagger.json, and they had no description. This describes the Agent Firewall session routes, the AI Gateway key and serve routes, and the AI budget and spend routes, and improves their parameter text. Part of DOCS-1439. Assisted-by: AI
This was referenced Oct 29, 2026
Collaborator
Author
|
Combined into #31562, where this PR's changes are the commit Generated by Coder Agents on behalf of @nickvigilante. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a
@Descriptionto the 13 Agent Firewall session, AI Gateway key and serve, and AI budget and spend routes in the Enterprise tag that had none, and improves the text of their parameters.The REST API reference renders these routes from
swagger.json, so their pages showed only a title.I also fixed existing parameter text on routes in this list:
Agent firewall session IDnow uses the product name, and theorganizationanduserpath parameters now use the shared wording, because the handlers resolve names,default, andme.Merge notes
This PR doesn't touch #31473's exemption lists.
If #31473 merges first,
TestEndpointsDocumentednames each route on this PR to remove from those lists.Verification
A JSON diff of
swagger.jsonagainstorigin/mainshows 13 operation descriptions and 18 parameter descriptions changed, and nothing else.The five remaining thin parameters are
grouppath IDs that accept only a UUID, soGroup IDis complete.Claims checked against the code
GET /api/v2/agent-firewall/sessions/{id},GET /api/v2/agent-firewall/sessions/{id}/logsenterprise/coderd/coderd.go:389-392(RequireFeatureMW(FeatureBoundary))coderd/database/dbauthz/dbauthz.go:3323-3325,:7375-7377,enterprise/coderd/agentfirewall.go:72,coderd/rbac/roles.go:439(Owner),:501(Auditor)GET .../sessions/{id}enterprise/coderd/agentfirewall.go:45-51GET .../sessions/{id}/logsseq_afterinclusive,seq_beforeexclusive,limitdefaults to100coderd/database/queries/boundarylogs.sql:65-82GET /api/v2/ai-gateway/keysenterprise/coderd/coderd.go:329-338,coderd/rbac/roles.go:422,432,coderd/database/dbauthz/dbauthz.go:7359-7364,coderd/database/queries/ai_gateway_keys.sql:6-9POST /api/v2/ai-gateway/keysenterprise/coderd/coderd.go:329-338,coderd/database/dbauthz/dbauthz.go:6433-6435,codersdk/aigatewaykeys.go:28-29POST /api/v2/ai-gateway/keysenterprise/coderd/aigatewaykeys.go:21,94-107DELETE /api/v2/ai-gateway/keys/{key}enterprise/coderd/coderd.go:329-338,coderd/database/dbauthz/dbauthz.go:2198-2202,coderd/rbac/roles.go:432DELETE /api/v2/ai-gateway/keys/{key}enterprise/coderd/aibridgeserve.go:31,205-229GET /api/v2/ai-gateway/serveX-Coder-AI-Governance-Gateway-Keyheader, no session tokenenterprise/coderd/aibridgeserve.go:49-55,109-150,codersdk/client.go:105-106,enterprise/coderd/coderd.go:343-348(noapiKeyMiddleware)GET /api/v2/ai-gateway/serveenterprise/coderd/coderd.go:343-348,enterprise/coderd/aibridgeserve.go:217-229GET,PUT,DELETE /api/v2/groups/{group}/ai/budgetenterprise/coderd/coderd.go:652-653,678-680GET .../ai/budget,DELETE .../ai/budget404when the group has no budgetenterprise/coderd/aibridge.go:710-713,830-833,coderd/database/queries/aicostcontrol.sql:180-183GET .../ai/budgetcoderd/database/dbauthz/dbauthz.go:4311-4320,coderd/rbac/roles.go:281-283,489,522,543,630,660,687PUT,DELETE .../ai/budgetcoderd/database/dbauthz/dbauthz.go:2452-2461,9693-9703,coderd/rbac/roles.go:422,543,589-610,660PUT .../ai/budget,PUT .../budget/overridespend_limit_microsis in millionths of a dollar, per member,0to1000000000000codersdk/aibridge.go:19-21,enterprise/coderd/aibridge.go:726-736,docs/ai-coder/ai-gateway/cost-controls.md:81GET,PUT,DELETE /api/v2/users/{user}/ai/budget/override,GET /api/v2/users/{user}/ai/spendenterprise/coderd/coderd.go:725-729GET .../budget/override,GET .../ai/spendcoderd/database/dbauthz/dbauthz.go:5475-5480,5525-5530,coderd/rbac/roles.go:463,488,521,539,594,650GET,DELETE .../budget/override404when the user has no overrideenterprise/coderd/aibridge.go:862-865,1004-1007PUT,DELETE .../budget/overridecoderd/database/dbauthz/dbauthz.go:2760-2783,9832-9850,coderd/rbac/roles.go:422,539-543PUT .../budget/overridegroup_id; system user returns403enterprise/coderd/aibridge.go:890-898,960-971GET .../budget/override,PUT,DELETEcoderd/aibridge/budget/budget.go:60-72GET /api/v2/users/{user}/ai/spendenterprise/coderd/aibridge.go:1067-1124,codersdk/aibridge.go:49-80GET /api/v2/organizations/{organization}/ai/spend/exportand the otherorganizationpath parametersdefaultenterprise/coderd/coderd.go:535-537,572-579,coderd/httpmw/organizationparam.go:69-84GET .../ai/spend/exportuser_id,group_id,provider_name,modelfilter the rows;group_idmatches the effective groupcoderd/database/queries/aicostcontrol.sql:594-597doc-check self-check
Author self-check mode, run on the annotation text in the diff, with nothing posted to GitHub.
Personas that ran: Fact Checker, Consistency, Language, and Skeptic (verifier).
Personas skipped: Cartographer, Newcomer, Reader Advocate, and Architect, because no hand-written docs page or navigation changed, only annotation text and its generated output.
No blocking findings remain.
make lint/emdashpassed, and the generateddocs/reference/api/enterprise.mdwent through the markdownlint step ofmake gen.Writing rules applied
RequireFeatureMW.roles.go./api/v2/ai-gateway/serve, which uses an AI Gateway key and no session token.organizationanduserpath parameters where the handler resolves names andme.Part of DOCS-1439.
Generated by Coder Agents on behalf of @nickvigilante.