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

> ## Agent Instructions
> Checkfu is open source (https://github.com/checkfu/checkfu) and runs in the reader's own Cloudflare account. There is no shared hosted base URL: `checkfu deploy` prints the deployment's API URL (`https://<api-worker>.workers.dev` or the CHECKFU_API_DOMAIN hostname, exported as `CHECKFU_BASE_URL` for the CLI, SDK, and curl) and MCP URL (`.../mcp`). Local development serves the API on http://localhost:1337 and MCP on http://localhost:1338/mcp.
> Authenticated HTTP requests send the deployment's CHECKFU_API_KEY as `Authorization: Bearer $CHECKFU_API_KEY` (or `x-api-key`) and `Content-Type: application/json` for JSON bodies. Pass `Idempotency-Key` on retriable writes.
> Core workflow: create an Agent (`POST /v1/agents`) and an Environment (`POST /v1/environments`), create a Session that references both (`POST /v1/sessions`), send a `user.message` event (`POST /v1/sessions/{session_id}/events`), and follow `GET /v1/sessions/{session_id}/events/stream` until `session.status_idle`.
> Other resources: Memory stores (`/v1/memory_stores`), Files (`/v1/files`), Artifacts (`/v1/artifacts`), Vaults and credentials (`/v1/vaults`), Provider credentials (`/v1/provider_credentials`), Automations (`/v1/automations`), Inbound bindings (`/v1/inbound_bindings`), and Webhooks (`/v1/webhooks`). The deployment serves its OpenAPI 3.1 specification at `GET /openapi.json`.

# Configure a deployment

> The settings a Checkfu deployment reads, and how to change them.

Export settings in your shell, then deploy. For Pi Agents, you can also add OpenAI, Anthropic, and OpenRouter keys directly under **Vaults** in the dashboard without redeploying. To change an environment variable later, export the new value and run `checkfu deploy` again for the same stage; `deploy` keeps the stage's API key and stops if the change would delete or replace existing resources.

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
export ANTHROPIC_API_KEY=sk-ant-...
export CHECKFU_API_DOMAIN=api.example.com
checkfu deploy
```

| Variable | Purpose |
| :- | :- |
| `CHECKFU_API_KEY` | The deployment's single API key. Generated on first deploy if unset; cannot be changed by exporting a different key on a later deploy. |
| `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `OPENROUTER_API_KEY`, `DEEPSEEK_API_KEY` | Default credentials for built-in model providers and harnesses. |
| `CHECKFU_CUSTOM_HARNESS_URL`, `CHECKFU_CUSTOM_HARNESS_TOKEN` | [Register a custom harness](https://docs.checkfu.com/guides/bring-a-custom-harness.md#deploy-the-example). Supply both settings. The harness holds its own model credentials. |
| `CLOUDFLARE_GATEWAY_ID` | Cloudflare AI Gateway. |
| `CLOUDFLARE_AI_API_KEY`, `CLOUDFLARE_ACCOUNT_ID` | Cloudflare Workers AI. This key is for models only; it is separate from `CLOUDFLARE_API_TOKEN`. |
| `CHECKFU_PROVIDERS` | Custom providers as a JSON manifest. See [Models and providers](https://docs.checkfu.com/concepts/models-and-providers.md). |
| `CHECKFU_PROVIDER_SECRET_*` | Secrets referenced by name from `CHECKFU_PROVIDERS`. Never put keys directly in the manifest. |
| `CHECKFU_JURISDICTION` | `eu`, `fedramp`, or `us`. Controls where Durable Objects, R2, and D1 store data. |
| `CHECKFU_LOCATION_HINT` | Preferred region for new Durable Objects, such as `wnam` or `weur`. |
| `CHECKFU_API_DOMAIN`, `CHECKFU_MCP_DOMAIN` | Custom hostnames for the API and MCP server. Must be distinct hostnames. |
| `CHECKFU_PUBLISH_DOMAIN` | Dedicated zone apex for published artifacts, served at `https://<address>.<domain>/`. |
| `CHECKFU_MACHINE_IDLE` | How long an idle Session Linux machine stays warm before sleeping (default `10 minutes`). |
| `CHECKFU_WEBHOOK_EGRESS_URL`, `CHECKFU_WEBHOOK_EGRESS_TOKEN` | Public-only egress proxy URL and optional bearer token for webhook deliveries. |
| `ALCHEMY_PROFILE` | Cloudflare credential profile used by `checkfu deploy` when working across multiple accounts. |

The CLI saves the API key and provider settings per stage. It does not save jurisdiction, location hint, custom hostnames, publish domain, idle timeout, or webhook egress settings, so export those same values on every deploy.

If you already deployed a stage, exporting a different `CHECKFU_API_KEY` in your shell causes `checkfu deploy` to stop rather than rotate the key. Unset `CHECKFU_API_KEY` or match the saved key when updating.

## Jurisdiction

> [!WARNING]
>
> Choose `CHECKFU_JURISDICTION` before the first deploy. Changing it later would replace the Durable Object namespaces, the R2 bucket (discarding uploaded Files and Artifact files), and the D1 database, so `checkfu deploy` blocks the update with `Update refused`. To change jurisdiction, run `checkfu destroy --stage <name>` and deploy again, which deletes all data.

## Custom hostnames

Setting `CHECKFU_API_DOMAIN` or `CHECKFU_MCP_DOMAIN` attaches that hostname and detaches every other custom hostname on the Worker, including ones added in the Cloudflare dashboard. Setting a domain variable to `none` detaches all custom hostnames; leaving it empty or unset leaves existing hostnames alone. Every custom zone must belong to the Cloudflare account you deploy to, and the `workers.dev` addresses keep working.

If you set `CHECKFU_PUBLISH_DOMAIN`, it must be a zone apex, and you must also set **both** `CHECKFU_API_DOMAIN` and `CHECKFU_MCP_DOMAIN` explicitly, each to a hostname outside `CHECKFU_PUBLISH_DOMAIN` or to `none`. Leaving either empty fails the deploy.

> [!WARNING]
>
> To change a hostname, deploy twice: first with `none`, then with the new name. A one-step change
> detaches the old name first, and if the new one fails to attach, the Worker is left with neither.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.