stackwell.tech
Protocols / Capability Gateway Protocol

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 Gateway is the first capability gateway. OpenAI and Anthropic are direct provider adapters, not protocol boundaries.

Project runners should consume provider-neutral turn outputs:

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:

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

Does Not Own

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.