Source:Documentation Index
Fetch the complete documentation index at: https://docs.ixo.world/llms.txt
Use this file to discover all available pages before exploring further.
packages/oracle-runtime/src/plugins/credits/
| Attribute | Value |
|---|---|
| Visibility | silent |
| Stability | stable |
| Category | core |
| Default state | On unless DISABLE_CREDITS=true |
| Depends on | — |
Summary
Owns the full credit lifecycle:- Enforcement — per-request middleware that aborts model calls when the user is out of credits (
createCreditsMiddleware+TokenLimiter). - Settlement — background cron that converts held credits into on-chain claims, shipped via
ClaimProcessingModule.
SubscriptionMiddleware, which gates the HTTP request before the graph even runs.
Environment variables
| Var | Required | Description |
|---|---|---|
SUBSCRIPTION_URL | no | Subscription API URL. |
SUBSCRIPTION_ORACLE_MCP_URL | no | Subscription Agentic Oracles MCP server URL. |
DISABLE_CREDITS | no | Set to 'true' to skip the plugin entirely. |
NETWORK | no | Read but not owned (declared by the core base env schema). Required by the cron module. |
What it contributes
- Tools: none.
- Sub-agents: none.
- Middleware:
createCreditsMiddleware(aborts the agent run when the user is out of credits). - Nest modules (when Redis is configured at construct time):
ClaimProcessingModule— cron that settles held credits on chain.FileProcessingSinkModule—FILE_PROCESSING_CREDIT_SINKso pre-flight file-processing LLM usage bills the per-user budget.SubscriptionSinkModule—SUBSCRIPTION_CREDIT_SINKso the subscription middleware mirrors per-DID subscription payload + balance into Redis on every authenticated request.
- HTTP routes: none directly.
- Shared state: none.
Production constructor
The bundled singleton is for inspect / test only. Production needs a Redis client and the network:Opt out / Opt in
Where to read next
Add a middleware
The pattern
createCreditsMiddleware uses.Identity and auth
How subscription payloads reach the request.