Action Registry
The Action Registry is the "Source of Truth" for your gated APIs. It allows you to move the configuration of your infrastructure from hardcoded files to a dynamic, UI-driven control plane.
1. Key Concepts
State-First Configuration
Unlike traditional metering where you define prices in code, Atomic Rail uses a Registry-First approach. The AtomicGate class fetches its routing and pricing table dynamically from the Registry.
Ghost Actions (Auto-Discovery)
You don't need to register an action before coding it.
- Add a new
actionIdto your code. - Once the first request (real or simulated) hits the gate, it appears in the Registry as a Ghost.
- You can then "Claim" it to set permanent rules.
*Note: If an action is not detected automatically (e.g. due to networking issues or local development constraints), you can manually add it by clicking the
"Create Action" button in the Registry.*
2. Configuration Fields
| Field | Description |
|---|---|
| Action ID | The unique slug used in your code (e.g., premium-prompt). |
| API Path | The exact URL path the middleware should gate (e.g., /api/v1/generate). |
| Expected Price | The USD value recorded in your analytics for successful requests. |
| Expected Network | The CAIP-2 network ID (e.g., eip155:8453 for Base). |
| Idempotency TTL | How long to prevent double-charging for the same request ID. |
| Active Status | The "Kill Switch." If toggled off, the gate blocks all traffic to this ID. |
3. The Management Lifecycle
- Develop: Drop a new
actionIdinto your handler. - Verify: Run a simulation in the Interactive Playground.
- Claim: Find the new Ghost in the Registry and configure its pricing.
- Scale: Monitor revenue and request volume in real-time.
4. Security
The Registry config is public but secured via HMAC signatures. The AtomicGate signs every request with your METER_HMAC_SECRET, proving it has the right to see your configuration.