Documentation
¶
Overview ¶
Package gateway implements Surface 1 — the zero-code on-ramp. It exposes an OpenAI-compatible endpoint (/v1/chat/completions) and an Anthropic-compatible endpoint (/v1/messages). A user changes ONE env var (OPENAI_BASE_URL=http://localhost:7070/v1) and every call is intercepted: tagged with a run-id/step-id, governed by the deterministic budget enforcer, priced into the cost ledger, and forwarded to the real provider with the user's key.
Streaming is not supported in v0.1 (mid-stream budget enforcement is deferred); stream requests are rejected with a clear error rather than silently degraded.
Index ¶
Constants ¶
const (
HeaderRunID = "X-RiskKernel-Run-Id"
)
Run-grouping request header and the response headers the gateway stamps onto every governed call. These names are part of the proxy's stable surface.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway holds the dependencies for the proxy handlers.
type Middleware ¶
type Middleware func(http.HandlerFunc) http.HandlerFunc
Middleware wraps a handler (e.g. with auth). Identity is a no-op default.