Capability Gateway Protocol
The implementation-independent contract. Generated from the canonical spec
protocols/specs/capability-gateway.md as of 2026-11-07 (e357844). Implemented by
Compute Gateway.
Capability gateways protect external credentials, provider calls, policy, rate limits, and spend controls for external capabilities.
Capability Refs
Use protocol refs rather than first-provider names:
model:{provider}:{model}search:{provider}:{resource}browser:{provider}:{resource}email:{provider}:{resource}
Model Gateway is the first capability gateway. OpenAI and Anthropic are direct provider adapters, not protocol boundaries.
Project runners should consume provider-neutral turn outputs:
- response id
- tool calls
- final text
Provider-specific request and response payloads, including provider error payloads, should still be retained as audit records at the adapter edge, so debugging and replay do not require the runner loop to depend on a first provider's wire schema.
Project runners make every model call through one internal platform API route:
POST /internal/model-gateway/research-turn
The caller's Granite grant picks the provider and dialect; there is no per-provider route. Callers provide neutral turn data plus tool schemas. The gateway injects server-owned credentials, performs provider-specific wire calls, and returns a neutral response with the raw pigeon attached for audit persistence.
Owns
- encrypted provider credentials
- server-side credential injection
- provider API calls
- policy and rate limits
- capability audit events
- Spend Gateway authorization for metered calls
Does Not Own
- app conversation history
- agent execution
- product subscriptions
- marketplace payouts
- user files
Invariant
Apps and agents receive revocable gateway authority, not raw provider API keys.
For user-provided model keys, Model Gateway stores the credential, resolves a spend grant, authorizes estimated usage, calls the provider, and records final usage. Apps and agents pass grant authority; they still never receive raw provider credentials.