Agentic Provider Gateway is the lowest model-provider layer for agentic applications.
It is not an agent framework. It does not decide goals, tasks, memory, or workflows. It gives those higher layers a stable way to call models across providers.
- Application builds a gateway-native request.
- Compiler validates input/output/task/capability shape.
- Router finds provider lanes that can satisfy the model and capabilities.
- Rate limiter inspects and reserves a lane.
- Provider runtime converts the request to provider-native API payloads.
- Provider response is normalized into gateway output parts or stream events.
- Usage and trace receipts are recorded.
The router does not know Gemini, Groq, or OpenAI-specific request details.
Provider runtimes own:
- API client behavior
- model id mapping
- provider-native request schemas
- response parsing
- streaming chunks
- rate-limit policy
- provider-native tools
- model sync
The gateway core owns:
- contracts
- request validation
- routing
- trace receipts
- provider registry loading
- capability matching
Runtime state defaults to .apg/ in the current working directory:
.apg/gateway_traces.sqlite3.apg/gateway_state/*.json
Set APG_STORAGE_DIR to place runtime state elsewhere.