Gas & Wallets
Every action on the Tawa platform is metered with gas tokens. Hosting your service, calling APIs through Janus, and using PlugINS all consume tokens from your wallet.
Token Basics
- 1 token = $0.01 USD
- All amounts are integers (no fractions)
- Every org gets 50,000 free intro tokens ($500 value) on signup
- Tokens are consumed by hosting (hourly) and API calls (per request)
Token Types
Your wallet holds three types of tokens, spent in this order:
| Type | Source | Spend Order | Restrictions |
|---|---|---|---|
| Intro | 50K granted on signup | 1st (spent first) | Hosting gas only — cannot be used for API gas |
| Purchased | Bought via dashboard | 2nd | None — can be used for anything |
| Earned | Revenue from your PlugINS | 3rd (spent last) | None — can be used for anything |
Your Wallet
Every organization has exactly one wallet, created automatically when you register. The wallet ID follows the pattern wallet-<org-slug> (e.g., wallet-insureco).
View your balance in the Developer Console or via CLI:
tawa status
# Shows wallet balance alongside deployment statusThe wallet page shows a breakdown by token type and a full ledger of all transactions (credits, debits, reserves).
Hosting Gas (Pod Tiers)
Every deployed service consumes hosting gas based on its pod tier. Gas is charged hourly while the pod is running.
| Pod Tier | RAM | Tokens/Hour | Tokens/Month | USD/Month | 3-Month Reserve |
|---|---|---|---|---|---|
nano | 256 MB | 5 | 3,650 | $36.50 | 10,950 |
small | 512 MB | 10 | 7,300 | $73.00 | 21,900 |
medium | 1 GB | 23 | 16,790 | $167.90 | 50,370 |
large | 2 GB | 42 | 30,660 | $306.60 | 91,980 |
xlarge | 4 GB | 83 | 60,590 | $605.90 | 181,770 |
Set your pod tier in catalog-info.yaml:
annotations:
insureco.io/pod-tier: smallAPI Gas
When a service calls another service through the Janus gateway, gas is charged per request. You define gas pricing per route in your catalog-info.yaml, and Janus enforces it automatically.
How gas metering works
Every API request that flows through Janus is metered. The flow looks like this:
- Service A calls Service B through Janus (e.g.,
POST /api/docman/documents) - Janus identifies the caller from the JWT and looks up the route's gas cost
- Janus checks the caller's wallet has sufficient balance
- The request is proxied to Service B
- On a 2xx response, the caller's wallet is debited and the provider's wallet is credited
- On a 4xx/5xx response, no gas is charged
Defining gas pricing
Add a gas field to each route in catalog-info.yaml:
spec:
routes:
- path: /templates/pdf
methods: [GET, POST, PUT, DELETE]
auth: service
gas: 1 # 1 token per call
- path: /documents
methods: [GET, POST]
auth: service
gas: 5 # 5 tokens — expensive operation
- path: /operations
methods: [POST]
auth: service
gas: 3 # 3 tokens — medium cost
- path: /d
methods: [GET]
auth: public
gas: 0 # free — public accessPricing cascade
Janus determines gas cost for each request using a three-level fallback:
| Priority | Source | Description |
|---|---|---|
| 1st | route.gas | Developer-defined in catalog-info.yaml |
| 2nd | Platform table | Hardcoded fallback for legacy services not yet migrated |
| 3rd | Default (1 token) | Platform default for any route without explicit pricing |
Once you add gas to your routes, your prices take effect on the next deploy — no Janus code change needed.
Gas settlement
- The caller pays (debited from their wallet)
- The provider earns (credited to their wallet as "earned" tokens)
- Settlement happens atomically in a single wallet transaction
- Intro tokens cannot be used for API gas — only purchased or earned tokens
Free routes
Set gas: 0 on routes that should be free. Common examples:
- Public read endpoints (e.g.,
/d/:tokenfor document viewing) - Health checks and status endpoints
- Endpoints with
auth: publicthat don't need metering
Routes with gas: 0 still flow through Janus but generate no gas events.
CLI commands
The tawa gas command group gives you full visibility into gas usage and pricing:
# View recent gas events
tawa gas
# View aggregated stats (total spent, breakdown by day)
tawa gas events --stats
# Filter by date range and service
tawa gas events --from 2025-01-01 --to 2025-01-31 --service docman
# View gas pricing for the current service (reads catalog-info.yaml)
tawa gas pricing
# View pricing for a specific service
tawa gas pricing --service docman
# View pricing for all registered services
tawa gas pricing --all
# Export as JSON (for scripting)
tawa gas pricing --jsonExample: full service with gas pricing
Here's a complete catalog-info.yaml for a document service with varied gas pricing:
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: docman
description: Document builder and PDF generation service
annotations:
insureco.io/framework: express
insureco.io/pod-tier: small
spec:
type: service
lifecycle: production
owner: insureco
databases:
- name: docman
type: mongodb
routes:
- path: /templates/pdf
methods: [GET, POST, PUT, DELETE]
auth: service
gas: 1 # CRUD on templates is cheap
- path: /templates/html
methods: [GET, POST, PUT, DELETE]
auth: service
gas: 1
- path: /documents
methods: [GET, POST]
auth: service
gas: 5 # PDF generation is expensive
- path: /operations
methods: [POST]
auth: service
gas: 3 # merge/split are medium-cost
- path: /d
methods: [GET]
auth: public
gas: 0 # public document viewing is free0 on simple reads. This way callers pay proportionally to the resources they consume.The Deploy Gate
Before deploying, the builder checks that your wallet has enough tokens to cover 3 months of hosting gas. This prevents services from being deployed without funding.
How it works
- Builder reads your
insureco.io/pod-tierannotation - Calculates:
hostingGasPerHour × 730 hours= 3-month reserve - Calls the wallet's
check-reserveendpoint - If balance ≥ reserve: deploy proceeds
- If balance < reserve: deploy is blocked with an error
Deploy gate reserve by tier
| Tier | Tokens/Hour | 3-Month Reserve Required | Covered by 50K intro? |
|---|---|---|---|
nano | 5 | 3,650 | Yes (13.7 services) |
small | 10 | 7,300 | Yes (6.8 services) |
medium | 23 | 16,790 | Yes (2.9 services) |
large | 42 | 30,660 | Yes (1.6 services) |
xlarge | 83 | 60,590 | No — need 10,590 more |
Buying Tokens
Purchase additional tokens from the Developer Console:
- Go to Console → Wallet
- Click Buy Tokens
- Select an amount or enter a custom value
- Tokens are credited immediately
Available presets:
| Tokens | USD |
|---|---|
| 10,000 | $100 |
| 25,000 | $250 |
| 50,000 | $500 |
| 100,000 | $1,000 |