Quick reference #
On this page
Find the calls for a common task in execution order. Read the linked guide for prerequisites, approval requirements, alternatives, and verification. The limits below link to their current values or to the API that returns them.
Connect and deploy an app #
- Connect your AI assistant, sign in, then call
start. For Claude Code or Codex CLI, the MCP address ishttps://turnzero.ai/mcp. - Call
tzcloud_create_applicationand keep the app ID. For a server, pass the chosen size. For a serverless app, passkind: "serverless"and leave out the size. Calltzcloud_submit_manifestwith that ID and the app’s manifest. If the person wants to test in development first, calltzcloud_create_environmentfor development before deploying. - On a computer authorized for deploys, call
tzcloud_deploy_commandwith the app ID. Run the command it returns from the app’s folder. - Call
tzcloud_read_statusfor the deploy’s environment until the deploy finishes. Check the result and open the app at the returned address. - If the app has a development environment, test the version there. If the person asks to release it, call
tzcloud_promotewith the tested version and check production withtzcloud_read_status. For an app with only production, step 4 finishes the deployment.
See Deploy from your computer for the full steps, or Deploy from a chat if you have no terminal.
Common tasks #
These are actions for your AI unless a row names a step for you. Follow the linked guide for any required approval. Use the connection address for your AI. The CLI connection provides Turn Zero Cloud, tzTrack and tzMesh. Chat tools connect to Cloud hosting separately from tzTrack and tzMesh. Your account’s access still applies.
| Task | Calls, in order | Guide |
|---|---|---|
| Connect Claude Code | Run claude mcp add --transport http --scope user turnzero https://turnzero.ai/mcp. Ask the person to start a new Claude Code session, use /mcp and sign in; the new session calls start. |
Connect your AI assistant |
| Set this computer up for deploys | Run npx --no-update-notifier -y turnzero@latest authorize, call mint_token with the printed members, then run its command_npx once on that computer (npx.cmd and command_npx_windows on Windows). If npx can't run here, use an installed command that answers turnzero --version, or follow the linked guide's other routes. |
Authorize this computer for deploys |
| Install the turnzero command | Run npm install -g turnzero. Without the install, write npx --no-update-notifier -y turnzero@latest in place of the command's name in each command (npx.cmd on Windows). |
Installation and npm |
| Start a new project from a template | turnzero scaffold, with --template <name>. Choose server-hello (the default, no sign-in), server-database, or server-scheduled-job. For sign-in and private notes, choose functions-sign-in when the app can run as functions or server-sign-in when it needs a server. Choose server-ai-chat for sign-in and an AI conversation. Choose static-site for a static site with no server, or functions-database for a public notes page with a function and a database. |
Starting a new service |
| Create and deploy an application | tzcloud_create_application, tzcloud_submit_manifest, tzcloud_deploy_command, then run the command it returns |
Deploy from your computer |
| Deploy from a chat or a workspace without a working deploy command | Call tzcloud_deploy_files with file contents, stored file references, or retained hashes. Follow the returned tzcloud_read_status call if the deploy is still running. |
Deploy from a chat. File upload details |
| Turn on a development environment | tzcloud_create_environment for development, then tzcloud_deploy_command and run the command it returns |
Turn the development environment on |
| Promote a tested version to production | tzcloud_read_status for development, then tzcloud_promote with a wait |
Promote to production |
| Roll back production | tzcloud_list_versions, then tzcloud_roll_back with a wait |
Roll back |
| Store an outside API's key | tzcloud_store_secret, run the command it returns, then tzcloud_declare_outbound_api |
Store an API key |
| Replace a secret your code reads | Call tzcloud_store_secret with replace: true and run its value command if returned. If the serving copy already uses the binding, follow the restart call when one is returned and check tzcloud_read_status. To apply a new binding, deploy or promote the version that uses it. |
Replace a value |
| Add a database | tzcloud_submit_manifest with the database service, then tzcloud_deploy_command and run the command it returns |
Add a database |
| Restore, export, or inspect development PostgreSQL data | For example, open psql with turnzero db connect --environment development -- psql --no-psqlrc. Use the file from turnzero provision. |
Connect to your database |
| Restore, export, or inspect production PostgreSQL data | Call tzcloud_open_database_connection and approve in the browser. For example, open psql with turnzero db connect --grant PENDING_ACTION_ID -- psql --no-psqlrc, replacing PENDING_ACTION_ID with the pending action ID. |
Connect to your database |
| Start a key-value service | turnzero scaffold --template server-database --resource entries --singular entry --fields "key:text,value:text" |
Keep key-value records |
| Add a scheduled job | read_context for skill:schedule, tzcloud_read_plan_quotas for the schedule limits, tzcloud_submit_manifest with a schedule, tzcloud_deploy_command and run the command it returns, tzcloud_run_schedule, then tzcloud_read_schedules |
Add a scheduled job |
| Call an AI model | tzcloud_read_library with contains to find the AI Generation entry, then with entry set to its name. Take the package, call generateText from a route, then call tzcloud_submit_manifest and tzcloud_deploy_command and run the command it returns. |
Call an AI model |
| Generate an image | tzcloud_read_library with contains to find the AI Generation entry, then with entry set to its name. Take the package, send a generateContent request from a route, then call tzcloud_submit_manifest and tzcloud_deploy_command and run the command it returns. |
Generate an image with AI |
| Generate one image from your AI assistant | On https://turnzero.ai/mcp, call generate_image with a prompt, then open its link or run its download command. No application is needed. renew_image_link gives a fresh link while the account still keeps the picture. |
Generate an image with your AI assistant |
| Add sign-in | tzcloud_submit_manifest with the accounts service, a link to /__account/signin, then tzcloud_deploy_command and run the command it returns |
Add sign-in to your app |
| Attach your own domain | tzcloud_submit_manifest with the domain, add the CNAME record at your DNS provider, tzcloud_read_status for the TXT record and add it there, then tzcloud_read_status until the domain is live |
Attach your own domain |
| Find recent errors | tzcloud_read_status, then tzcloud_read_logs at the error level |
Find the last hour's errors |
| Read usage or change a server's size | Read usage with tzcloud_read_usage. To change a server's size, read tzcloud_read_plan_quotas, call tzcloud_set_app_size, then use tzcloud_read_status for any returned redeploy version. After a size change, restart each running database environment that was not re-created to load the new connection setting. A sleep-only change needs no restart to load database settings. |
Size and usage |
Other management actions #
tzcloud_set_app_sizechanges a server application's size or sleep setting. If the tool returnsapplying, usetzcloud_read_statuswithwait_secondsto see when the change finishes and which size is in effect.tzcloud_set_log_retentionturns the paid monthly option on or off. Turning it off deletes entries past standard retention at the next retention run; they cannot be restored.tztrack_set_ai_passesturns the paid monthly option on or off for a space.
If tzcloud_set_log_retention or tztrack_set_ai_passes returns option_not_set, the option stayed off. The day’s charge was posted or had already been recorded. Retrying for the same item that UTC day does not charge it again.
read_balancereads your account's balance, threshold, warning record, pause state and current UTC month's usage lines. The response'smodelisusage.
Minimal manifest #
For a server, save the declarations below in manifest.json. Submit the whole document with tzcloud_submit_manifest before deploying. The manifest declares what the app needs; it does not contain the app's source code. For a site of static files alone, use the manifest in Publish a static site, with no health path.
{
"manifest_version": 1,
"services": [],
"health": "/health",
"region": "usa",
"egress": [],
"audience": { "kind": "public" },
"packages": []
}
This example declares no optional service, external host or library package. Its server must answer /health with HTTP 200. To add a database, put { "kind": "database" } in services. The manifest lists every field and links the current schema.
Environment variables #
The platform supplies these values to a deployed app. Read them from process.env; keep credentials out of source files and logs.
| Variable | What your code uses it for |
|---|---|
PORT |
Listen on this port, currently 8080. |
APP_PUBLIC_HOST |
Build public URLs with https:// followed by this hostname. |
APP_ENVIRONMENT, APP_VERSION |
Identify the environment and running version. |
APP_DATABASE_URL |
Connect the request pool to the database. This value contains a password. |
APP_DATABASE_DIRECT_URL |
Connect work that needs one server session directly to the database. This value contains a password. |
APP_DATABASE_CONNECTION_LIMIT |
Set the database pool's maximum connections per process. |
TURNZERO_CLOUD_API, TURNZERO_CLOUD_APPLICATION |
Find the platform's origin and this app's identifier. |
TURNZERO_CLOUD_APP_TOKEN |
Authenticate the app's storage, egress and logging calls. Keep it secret. |
Runtime settings lists the conditional settings too. Add settings of your own through the manifest's settings member: { "SITE_TITLE": { "value": "My app" } } for a plain value, or { "API_KEY": { "secret": "stored-key-name" } } for a stored secret.
Application limits #
Size limits explains which live applications count toward the account limit. Choose Shared 0.5 GB or Shared 1 GB for each server's production copy. A site of static files alone needs no size; follow Publish a static site. Production sleeps when idle if its sleep setting is on; development always sleeps when idle. Email and custom domains are available to every application. Usage draws the account's balance at the pricing page's rates.
Key limits #
Each line says what a limit bounds and links the section that states its figure or says where to read it. Limits and rates can change without a release. Read limits through tzcloud_read_plan_quotas by size, and rates on the pricing page or through read_rate_card.
- How long one request to your app may run: The execution window.
- How long one scheduled run may run: Schedule.
- The largest request body your app receives: The request size limit.
- The largest file one storage write takes: Limits and metering, in Store files.
- How many requests one address or one signed-in user may send your app a minute: The per-address and per-user limits.
- How many calls a minute the platform accepts from one address, and from one credential on the storage routes: The platform request limit.
- How much outbound traffic your app may send: Outbound limits.
- How many database connections each process may hold: The connection limit.
- The largest deploy zip, and how many files it may hold: Names and limits.
- How large a deploy through
tzcloud_deploy_filesmay be: Check and deploy the files. - How many web client files a version may serve, and how large: Keep names and sizes within the limits.
- How long a WebSocket connection may stay open: Limits and metering, in Use WebSockets.
- How many log bytes each environment keeps: Stay under the retained-bytes limit.
- The size's limits: Size limits.
Related #
- Find the guide for a task links the guide for every task, including the ones above.
- Sign-in, sessions, and tokens compares every credential: who uses it, what it may do, how long it lasts, and what ends it.
- The turnzero command's credential says which credential each command of the turnzero command runs under, including
turnzero provision. - Refusals gives each refusal's cause and remedy.
- Glossary defines the terms these guides use.