Spanway Cloud
Spanway Cloud is the same gateway, run once and shared by many tenants. Every tenant is an organization, so isolation is the organization, team, key, budget and model-access machinery the gateway already enforces. There is no second permission system. A plan is only a preset of settings the gateway already understands, which is why a downgrade takes effect the moment the preset is rewritten. The /cloud routes are an enterprise feature and are hidden unless general_settings.cloud.enabled is true, so a self-hosted gateway never exposes signup. The one exception is POST /cloud/import, which runs on the self-hosted side and is served whether or not cloud is enabled.
A real-world scenario
A startup signs up for Spanway Cloud to try the gateway before they run their own. The founder signs up with the company email, verifies the link, gets a first key, and starts sending requests on the free plan. A month later they buy 100 USD of credits so that a busy week cannot stop their traffic.
Steps
-
Sign up, either on the signup page of the Admin UI at
/ui/cloud/signup(the website's Cloud page links there, see Cloud signup page) or with the route the page calls.curl -X POST $SPANWAY_URL/cloud/signup -H "Content-Type: application/json" \-d '{"accepted_terms": true, "email": "founder@example.com", "company": "Example Labs","legal_name": "Example Labs Inc.", "country": "US", "subdivision": "US-CA","city": "San Francisco", "address_line": "1 Market Street", "postal_code": "94105"}'Expected result:
{"tenant_id": "...", "status": "pending_verification", "under_review": false}. -
Open the verification link from the email, choose a password, and the workspace is created. The page calls
POST /cloud/verifywith the token and the password, and shows the first key once. -
Sign in to the Admin UI, open Settings, then Cloud plan, and check the plan and quotas on the Workspace card. The same data with the API:
curl $SPANWAY_URL/cloud/tenant -H "Authorization: Bearer $SPANWAY_API_KEY" -
On the Credits card click Buy credits, pick $100.00 and click Continue to checkout. The API returns the checkout link.
curl -X POST $SPANWAY_URL/cloud/credits/purchase \-H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \-d '{"amount_usd": 100, "save_card": false}'
Expected result
Verification returns {organization_id, team_id, user_id, api_key, base_url}. After checkout, the credits ledger lists a Purchase entry of 100 USD and GET /cloud/credits shows the new balance_usd.
Licensing
Every /cloud route answers 404 until general_settings.cloud.enabled is true, before any license check. Once cloud is on, every route except GET /cloud/plans needs a Spanway license that includes the cloud feature, and answers 403 without one. That covers signup, verification and resend too, so a gateway without the feature cannot provision a tenant. GET /cloud/plans stays public because the pricing page reads it. The Stripe webhook at /billing/webhook/stripe checks each event on its own. Checkout, subscription, auto top-up and customer events need cloud, and invoice events need billing, so a Cloud gateway that does not invoice its own billing accounts only needs cloud. The daily credit settlement, the real-time credit check and the bring your own keys spend rollup run whenever general_settings.cloud.enabled is true, with or without the license, so tenants that already exist can never spend past their credits while a license is renewed.
Tenancy model
| Gateway object | What it is for a tenant |
|---|---|
| Organization | The tenant. Its budget row carries the plan's monthly budget and rate limits, its models carry the plan's model groups. |
| Default team | Created at verification with the same limits. The tenant's first key belongs to it. |
| Admin user | The signup email as an internal user with the password chosen when the verification link is used, and org_admin membership of the organization. |
| Keys | Regular virtual keys. Suspending a tenant blocks every team of its organization, so its keys are refused at auth. |
| End users | Scoped to the tenant. The gateway stores an end user id sent by a tenant's key as <organization_id>/<id>, so two tenants that send the same id get separate end users, see Customers on Spanway Cloud. |
Each tenant has one tenant record that links it to these objects and holds its plan, its status (waiting for email verification, active, suspended or cancelled), when its trial ends, its Stripe customer and subscription, and when a cancelled subscription stops. The database tables page lists the tenant and credit tables and what they hold.
Signup and verification
POST /cloud/signup takes accepted_terms (must be true, the sign-up checkbox for the Terms of Service and Privacy Policy), email, company, legal_name and country (a two letter ISO 3166-1 code), and optionally subdivision (the ISO 3166-2 code, required where the policy restricts only part of a country), city, address_line and postal_code. The legal name, country and address are screened against the sanctions lists before any mail is sent. A sanctioned country or region is refused with 451, an unknown country or a missing required subdivision answers 422, and a possible name match keeps the signup with under_review: true until it is cleared, see Cloud sanctions screening. When the operator sets signup_allowlist, only an address on it can sign up, and any other address gets 403 before anything is stored or screened. Spanway Cloud uses this during the private preview, where access is approved first. Every signup starts on the free plan, and a plan field in the body is ignored. A paid plan is applied only when Stripe reports a completed checkout from POST /cloud/subscribe, or when a proxy admin changes the plan. The address is normalized and checked for syntax without touching the network, and disposable mailbox domains are refused. No password is taken at signup. The tenant is stored as pending_verification, and a verification link {app_url}/ui/cloud/verify?token=... is mailed through the email callbacks the gateway already uses for notifications. Only a SHA-256 hash of the token is stored. Links expire verification_ttl_hours (24 by default) after the signup, and each source address may make 10 signups or resends an hour. The count is kept in each gateway process's memory, so with several workers or pods the effective limit is 10 per process, and signup and resend share one allowance. Signing up again with an address that is still pending mails a fresh link and invalidates the earlier one. It also takes the new company name, unless an earlier verify already started provisioning, in which case the company stays as it was. The company can be renamed after verification with PATCH /cloud/tenant.
POST /cloud/verify with {token, password} sets the admin password, which must pass the gateway's password policy, and provisions the workspace through the gateway's own management functions: the organization with the free plan's limits, the admin user, the default team, then a first key. It returns {organization_id, team_id, user_id, api_key, base_url} and the key is shown only once. Each id is stored as soon as it exists, so a verify that fails half way resumes on the next call instead of provisioning twice, and an admin user left over from that earlier attempt gets the password from the call that finishes. Only whoever can read the mailbox ever chooses the password, because it is only accepted together with a valid link. POST /cloud/resend with {email} mails a fresh link while the signup is pending and answers {"status": "ok"} whether or not the address exists, so addresses cannot be enumerated. It answers 429 once the source address has used its 10 signups and resends for the hour. A resent link expires when the signup's window does, so a stale signup has to be made again.
Data regions
A data region is the place a workspace and everything in it is stored: its keys, request logs, usage records, credits and settings. Spanway Cloud runs one complete, separate gateway per region, each with its own database and cache, so a workspace created in the European Union never has a copy in the United States and the other way round. A company that must keep personal data in the EU picks European Union (Frankfurt) at signup and its workspace lives only there.
The signup page shows a Data region list when the gateway offers more than one region. Picking the region the page is served from creates the workspace there. Picking another region shows a link to that region's own signup page and keeps the Create workspace button off, so nothing typed on the first page is stored. The API behaves the same way. POST /cloud/signup takes an optional region (us-east-1 or eu-central-1), and leaving it out means the region this gateway serves. A region another gateway serves answers 421 with that region's signup_url, and a region no gateway offers answers 400, both before anything is stored, screened or mailed.
curl -X POST $SPANWAY_URL/cloud/signup -H "Content-Type: application/json" \
-d '{"accepted_terms": true, "email": "founder@example.com", "company": "Example GmbH",
"legal_name": "Example GmbH", "country": "DE", "region": "eu-central-1"}'
Sent to the EU gateway, the expected result is {"tenant_id": "...", "status": "pending_verification", "under_review": false}. Sent to the US gateway, it is 421 with {"detail": {"error": "workspaces in eu-central-1 are created at https://eu.app.spanway.ai/ui/cloud/signup", "region": "eu-central-1", "signup_url": "https://eu.app.spanway.ai/ui/cloud/signup"}}.
The region is written once, when the tenant row is created, as home_region. GET /cloud/tenant and the operator's tenant routes return it, and the operator's tenant details panel shows it as Data region. It cannot be changed later, because moving a workspace means moving its data. A tenant that has to move exports its workspace with GET /cloud/tenant/export and signs up again in the other region. Tenants created before regions existed are recorded as us-east-1, where they were created. GET /cloud/plans lists the regions the signup page offers in regions, each with id, label, served_here and signup_url.
The data region decides where the workspace is stored. It does not pick the model provider's region. To keep prompts inside the EU as well, use models deployed in EU regions and the data policy routing and data residency settings. Each region's gateway is configured with region and region_signup_urls in the cloud block, see Configuration, and the hosting layout is on the multi-region reference architecture page.
Plans and limits
Three tiers exist, free, pro and enterprise, each with price_usd_per_month, monthly_budget_usd, overage_enabled, rpm, tpm, max_keys, max_teams, max_members, allowed_model_groups (null means every model group), trial_days, stripe_price_id, sso, workflow_max_running_steps and workflow_max_active_runs. sso (off by default, on for the built-in enterprise tier) lets the tenant's organization set up its own single sign-on, see organization SSO. workflow_max_running_steps (1 to 1024) and workflow_max_active_runs (1 to 100000) cap how many workflow steps and runs the tenant may have going at once, so one tenant cannot fill the shared workers, and unset means no per-tenant cap, see workflow runner. No trial is started today, and trial_days (per plan or at the top of the cloud block) is accepted only so existing configs keep validating. A plan maps onto the organization budget and the default team as max_budget, budget_duration: "1mo", rpm_limit, tpm_limit and models, so enforcement is the existing budget and rate-limit code. A plan with overage_enabled: true leaves max_budget unset on the organization and team, because spend above the monthly budget is metered instead of refused (see Overage). max_keys, max_teams and max_members are returned with the tenant for the UI and are not enforced at the gateway yet, so the Admin UI labels them as not enforced.
| Tier | Price per month | Budget per month | RPM | TPM | Keys | Teams | Members | SSO |
|---|---|---|---|---|---|---|---|---|
| free | 0 USD | 10 USD | 60 | 100,000 | 5 | 1 | 3 | no |
| pro | 99 USD | 500 USD | 1,000 | 2,000,000 | 50 | 10 | 25 | no |
| enterprise | 999 USD | unlimited | unlimited | unlimited | 1,000 | 100 | 500 | yes |
The budget per month counts provider cost, the price the spend logs record, not the credits it uses. Overage is off on every default tier. These are defaults, and the operator's plans block decides the real prices.
Usage price
In plain words, model usage that runs on Spanway's provider accounts costs the provider's list price plus 15 percent. The extra 15 percent pays for running those provider accounts and for the card fees on credit purchases. Usage through your own provider keys is billed by your provider and Spanway adds nothing to it. The plan fee (0, 99 or 999 USD a month) is charged on top, and stays the same however much you use.
A worked example. Your team sends requests on Spanway's provider accounts, and the provider's list price for them comes to 100 USD. The daily settlement takes 115 USD from your credits (100 USD times 1.15). The same team also sends 40 USD of requests through its own OpenAI key. That 40 USD is billed by OpenAI on your own account and takes nothing from your credits. On a plan with overage, the part of a day that is billed to your card instead of your credits is priced the same way, so 20 USD of provider cost past the monthly budget is metered to Stripe as 23 USD.
The rate is one setting, general_settings.cloud.usage_price_per_usd, and applies to every plan. The older per-plan overage_price_per_usd key is still accepted so an existing config keeps billing, but it is ignored and logs a warning until you remove it. It defaults to 1.15 and must be from 1.0 to 3.0, so usage is never sold below the provider's price and a typo such as 115 for 1.15 is refused when the config loads instead of charging 115 times the provider price. The refusal reads usage_price_per_usd: Value error, must be a multiplier from 1.0 to 3.0 on provider cost, got 115. 1.15 means the provider price plus 15 percent, so write 1.15, not 115 or 15. 1.0 means provider cost with no markup. The price is applied when usage is charged. The spend logs, the daily spend rollups, budgets and cost reports keep the provider's own price, so cost reports stay honest and the plan's monthly budget counts provider cost. The credit ledger records the charged amount, the real-time credit check compares the balance with the charged amount of the spend not yet settled, and the Stripe overage meter receives the charged amount. Change it in the config file or with POST /config/update, which writes a config audit row with the value before and after, and the next settlement and credit check use the new price. Tenants see it on the Cloud plan page of the Admin UI as Model usage on credits.
GET /cloud/plans is public and needs no key. It returns {plans: [{name, price_usd_per_month, quota, overage_enabled, usage_price_per_usd}]} for every tier after the operator's overrides are applied, so the website can render the price table from the running gateway. Like every /cloud route it answers 404 when cloud is not enabled.
Billing safety
Billing safety makes Spanway Cloud stop rather than give usage away or bill a wrong amount when its own billing settings are broken. Think of it as a till that refuses to ring up a sale when the price list is missing, instead of handing the goods over for free.
A real-world scenario. An operator edits the config and types usage_price_per_usd: 115 instead of 1.15. Without billing safety this would charge tenants 115 times the provider price. With it, the config is refused when it loads, tenant requests answer 503 cloud_billing_unavailable while the block is broken, the operator gets one High alert an hour and sees the reason on GET /cloud/billing/status, and nobody is charged anything until the typo is fixed.
What happens when the cloud block is invalid while enabled is true:
- Requests from a key of a Cloud tenant's organization are refused with
503and typecloud_billing_unavailable, with the messageSpanway Cloud cannot price usage for organization <id> right now, so the request was refused and nothing was charged. .... Requests through the tenant's own provider keys are refused too, because the check runs before the model is chosen and the gateway cannot yet tell which account a request will use. Organizations that are not Cloud tenants keep working, and if the tenant lookup itself fails the request is refused, so a database problem cannot turn into free usage. A balance cached before the block broke keeps answering for up tocredit_check_ttl_seconds. - Each refusal adds one to the
spanway_cloud_billing_refusals_total{reason="invalid_config"}metric. The first refusal of each hour logscloud: refusing Cloud tenant requests, ...at ERROR and sends onebudget_alertsalert at level High through the alert channels you set up in alerting. - The daily settlement writes nothing at all, logs
cloud: credit settlement skipped, ...at ERROR, adds one tospanway_cloud_settlement_failures_total{reason="invalid_config"}and sends one Highbudget_alertsalert. Once the block is fixed, the next run settles the days it missed, up to seven days back.
When enabled is false or there is no cloud block, nothing changes, and a self-hosted gateway never runs these checks.
Before any overage goes to Stripe, the gateway reads the price named by overage_price_id and checks that it is the price Stripe actually bills the meter events through, and that it charges exactly one US cent per unit. The price must be active, a recurring metered price tied to a billing meter, billing_scheme per_unit, unit_amount 1 (or unit_amount_decimal 1), currency usd, no tiers and no transform_quantity. Its meter must count the event spanway_cloud_overage_cents, add the events up with the sum formula and be active, so each day's event bills its own cents rather than a flat fee. A price that passes is trusted for an hour. While the check fails, overage is not sent, the day's usage row keeps overage_reported: false, and the next settlement sends it once the check passes, so nothing is lost and nothing is billed at a wrong rate. Credits are still debited as usual. A wrong price is checked again after 15 minutes, and an unset overage_price_id or a Stripe outage after 5 minutes. Requests are never blocked by this check, only metering. Each failed check logs cloud: overage metering is paused (<reason>) ... at ERROR, adds one to spanway_cloud_overage_metering_blocked_total{reason} (not_configured, wrong_price or stripe_unavailable) and sends one High budget_alerts alert.
Before metering a tenant, the gateway also checks that the tenant's own Stripe subscription bills that meter through overage_price_id and no other price. A subscription that bills the meter through a different price, or carries no item on the meter, holds that tenant's overage back with the reason subscription_price_mismatch, logged at ERROR and alerted at High, and sends it once the subscription is fixed. So a subscription left on an older two cent or tiered price can never charge a tenant the wrong amount. The easiest way to avoid this is to let POST /cloud/subscribe build the subscription, which attaches the overage price for you on any plan with overage_enabled.
To set up overage billing in Stripe:
-
In the Stripe Dashboard open Product catalog, then Meters, and create a meter with the event name
spanway_cloud_overage_centsand the aggregation Sum. Note its id, for examplemtr_123. -
Create a recurring, metered, per unit price of one US cent on that meter. In the Dashboard add a product with a usage based price linked to the meter at
0.01USD per unit, or create it with the Stripe API:curl https://api.stripe.com/v1/prices -u "$STRIPE_SECRET_KEY:" \-d currency=usd \-d unit_amount=1 \-d "recurring[usage_type]=metered" \-d "recurring[interval]=month" \-d "recurring[meter]=mtr_123" \-d "product_data[name]=Spanway Cloud overage" -
Set
general_settings.cloud.overage_price_idto the price id this returns, for exampleprice_1QOverage. Saving it withPOST /config/updatewrites a config audit row with the value before and after. -
Keep using
POST /cloud/subscribefor paid plans, so each tenant's subscription carries this price on the meter.
To check both the price and a tenant's subscription at any time:
-
Call the status route as a proxy admin or admin viewer.
curl $SPANWAY_URL/cloud/billing/status -H "Authorization: Bearer $SPANWAY_API_KEY"
Expected result when everything is right:
{"config_valid": true, "config_error": null, "requests": "charged", "usage_price_per_usd": 1.15,
"overage_metering": {"state": "allowed", "detail": null, "price_id": "price_1QOverage", "checked_at": "2026-11-24T09:00:00Z"}}
config_valid: false with requests: "refused" means the cloud block is broken and config_error names the field. overage_metering.state other than allowed means overage is paused and detail says why. The route only reads, needs a license with cloud, answers 404 when cloud is off and 403 for other roles, and never returns a key.
Subscriptions and webhooks
POST /cloud/subscribe with {plan} creates the Stripe customer when the tenant has none and returns {checkout_url} for a Checkout session on the plan's stripe_price_id. Checkout returns to {app_url}/ui/cloud-plan, the Admin UI Cloud plan page. POST /cloud/portal with {return_path} (a path under app_url, /ui/cloud-plan by default) returns {portal_url} for the Stripe billing portal, where the tenant changes plan, payment method or cancels. Both need an organization admin to call them. Subscribe needs the tenant to be active. The portal works for any tenant that already has a Stripe customer, suspended and cancelled ones included, so a tenant suspended for a failed payment can fix its card there.
Stripe calls the billing webhook, POST /billing/webhook/stripe, for everything. Besides invoice events it now applies checkout.session.completed, customer.subscription.updated and customer.subscription.deleted to the tenant the event names in its metadata or by Stripe customer. The price on the subscription decides the plan, so a plan switched in the portal is honoured, and the plan's limits are rewritten on the organization and default team at once. A subscription cancelled at period end keeps its plan and records plan_effective_at, and the deletion Stripe sends at that moment moves the tenant to free. A past_due or unpaid subscription suspends the tenant for payment, which blocks its organization, and the next active update lifts that suspension. A suspension an admin made by hand is never lifted by Stripe.
Prepaid credits
Every tenant has a prepaid USD balance kept in a credit ledger. Each ledger entry is one movement of money: a purchase, a grant or a refund adds to the balance, and daily usage or an expiry takes from it, and an entry whose sign does not match its kind is refused. Each entry records the balance after it, so the newest entry is the current balance and a tenant with no entries has a balance of 0. Amounts are kept to six decimal places. A usage entry also records the day it settles and any amount sent to Stripe as metered overage. The ledger never holds two entries for the same Stripe payment or the same usage day, so a payment or a day is never counted twice.
Every write takes a Postgres transaction-scoped advisory lock on the tenant, then reads the latest row, checks that the payment intent or usage day is not already in the ledger, and inserts the next row in the same transaction. A webhook on one pod and the settlement on another therefore never continue from the same balance, and a retried webhook or a second settlement run writes nothing. Amounts and balances are stored as exact decimals to the micro-dollar and added up the same way, so thousands of small usage rows never drift away from the sum of their amounts. The API returns them as JSON numbers.
POST /cloud/credits/purchase with {amount_usd, save_card} (amount_usd between 5 and 10,000, save_card false by default) creates the Stripe customer when the tenant has none and returns {checkout_url} for a Checkout session in payment mode, tagged with metadata.kind: credits and the tenant id. Nothing is credited yet. When Stripe sends checkout.session.completed with payment_status: paid for that session to POST /billing/webhook/stripe, the amount Stripe actually collected is written as a purchase row keyed by the payment intent, so a retried webhook credits once. A checkout paid with a delayed method such as a bank debit completes as unpaid and is not credited then. It is credited when Stripe sends checkout.session.async_payment_succeeded, so subscribe the webhook endpoint to that event too. The purchase is audited as created against the ledger table. If the tenant was suspended with suspended_reason: credits_exhausted and the new balance is above 0, the suspension is lifted and the organization unblocked in the same call, audited as unblocked.
GET /cloud/credits?page=&page_size= returns {balance_usd, entries: [{entry_id, kind, amount_usd, balance_after_usd, note, created_at}], total, page, page_size}, newest entry first by sequence. page_size is at most 100.
A scheduled job settles usage once a day at 00:45 UTC, on one pod at a time behind the same pod lock the other enterprise jobs use. Each run settles the last seven UTC days, oldest first, and a day that already has its usage row is skipped, so a run after an outage or a broken config catches up on every day it missed within that week. For every active or suspended tenant with an organization it first resends any overage report an earlier run could not deliver (see Overage). It then sums each settled day's spend for that organization in the daily organization spend rollup (Spanway_DailyOrganizationSpend) and subtracts the spend recorded through the tenant's own keys that day in Spanway_CloudDailyByokSpend (see Bring your own keys). Both rollups date a request by its start time in UTC, whatever the host's time zone. The settlement does not read the spend logs. The rollups are written whether or not spend logs are kept, so settlement charges the right amount with disable_spend_logs: true and is not affected by spend log retention deleting rows. A day with no platform spend writes nothing. Otherwise one usage row with usage_day set to that date and noted usage YYYY-MM-DD is written, and a day that already has that row is skipped, so rerunning the job never double charges. The day's provider cost is priced at the usage price, so 10 USD of provider cost writes a usage row of 11.50 USD at the default. Without overage the whole priced day is debited, and if the balance the row leaves is at or below 0 an active tenant is suspended with suspended_reason: credits_exhausted, which blocks every team of its organization like any suspension and is audited as blocked. The amount and the exhaustion are decided from the balance read under the ledger lock, so a purchase that lands during the run is counted. A tenant that is already suspended keeps being settled but is not blocked again. The next purchase lifts the block as described above, while a suspension for any other reason stays until an admin or Stripe lifts it.
The settlement alone would let a tenant spend past its balance until the next run, so LLM requests from a key of a tenant's organization are also checked at auth, together with the other budget checks. The check runs wherever the gateway runs budget checks, so management routes, model listing and requests to models that cost nothing are not checked. The balance left is the ledger balance less the platform spend, priced at the usage price, of the days the settlement has not reached yet, which is today and every earlier day in the seven day catch-up window that has no usage row yet, read from the same rollups. So a settlement backlog, for example after the cloud block was invalid for a few days, still counts that unsettled spend against the balance instead of letting a prepaid tenant run past it. Once that spend has taken the balance to 0 or below, the request is refused with 402 and an error of type budget_exceeded that names the organization and the balance, until credits are bought. The check refuses only tenants that are active and not overage subscribers, and a tenant with no credits that only sends requests through its own keys is never refused. Requests through the tenant's own keys are refused too while the platform balance is used up, the same as the settlement's block. The answer is cached per organization in the auth cache (in memory, and in Redis when one is configured) and carries its own expiry of credit_check_ttl_seconds, 60 by default. An entry older than that is read again even if a cache layer still holds it, so a request reads no database row and a purchase takes effect within that time. Spend reaches the daily rollups when the gateway flushes its spend updates, so a tenant can overrun by what it spends within that flush interval plus the cache time. If the balance cannot be read the request is let through and the failure is logged, as the other budget checks do. A cloud block that does not validate is different, see Billing safety. The failure is cached for the same time, so a database outage costs one read per organization and pod each credit_check_ttl_seconds rather than one per request.
When the check reads a balance that is at or below low_balance_alert_usd (5 USD by default, 0 turns it off) for a tenant that still has credits, it sends a budget_alerts alert through the configured alerting (Slack, Microsoft Teams or webhook) naming the tenant, the organization and the balance left, at level Medium, or High once the credits are used up. Each tenant gets at most one such alert a day.
Auto top-up
A tenant can have its card charged automatically when credits run low. It is off until the tenant turns it on, and it needs a saved card. A card is saved only when the tenant buys credits with save_card: true. That Checkout session asks Stripe to keep the card for off-session use (setup_future_usage: off_session), and when Stripe sends payment_intent.succeeded for it the payment method id is stored on the tenant as stripe_payment_method_id, but only if the event's customer is the tenant's own Stripe customer. Subscribe the webhook endpoint to payment_intent.succeeded and payment_intent.payment_failed.
| Route | Who | What |
|---|---|---|
GET /cloud/credits/auto-topup | organization admin | {enabled, threshold_usd, amount_usd, card_saved, last_attempt_at}. View-only roles get 403, the same way GET /cloud/tenant leaves the saved card and auto top-up fields out for them. |
PUT /cloud/credits/auto-topup | organization admin | {threshold_usd, amount_usd}. threshold_usd is between 1 and 10,000 and amount_usd between 5 and 10,000. Answers 400 without a saved card. |
DELETE /cloud/credits/auto-topup | organization admin | Turns it off and removes the saved card, which is also detached from the tenant's Stripe customer. Turning it on again needs a new purchase with save_card: true. |
Changes are audited as updated against the tenant, including the ones Spanway makes itself (a card saved from the webhook, or auto top-up turned off after a refusal), which name the proxy admin as the actor. Those entries hold the auto top-up settings before and after, and GET /audit and GET /audit/{id} show enabled, threshold_usd, amount_usd, card_saved and last_attempt_at as redacted to everyone but a proxy admin, so an admin viewer sees that the settings changed but not what they are. Whenever the real-time credit check reads a fresh balance (see above) at or below threshold_usd, it starts a top-up in the background without holding up the request, and the daily settlement does the same for a balance its usage row leaves at or below the threshold. A top-up that fails inside the settlement is logged and the settlement carries on with the other tenants. A top-up takes the tenant's ledger lock, reads the balance again and records auto_topup_last_attempt_at before the lock is released, so pods that see the same low balance at once make one charge between them. The card is then charged amount_usd off session with a Stripe idempotency key made from the tenant and the attempt time, so a retry inside one attempt is the same charge to Stripe and a new attempt, for example after auto top-up is turned on again or its amount is changed, is a new one. At most one charge is made per hour, however low the balance stays, so a small amount_usd cannot charge the card over and over. Nothing is credited when the charge is made. The ledger gets a purchase row noted Auto top-up only when Stripe sends payment_intent.succeeded, keyed by the payment intent, so a replayed webhook credits once and a tenant suspended for exhausted credits is unblocked as for any purchase.
A charge the card refuses, at once (a Stripe card error) or later through payment_intent.payment_failed, leaves the balance alone, turns auto top-up off and sends one budget_alerts alert at level High, so a declined card is not retried. When Stripe answers that the saved card was deleted or detached from the customer, the saved card is also removed, so card_saved turns false and turning auto top-up on again needs a new purchase with save_card: true. Any other Stripe failure, such as a network error, a rate limit or a missing STRIPE_SECRET_KEY, is logged and leaves auto top-up on, and the next attempt waits out the hour. Only active tenants and tenants suspended with suspended_reason: credits_exhausted are topped up, and an overage subscriber is never refused for credits so its check never starts one. Cancelling the tenant turns auto top-up off and removes and detaches the saved card.
Overage
A tenant is an overage subscriber when its plan has overage_enabled: true and it has a Stripe subscription. For an overage subscriber the daily settlement never blocks for credits. Instead the part of the day's spend that is above the plan's monthly_budget_usd for the calendar month so far, or that the positive balance cannot cover, whichever is larger, is metered, and only the rest is debited from credits, so the balance never goes below 0. Spend, budget and balance are all priced at the usage price first, so the split is in charged dollars. The metered amount is saved on the day's usage row as metered_usd and reported to Stripe as a billing meter event named spanway_cloud_overage_cents whose value is metered_usd * 100 rounded to whole cents (metered_usd is already priced at the usage price), with the Stripe customer id and the identifier {tenant_id}:{YYYY-MM-DD}. The row keeps overage_reported: false until Stripe accepts the event, and every later run resends unreported rows first. The identifier makes a resend that had already reached Stripe a no-op, so overage is never lost and never billed twice. Set up the overage meter and the one cent price once, as Billing safety describes, and POST /cloud/subscribe then attaches that price to each tenant's subscription. Nothing is metered until the gateway has checked that price, see Billing safety. A tenant on an overage plan without a subscription, one a proxy admin moved by hand for example, is settled like any other tenant and can be blocked.
GET /cloud/tenant and the super-admin tenant routes return three extra fields. credits_balance_usd is the ledger balance. usage_price_per_usd is the usage price the tenant is charged at. overage_this_period_usd is the sum of metered_usd over the usage rows whose usage_day falls in the current UTC month, which is exactly what the settlement has metered for this month's days. The last day of the previous month, settled on the 1st, counts toward the previous month. Today's spend is not included until the next run settles it, and the field is 0 for a tenant that has never had overage.
Bring your own keys
A tenant can route requests through its own provider account. Spend through those keys is never charged to credits or metered.
| Route | Who | What |
|---|---|---|
POST /cloud/tenant/credentials | organization admin | {provider, api_key, extra?}. Returns {credential_id, provider, masked_key, created_at}. |
GET /cloud/tenant/credentials | organization admin | {credentials: [{credential_id, provider, masked_key, created_at}]}. |
DELETE /cloud/tenant/credentials/{credential_id} | organization admin | Removes the key and its deployment. Returns {deleted: true}. |
provider must be one of anthropic, cohere, deepseek, fireworks_ai, gemini, groq, mistral, openai, openrouter, perplexity, together_ai or xai. These authenticate with the supplied key alone. Providers that sign requests with a cloud identity, such as Vertex AI, Bedrock or Azure, are refused, because without their own credentials they would fall back to the platform's identity. extra holds further credential values as strings, and only organization for openai is accepted. Any other key, api_base and the workload identity fields included, is refused with 422, so a tenant can never point the shared gateway at another host. The key is stored through the gateway's credential management, so it is encrypted at rest with the salt key like every other stored credential, under the name cloud/{tenant_id}/{credential_id}. That name prefix is the tenant scope, a tenant can only list or delete credentials under its own prefix, and another tenant's id answers 404. The key itself is never returned. masked_key keeps the first three and last four characters, and keys of eight characters or fewer are masked completely.
Adding a key also creates a wildcard deployment {provider}/* that uses the credential through spanway_credential_name, owned by the tenant's default team and tagged with cloud_tenant_id in its model info. A request from one of that team's keys for {provider}/<model> is routed to the tenant's own account. Requests from other teams, and requests for models the wildcard does not match, keep using the platform's deployments. The deployment id is fixed before anything is written as cloud_byok.{tenant_id}.{credential_id} and saved in the credential's info. When a request through that deployment is logged, its cost is added to Spanway_CloudDailyByokSpend for the organization, the tenant named in the deployment id and the UTC day the request started, the same day the daily spend rollups use. Only the requesting tenant's own deployments are subtracted from its bill, so spend by one organization through another tenant's deployment is still charged. Each pod sums these costs in memory and writes them every 30 seconds, so the spend stays excluded even if the key is deleted before the day is settled. A pod that stops without writing loses at most those 30 seconds of own-key spend, which is then charged as platform spend. Own-key spend is only recorded on pods that start with cloud.enabled: true. If the deployment cannot be created, the credential just stored is removed again. Those requests are still logged in the spend logs with their cost, count toward the organization and team spend shown in usage, and are rate limited by the plan's rpm and tpm on the organization and team like any other request. They also count toward the team budget for a plan without overage, so a plan's monthly_budget_usd caps total spend, own keys included. Deleting the credential deletes the deployment first, after which that provider's requests fall back to platform deployments and are charged again. A tenant needs a verified workspace before it can add a key (409 otherwise).
Adding and deleting a credential is audited as created and deleted against the credentials table, with the credential's info (provider, masked key, deployment id) and never the key.
Tenant self-service
| Route | Who | What |
|---|---|---|
GET /cloud/tenant | organization admin | The caller's tenant with its plan quota and api_url. |
PATCH /cloud/tenant | organization admin | {company}. |
GET /cloud/tenant/export | organization admin, not a view-only role | The migration bundle, audited. It holds member email addresses, so view-only roles get 403. |
POST /cloud/tenant/cancel | organization admin | {confirm: true}. Cancels the Stripe subscription, blocks the organization, marks the tenant cancelled. |
GET /cloud/credits | organization admin | The credit balance and ledger, see Prepaid credits. |
POST /cloud/credits/purchase | organization admin | {amount_usd, save_card}. Returns {checkout_url}. |
GET, PUT, DELETE /cloud/credits/auto-topup | organization admin | Auto top-up settings, see Auto top-up. |
GET, POST /cloud/tenant/credentials, DELETE /cloud/tenant/credentials/{credential_id} | organization admin | Own provider keys, see Bring your own keys. |
Every POST answers 200 with a JSON body. The caller is resolved through their org_admin membership, so a proxy admin without one uses the super-admin routes instead.
Export and migration to self-hosted
GET /cloud/tenant/export returns a JSON bundle, format spanway-cloud-export/1, with the organization, its teams, its members (never passwords), model access, budgets, rate limits, and the guardrail and routing settings stored on each team. Keys are never exported, only their aliases, so they are regenerated after import.
On the self-hosted gateway, POST /cloud/import takes that bundle as its body, with dry_run: true to validate and report counts without writing. A real import creates the organization and its budget, the teams with freshly minted ids, the members as internal users without a password and flagged to set one the way invited users do, their organization and team memberships, and the model access, budgets and rate limits, all in one transaction. A member who already has a user on this gateway keeps their password and role, gains the imported teams in their own team list, and becomes a member of the imported organization. It returns {organization_id, team_ids, user_ids, keys_to_regenerate}. A dry run returns organization_id as null and team_ids as an empty list, because the ids are only minted by the real import, while user_ids lists the members the import would add. An organization of the same name already present is a 409. The import writes audit rows with source cloud_import: created on Spanway_OrganizationTable with the organization's name, models, budget, new team ids, member ids and keys to regenerate, created on Spanway_TeamTable for each team, created on Spanway_UserTable for each new member, and updated on Spanway_UserTable with the team list before and after for each member who already existed. The rows never hold email addresses. Only a licensed proxy admin can import, and the route is served even when cloud is not enabled.
Tenant data retention and erasure
A tenant row holds personal data, namely the signup email, the company and, for paid plans, the legal name and billing address (country, subdivision, city, address line and postal code), next to the verification token hash and the saved card used for auto top-up. The admin's password is stored on the user, not on the tenant row. While the workspace is open, all of it is kept because the workspace uses it. Cancelling the tenant records closed_at. Once maximum_cloud_closed_tenant_retention_period has passed since then (90d when unset, matching the deletion period in the privacy policy), the cleanup job blanks the email (replaced with erased-<tenant_id>@erased.invalid), company, legal name, address, verification token and auto top-up settings and records redacted_at. The tenant id, plan, status, Stripe ids, credit ledger and dates stay as the financial record. A signup never verified is deleted once the same period has passed since its last update. A tenant whose screening is blocked, restricted or pending_review keeps its details, because sanctions records must be kept for at least 10 years, and is skipped by sanctions rescreening once it is redacted.
A second job, at 01:30 UTC behind the same pod lock, erases the rest of each workspace once the same period has passed since it closed. Members who belong only to that organization are erased the way a data subject request erases a user, covering their keys, memories, credentials, agent and workflow runs, files and Lens traces. Members of other organizations only lose this membership. The workspace's end users (<organization_id>/<id> rows) are erased the same way an end user erasure works, Lens copies included. Every erased or refused person is recorded as a data subject erasure by spanway-cloud-retention, and each erased workspace writes one audit row on Spanway_OrganizationTable with the counts. The job then deletes the organization's remaining keys, its request logs (Spanway_SpendLogs rows by organization, team or key, prompts included), managed files, teams and the organization row itself. Invoices and the credit ledger keep the tenant id as the financial record. Lens copies of requests made with the workspace's service keys alone, with no user or end user, are not erased by this job and stay until Lens retention removes them. A tenant under a sanctions hold is skipped by both jobs. With cloud.enabled: true the request logs of every tenant also expire after maximum_spend_logs_retention_period, which defaults to 30d on Cloud and to no limit elsewhere, matching the retention period in the privacy policy.
Exporting the tenant admin returns the tenant rows without any secret, and erasing them blanks the details at once instead of waiting for the period. Erasing the admin of a workspace that is still open is refused with a 409. Tenant audit entries never store the email, legal name or address, so redaction does not leave copies in the hash-chained audit log.
End users are scoped by tenant. The gateway prefixes the user value a tenant's key sends with the tenant's organization id, so alice from one tenant is stored, budgeted, blocked and logged as <organization_id>/alice and never shares spend, budget or settings with another tenant's alice. A data subject export or erasure of an end user by a tenant's caller acts only on that tenant's end user. A proxy admin key is not prefixed and must send the full <organization_id>/<id> form, and a request whose end user cannot be tied to a known tenant is refused with 403. End user rows written before this change keep their ids.
Super admin operations
| Route | What |
|---|---|
GET /cloud/tenants?status=&plan=&page=&page_size= | List tenants. |
GET /cloud/tenants/{tenant_id} | One tenant. |
POST /cloud/tenants/{tenant_id}/suspend | {reason}. Blocks every team of the organization, the way billing suspension does. |
POST /cloud/tenants/{tenant_id}/reinstate | {note}. Unblocks them. |
PATCH /cloud/tenants/{tenant_id} | {plan}. Puts the tenant on a plan by hand and applies its limits at once. Stripe is not told. A tenant still pending verification answers 409, because verification always provisions the free plan. |
Reads are open to proxy admins and admin viewers, writes to proxy admins. The custom role domain cloud grants cloud.read and cloud.write over the same routes. Every change is written to the audit log against the tenant (Spanway_CloudTenantTable): a signup as created and a repeat signup while pending as updated, both by the system admin, verification as created, the first Stripe customer as updated with only {"stripe_customer": true} as the new value, plan changes and cancellation as updated, suspension as blocked (including a credits exhaustion by the settlement), reinstatement and a lift by a credit purchase as unblocked, and an export as exported. Credit purchases are audited against the ledger table (Spanway_CloudCreditLedgerTable), credential changes against the credentials table (Spanway_CredentialsTable), and an import on a self-hosted gateway against the organization, team and user tables (Spanway_OrganizationTable, Spanway_TeamTable, Spanway_UserTable), as described in Export and migration to self-hosted. The audit log page lists these events next to every other one. The tenant snapshots in the audit log leave out the saved card and the auto top-up fields, because admin viewers can read the audit log.
Configuration
general_settings:
cloud:
enabled: true
app_url: https://app.spanway.example
api_url: https://api.spanway.example
verification_ttl_hours: 24
credit_check_ttl_seconds: 60
low_balance_alert_usd: 5
zero_completion_insurance: true
signup_allowlist: ["@example.com", "founder@another.example"]
usage_price_per_usd: 1.15
overage_price_id: price_1QOverage
region: us-east-1
region_signup_urls:
eu-central-1: https://eu.app.spanway.example/ui/cloud/signup
plans:
pro:
price_usd_per_month: 99
monthly_budget_usd: 500
overage_enabled: true
rpm: 1000
tpm: 2000000
max_keys: 50
max_teams: 10
max_members: 25
allowed_model_groups: null
stripe_price_id: price_123
| Key | Default | What it does |
|---|---|---|
enabled | false | Turns Spanway Cloud on. Off, every /cloud route answers 404 and the Cloud jobs do not run, which is right for every self-hosted gateway |
app_url, api_url | required | The Admin UI address used in emails and checkout links, and the API address shown to tenants |
verification_ttl_hours | 24 | How long a verification link works. Shorter is safer, longer helps people who check email late |
trial_days | 14 | Accepted for older configs. No trial is started today |
credit_check_ttl_seconds | 60, from 1 to 3600 | How long the credit check trusts a cached balance. Lower stops an empty balance sooner at the cost of more database reads |
low_balance_alert_usd | 5.0 | The balance under which the tenant gets a low balance alert |
zero_completion_insurance | true | On, a request whose model produced nothing is not charged. Off, every request is charged |
signup_allowlist | unset | Unset, anyone can sign up. Set to a list, only an address on it (a full address, or @domain for a whole domain) can sign up, and an empty list closes signup. Use it to run an invite-only preview |
usage_price_per_usd | 1.15, from 1.0 to 3.0 | What one USD of provider cost on Spanway's provider accounts is charged at, on every plan, from credits or as overage. 1.15 is the provider's list price plus 15 percent. Raising it earns more per request and makes credits run out sooner for tenants, lowering it to 1.0 passes usage through at cost. Usage on a tenant's own provider keys is never charged. Change it only when the Cloud pricing changes, and update the public pricing page with it. Write it as a multiplier, 1.15 and not 115 or 15, a value outside 1 to 3 is refused when the config loads, see Usage price |
overage_price_id | unset | The Stripe price on the overage meter, such as price_1QOverage. Before any overage is sent to Stripe the gateway checks that this price charges one US cent per unit, flat, in USD. Unset or wrong, overage is held back (credits are still debited) and sent once it is right, so a mistake in Stripe never bills tenants a wrong amount. Set it when you turn on a plan with overage_enabled, see Billing safety |
region | us-east-1 | The data region this gateway serves, us-east-1 or eu-central-1. Every workspace that signs up here is stored here and its tenant row records it. Set it once, when the region's gateway is first deployed, and never change it on a gateway that already has tenants, because their rows would then disagree with where the data really is |
region_signup_urls | empty | The signup page of every other region's gateway, by region, each an https:// address. A region listed here appears in the signup page's Data region list and a signup for it is sent there. Leave it empty while only one region runs, and the list stays hidden. It cannot name the gateway's own region, and an invalid entry makes every /cloud route answer 500 |
plans | the built-in tiers | Prices and limits per tier, see below |
plans is optional and replaces only the tiers it names. An overridden tier replaces the whole built-in tier, so restate every limit it should keep. A limit you leave out means unlimited (monthly_budget_usd, rpm and tpm) or free (price_usd_per_month), and does not fall back to the built-in value. For example a pro override that sets only stripe_price_id and the max_* fields drops the 500 USD budget and the 1000 requests per minute limit. credit_check_ttl_seconds is between 1 and 3600 and sets how long the real-time credit check caches a balance, and low_balance_alert_usd sets the low balance alert threshold (see Prepaid credits). zero_completion_insurance is true by default, so a request whose model produced nothing is not charged (see Zero-completion insurance), and a general_settings.zero_completion_insurance set outside the cloud block wins over it. The block is validated when a /cloud route is called, and an invalid block answers 500 so a misconfiguration is noticed rather than hidden. While it is invalid, tenant requests are refused and nothing is settled, see Billing safety. Stripe credentials come from STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET, as for billing, and verification mail needs an email callback configured.
Errors
Cloud routes answer errors as {"detail": {"error": "<message>"}}. Two answers have other shapes: a sanctions refusal (451) is described on cloud sanctions, and a password that fails the policy on POST /cloud/verify answers {"error": {"message": "Password does not meet the required policy: must ...", "type": "validation_error", "param": "password", "code": "400"}}, where the message lists every rule the password broke.
| Status | Message | Meaning and fix |
|---|---|---|
| 404 | Not Found | Cloud is not enabled on this gateway, general_settings.cloud.enabled is false. |
| 404 | tenant_id=<id> not found or credential_id=<id> not found | No tenant, or no provider key of this tenant, has that id. Check the id. |
| 403 | The 'cloud' feature needs a Spanway enterprise license. You must be a Spanway Enterprise user to use this feature. ... | The gateway has no enterprise license. Set SPANWAY_LICENSE. |
| 403 | Your Spanway license does not include the 'cloud' feature. Contact sales@spanway.ai to add it. | The license lacks cloud. Ask for it to be added. |
| 403 | this email address is not approved for Spanway Cloud yet, ask sales@spanway.ai for access | signup_allowlist is set and the address is not on it. Ask for access, or add the address. |
| 403 | only an organization admin of the tenant can do this | Call with an org admin of the tenant. A proxy admin uses the super admin routes instead. |
| 400 | disposable email addresses cannot sign up, or a syntax reason such as The email address is not valid. ... | Use a work email address. |
| 400 | region <region> is not offered for new workspaces | The signup chose a region that neither this gateway serves nor region_signup_urls lists. Pick a region from GET /cloud/plans, or ask the operator to add the region. |
| 421 | workspaces in <region> are created at <signup_url> | The signup chose a region another gateway serves. The body also carries region and signup_url. Send the signup to that page, nothing was stored here. |
| 400 | invalid verification token or verification link expired, request a new one | Use the latest link, or call POST /cloud/resend. |
| 400 | plan <plan> cannot be bought online, tenant is already on <plan> | Pick another plan, or contact sales@spanway.ai for enterprise. |
| 400 | tenant is <status> | On subscribe, the tenant must be active. On a credit purchase or an auto top-up change, it must be active or suspended. |
| 400 | tenant has no Stripe customer yet, subscribe first | The billing portal opens only after a first subscribe or credit purchase. |
| 400 | tenant is already cancelled | Nothing to cancel. |
| 400 | no saved card, buy credits with save_card set to save one first | Buy credits once with save_card: true before turning on auto top-up. |
| 400 | tenant is <status>, only active tenants suspend or only suspended tenants reinstate | The tenant is not in the state the action needs. |
| 409 | this email address already has a tenant | Sign in instead, or use another address. |
| 409 | this tenant is already verified | The link was used already. Sign in. |
| 409 | tenant has no organization to export or tenant has no workspace yet | Verify the signup first, the workspace is created then. |
| 409 | tenant is pending verification, change its plan once it is verified | Wait until the tenant verifies, because verification always starts on free. |
| 409 | tenant is <status> by a sanctions decision and cannot be reinstated | A sanctions decision holds the tenant, see cloud sanctions. |
| 409 | an organization named '<name>' already exists | On POST /cloud/import, rename or remove the existing organization. |
| 422 | country must be an ISO 3166-1 alpha-2 code | Send a two letter country code such as DE. |
| 422 | subdivision is required for this country (ISO 3166-2 code) | Send the region code, for example UA-43, where only part of a country is restricted. |
| 422 | extra keys not allowed for <provider>: <keys> | On an own provider key, only organization for openai is accepted in extra. Remove the others. |
| 429 | too many signups from this address, try again later or too many requests from this address, try again later | The source address used its 10 signups and resends for the hour. Wait and try again. |
| 451 | a sanctions refusal | See cloud sanctions. |
| 502 | stripe: <reason> | Stripe refused the call. Check the Stripe keys and the plan's stripe_price_id. |
| 500 | general_settings.cloud is invalid | Fix the cloud block in the config, see Configuration. |
| 503 | cloud_billing_unavailable, Spanway Cloud cannot price usage for organization <id> right now, so the request was refused and nothing was charged. ... | Returned on model routes in the OpenAI error shape. The cloud block is invalid, so tenant requests are refused instead of served free. The operator fixes the key that GET /cloud/billing/status names in config_error, see Billing safety. |
Logs
| Level | Line | Meaning and action |
|---|---|---|
| ERROR | cloud: general_settings.cloud is invalid: <reason> | The cloud block failed validation and every /cloud route answers 500. Fix the key the reason names. |
| ERROR | cloud: credit settlement skipped, general_settings.cloud is invalid: <reason> | The daily settlement did not run and wrote nothing, so no usage was taken from credits and no overage went to Stripe. A High budget_alerts alert goes out with it. Fix the key the reason names, and the next run settles the days it missed, up to seven days back. |
| ERROR | cloud: refusing Cloud tenant requests, general_settings.cloud is invalid so usage cannot be priced: <reason> | Tenant requests answer 503 cloud_billing_unavailable until the block is fixed. Logged once an hour with one High alert, while spanway_cloud_billing_refusals_total counts every refusal. Fix the key the reason names. |
| ERROR | cloud: overage metering is paused (<reason>) for price <price_id>: <detail>. Usage rows keep overage_reported false and are sent once the check passes. | Overage is held back because overage_price_id is unset (not_configured), the Stripe price or its meter is wrong (wrong_price), or Stripe could not be asked (stripe_unavailable). Requests keep working. Fix the price or the setting, and the held overage is sent by the next settlement. |
| ERROR | cloud: overage metering is paused for subscription <id>: <detail>. Its usage rows keep overage_reported false ... | A tenant's Stripe subscription does not bill the overage meter through overage_price_id alone (subscription_price_mismatch), so its overage is held back and alerted at High. Fix the subscription in Stripe, the next run sends the held overage. |
| WARNING | cloud: tenant lookup for organization <id> failed: <error> | While the cloud block is invalid the gateway could not tell whether an organization is a tenant, so it refused the request to be safe. Check the database. |
| INFO | cloud: settled <n> tenant days, skipped <m> tenants, <k> tenants failed | The daily settlement finished. Normal when <k> is 0. A non-zero <k> means some tenants failed and are retried next run, see the ERROR lines below. |
| ERROR | cloud: credit settlement for tenant <id> on <day> failed and is retried by the next run: <type>: <error> | Settling one tenant raised, so that tenant is skipped for this run and the others still settle. Adds one to spanway_cloud_settlement_failures_total{reason="tenant_failed"} and a High budget_alerts alert lists the failed tenants. Fix the cause, the next run retries for up to seven days back. |
| ERROR | cloud: usage of tenant <id> on <day> could not be settled and leaves the 7 day catch-up window ... | A failing day is about to drop out of the catch-up window, so that usage will never be charged unless settled by hand. Adds one to spanway_cloud_settlement_failures_total{reason="day_leaving_window"}. Fix the cause before the next run. |
| INFO | cloud: signup for region <region> pointed at <signup_url>, nothing stored | Someone chose another region on this gateway's signup route and was sent to that region's page. Normal. Many of them in a row from one page can mean a stale link to the wrong region's signup page. |
| INFO | cloud: signup refused, region <region> is not offered | A signup named a region no gateway offers. Normal for a hand-written request. If real customers hit it, add the region to region_signup_urls. |
| WARNING | cloud: plans <plans> still set the retired overage_price_per_usd, which is ignored; usage is charged at usage_price_per_usd <price>. Remove the key. | An older config still sets the per-plan rate. Billing keeps working at the one usage price. Delete overage_price_per_usd from the plans it names. |
Related
- Cloud signup page for the signup and verification pages.
- Multi-region reference architecture for how each region is hosted.
- Cloud plan page for the tenant's own plan, credits and keys.
- Tenants page for the operator's tenant list.
- Billing and invoicing for the Stripe setup.
- Sanctions screening on Spanway Cloud for why a tenant may be held.