> ## Documentation Index
> Fetch the complete documentation index at: https://docs.earthcare.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Environments

> Local, test, and production — and the deployment-mode switch that separates the hosted product from the self-host edition.

| Environment | Frontend                         | API                                     | Purpose                           |
| ----------- | -------------------------------- | --------------------------------------- | --------------------------------- |
| Local       | `http://localhost:3000`          | `http://localhost:8000/api/v1`          | Development                       |
| Test        | `https://test.earthcare.network` | `https://test.earthcare.network/api/v1` | Integration / QA (real AI + data) |
| Production  | `https://earthcare.network`      | `https://earthcare.network/api/v1`      | Live                              |

## Deployment mode

`ECN_DEPLOYMENT_MODE` selects how the platform behaves:

* **`hosted`** — the managed product. Provider keys are ECN-managed, usage is
  [metered in credits](/guides/metering-credits), and there is **no customer BYOK**.
* **self-host / Community** — you run ECN and configure your own provider keys via
  environment variables, paying providers directly. See [BYOK & self-host](/self-host/byok).

## Key environment variables

| Variable                | What it controls                         |
| ----------------------- | ---------------------------------------- |
| `ECN_DEPLOYMENT_MODE`   | Hosted vs self-host behavior             |
| `DATABASE_URL`          | Postgres (with pgvector) connection      |
| `OPENROUTER_API_KEY`    | Managed LLM access                       |
| `APIFY_API_TOKEN`       | Managed paid-data (buying-signal) access |
| `AI_MOCK_MODE`          | `1` to stub AI in tests/CI               |
| `ECN_CREDIT_USD_VALUE`  | Credit peg (default `0.10`)              |
| `MANAGED_AI_MARGIN_PCT` | Cost-plus markup percentage              |

<Note>
  Postgres must have the `pgvector` extension — embeddings (1536-dim) are stored on
  `Business`, `ContextPack`, `ContextDocument`, and `RecruitRole`.
</Note>
