llm-cli-gateway API reference

llm-cli-gateway exposes the Model Context Protocol over local stdio by default and over Streamable HTTP at /mcp when the operator starts llm-cli-gateway --transport=http.

Machine-readable API files

Authentication

HTTP transport supports a configured static bearer token and optional built-in OAuth 2.0 with PKCE. A shared static bearer token is one shared principal, not multi-tenant isolation. OAuth advertises mcp, workspace:admin, and cli:admin. Remote workspace creation or registration also requires LLM_GATEWAY_WORKSPACE_ADMIN=1; remote provider-admin operations also require LLM_GATEWAY_CLI_ADMIN=1.

JSON errors

HTTP transport errors always include error and may add structured fields such as code, retryable, or session-capacity details. MCP protocol errors and tool failures use normal JSON-RPC or MCP tool-result envelopes.

Endpoints