# Deployment on Render

This page is for maintainers of Supafone's managed deployment mirror. The
public SDK repository does not distribute the private `cloud/` or `landing/`
service directories; SDK users do not need this procedure to install or use
`supafone-labs`.

The live Labs deployment is split between the Python API and static web/docs
surface.

## Render Services

`render.yaml` defines:

| Service | Type | Domain | Root/publish path |
| --- | --- | --- | --- |
| `supafone-labs-api` | Python web service | `api.labs.supafone.ai` | `supafone-labs` |
| `supafone-labs-web` | Static web service | `labs.supafone.ai` | `supafone-labs/landing` |

API build and start:

```bash
pip install -e . -r cloud/requirements.txt
uvicorn cloud.app:app --host 0.0.0.0 --port $PORT
```

Health check:

```text
/healthz
```

The API has a persistent disk mounted at `/var/data` for its SQLite-backed
state.

## Important Boundaries

- Do not move `cloud/` without updating Render `rootDir`, build command, start
  command, and health path.
- Do not move `landing/` without updating the static publish path.
- Public SDK packages should not include private backend/admin/billing runtime
  files.
- Keep `.env` files, databases, provider keys, Stripe secrets, and Render
  operational state out of public releases.

## Required Environment

Common production variables include:

```text
ADMIN_SECRET
ANTHROPIC_API_KEY
OPENAI_API_KEY
XAI_API_KEY
DEEPGRAM_API_KEY
CARTESIA_API_KEY
ELEVENLABS_API_KEY
INWORLD_API_KEY
STRIPE_WEBHOOK_SECRET
STRIPE_SECRET_KEY
STRIPE_DEVELOPER_PRICE_ID
STRIPE_GROWTH_PRICE_ID
STRIPE_SCALE_PRICE_ID
STRIPE_CREDITS_PRICE_ID
STRIPE_DEVELOPER_URL
STRIPE_GROWTH_URL
STRIPE_SCALE_URL
RESEND_API_KEY
FROM_EMAIL
DATA_DIR
```

The Price IDs power account-bound Checkout sessions. The optional plan URLs must
each point to that exact plan on an HTTPS Stripe host; there is no shared
subscription or credit-pack fallback URL. Only set variables that the deployment
actually uses. Never commit secret values.

## Verification After Deploy

```bash
curl https://api.labs.supafone.ai/healthz
curl https://api.labs.supafone.ai/v1/pricing
curl https://api.labs.supafone.ai/v1/models
curl https://api.labs.supafone.ai/v1/voices
```

For hosted-agent API changes, also run:

```bash
cd supafone-labs
SUPAFONE_API_KEY=sf_live_... \
SUPAFONE_API_BASE_URL=https://api.supafone.ai \
npx tsx examples/smoke-hosted-agent.ts
```

## Documentation Source Notes

The canonical public documentation path is `/docs/`. The GitBook source lives
under `supafone-labs/gitbook/` and is rendered into that path by the Labs
static-site build. Keep `README.md`, `SUMMARY.md`, the generated provider
contracts, and the native realtime guide in sync with the published SDK.
