Spec · cloudsitus.yaml
One file. A plan you can read, then apply.
Declare the region, a database, buckets, models, GPU and a budget. Plan says what would be created, kept, changed or refused — each with a residency receipt and a monthly estimate at your prices. Apply runs exactly that plan, identified by its hash, or nothing.
https://cloudsitus.com /api/v1Plan a spec version: 1
project: acme-notes
region: CH # every resource below runs here, or the plan refuses
data_class: general # general | regulated
database:
name: main
auth: false # true = hosted sign-in (/auth/v1), or {jwks_url, issuer, audience}
realtime: false
storage:
- bucket: uploads
max_file: 50MB
models:
chat: think # a class (flash | think | pro) or a pinned model id
embed: qwen3-embedding-8b
budget:
monthly_usd: 200
On this page
Overview
How it works
deploy module (spec_example, spec_validate, spec_plan, spec_apply).Resident or refusedruleEvery resource runs in the spec's region, or the plan refuses it. Nothing is moved to make a plan succeed. A model class whose fail-over would leave the region is pinned to its current winner, and the plan says so.
plan_hashthe contractA hash of the spec and every decision in the plan. Apply recomputes the plan and refuses with 409 plan_changed if anything moved — a price, a route, your account — so you never apply something you did not read.
Idempotentby nameResources are matched by name (a database by its label), so applying the same spec twice changes nothing the second time (status: "no_changes").
Schema
The file
path.version: 1
project: acme-notes
region: CH # every resource below runs here, or the plan refuses
data_class: general # general | regulated
database:
name: main
auth: false # true = hosted sign-in (/auth/v1), or {jwks_url, issuer, audience}
realtime: false
storage:
- bucket: uploads
max_file: 50MB
models:
chat: think # a class (flash | think | pro) or a pinned model id
embed: qwen3-embedding-8b
budget:
monthly_usd: 200
version1requiredAlways 1.
projectstringrequired3–40 characters, lowercase letters, digits and -, starting with a letter. Also the label of the API key apply creates.
regionregion coderequiredWhere every resource runs, e.g. EU, US, ASIA, CH. WORLD is refused: it is not a place. No default.
data_classgeneraloptionalgeneral (default). Other classes are set up with us per account.
databasemappingoptionalname (required, 1–48 characters, matched to an existing database by label), auth (false, or a block mapping jwks_url + issuer + audience), realtime (boolean).
storagelist (≤ 20)optional{bucket, max_file?, public?}. bucket: lowercase letters, digits, . _ -, unique. max_file: 50MB, 1.5 GB, 500kb or bytes, at most 50 MB. Needs database.
modelstask → modeloptionalTasks chat, code, vision, summarize, embed, rerank, stt, tts, ocr, image, video, decision. Value: a class (flash, think, pro, auto) or a model id. Adds an API key to the plan.
gpumappingoptionalplacement (auto default, runpod, aws) and workload (container_job default, endpoint, pod). Only for accounts with GPU compute; otherwise the plan refuses it, which is why the example has no gpu block. Apply creates nothing for GPU; it records the binding. See GPU.
budget.monthly_usdnumberoptionalAbove 0 and up to 1,000,000. Fixed monthly charges above it block the plan (over_budget) unless you pass allow_over_budget. Usage-based charges are listed, not counted.
The YAML subset
Block mappings and lists, quoted or plain scalars, numbers, booleans, null, # comments and flow lists of scalars. Refused, with the line: tabs, anchors and aliases, tags, block scalars (| >), flow mappings ({…}), several documents and duplicate keys. A spec must declare at least one of database, storage, models, gpu.
Endpoint
Plan
/v1/spec/planContent-Type: application/yaml, text/yaml or text/plain, options in the query string), or JSON {"spec": "<yaml or json>" | {…}, …options}.curl https://cloudsitus.com/api/v1/spec/plan \
-H "Authorization: Bearer cs_live_…" \
-H "Content-Type: application/yaml" \
--data-binary @cloudsitus.yaml
statusready | no_changes | refusedrefused if any resource is refused or a blocker applies.
resources[].actionactioncreate (+), keep (=), change (~, a bucket's public / max_file or the auth issuer), replace (-/+, the database exists in another region: destructive), use (>, a model or GPU binding), refuse (!, with refusal.code).
resources[].receiptresidencyregion, processed_in, resident, host, and per kind model + failover, cell, or the GPU segment and data_centers.
resources[].costestimatemonthly_fixed_usd and the usage rates at your prices.
textstringThe plan in a few readable lines, for a person or a pull-request comment.
Endpoint
Apply
/v1/spec/applyplan_hash you read. Steps run in order and stop at the first failure; what already ran is kept.plan_hash64 hexrequiredFrom the plan. 400 plan_hash_required without it.
allow_destructivetrueoptionalRequired when the plan replaces a database (needs_allow_destructive). The new database is created first; the old one is then deleted with the usual 7-day restore window. Over MCP this flag is never read — a person approves instead.
allow_over_budgettrueoptionalLifts the over_budget blocker.
include_service_keytrueoptionalAdds the database's service_role_key to outputs and env. REST only.
curl https://cloudsitus.com/api/v1/spec/apply \
-H "Authorization: Bearer cs_live_…" \
-H "Content-Type: application/json" \
-d "$(jq -n --rawfile spec cloudsitus.yaml --arg h "$PLAN_HASH" '{spec: $spec, plan_hash: $h}')"
Outputs
env is ready to paste into your environment file. A new API key appears only when apply created it (it is shown once). A step that fails returns 502 apply_incomplete with the same body, so you see what was done.
Reference
Refusals
region_not_availablerefusalThe product has no host or cell open in this region yet.
not_residentrefusalThe model (or its fail-over) would process outside the region.
unknown_model · model_not_available_in_region · no_routerefusalAs on the AI endpoints.
feature_not_availablerefusalDeclared but not available on your account or in this region yet (for example hosted sign-in or realtime through the spec).
plan_limit_reached · limit_exceededrefusalYour plan's allowance, or a hard limit (e.g. a bucket's max_file).
ambiguous_name · depends_on_refused · subkey_not_allowed · state_unavailablerefusalTwo databases share the name; a resource depends on a refused one; a customer sub-key; account state could not be read (retry).
over_budgetblockerThe fixed monthly estimate is above budget.monthly_usd.
Reference
Errors
400invalid_specThe file did not validate; errors: [{path, message}] (up to 50).
400invalid_request / invalid_jsonNo spec, or a body over the limit.
409plan_changedThe plan moved since you read it; the new plan is in the error. Read it, apply again with its hash.
422plan_refusedThe plan has refusals or blockers; nothing ran.
403destructive_not_allowedThe plan replaces a database and allow_destructive was not sent.
403insufficient_key_scope / insufficient_scopeA dashboard-session key cannot apply a plan that mints a key, returns the service key or deletes; an OAuth token needs the scopes of what it changes (required_scopes).
402payment_requiredA plan that creates or changes something needs credit; no_changes does not.