> ## 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`.

# Models and providers

> Choose an Agent's model and set up the providers your deployment calls.

Each Agent names one model. For a Pi Agent, go to **Vaults** in the dashboard and add a model provider credential. Give each key a name, then choose it in **Model credential** when editing the Agent. You can save several keys for the same provider and select a different key on each Agent.

Changing the selection creates a new Agent version. Sessions use the choice saved on their Agent version. The key is write-only, and Checkfu sends it only to that provider's inference endpoint. Revocation blocks further requests from every Agent version using the key. Servers can also supply default model credentials through environment variables.

Before revoking a key, open **Revoke** in **Vaults** to see the credential ID, then select **Cancel** while you check the Agent versions you intend to keep using. Run `checkfu agents:versions list --agent-id AGENT_ID`, follow each `next_page` with `--page`, and look for the ID in `model.provider_credential_id`. Check the Agent version pinned by each relevant Session, including versions of archived Agents. Versions with no selected credential use the deployment defaults.

Model provider credentials belong to the deployment. A Session with a saved credential can switch to another Pi model from the same provider. To use another provider or runtime, start a Session with an Agent version configured for that choice.

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
checkfu agents create --name Researcher --model openrouter/anthropic/claude-sonnet-5.5
```

## Model IDs

Write `<provider>/<model-id>`, such as `anthropic/claude-sonnet-5-5`. Bare IDs like `claude-sonnet-5-5` or `gpt-6.2-sol` work for models in the built-in OpenAI and Anthropic catalogs.

If a built-in provider's key is missing, the Session's turn fails with an error naming the missing environment variables. Missing secrets referenced by custom providers fail earlier, at deploy time.

## Built-in providers

| Provider | Variables | Example model |
| :- | :- | :- |
| `openai` | `OPENAI_API_KEY` | `gpt-6.2-sol` |
| `anthropic` | `ANTHROPIC_API_KEY` | `claude-sonnet-5-5` |
| `openrouter` | `OPENROUTER_API_KEY` | `openrouter/anthropic/claude-sonnet-5.5` |
| `cloudflare-ai-gateway` | `CLOUDFLARE_GATEWAY_ID` (plus `CLOUDFLARE_AI_API_KEY`, `CLOUDFLARE_ACCOUNT_ID` for HTTPS) | `cloudflare-ai-gateway/claude-sonnet-5-5` |
| `cloudflare-workers-ai` | `CLOUDFLARE_AI_API_KEY`, `CLOUDFLARE_ACCOUNT_ID` | `cloudflare-workers-ai/@cf/deepseek-ai/deepseek-v4.1-flash-1017` |

For Cloudflare AI Gateway, set only `CLOUDFLARE_GATEWAY_ID` and `checkfu deploy` attaches the Workers `AI` binding, letting requests reach your gateway without an API token.

## Custom providers

Add any endpoint that speaks `openai-responses`, `openai-completions`, or `anthropic-messages` by exporting `CHECKFU_PROVIDERS` and its secret variables before deploying:

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
export CHECKFU_PROVIDERS='{"xai":{"name":"xAI","format":"openai-responses","base_url":"https://api.x.ai/v1","api_key_env":"CHECKFU_PROVIDER_SECRET_XAI_API_KEY","default_model":"grok-4"}}'
export CHECKFU_PROVIDER_SECRET_XAI_API_KEY=xai-...
checkfu deploy
```

Agents can then use `"model": "xai/grok-4"`. Keep secrets out of the manifest: `api_key_env`, `auth.env`, and `secret_headers` may reference only variables starting with `CHECKFU_PROVIDER_SECRET_`.

| Field | Notes |
| :- | :- |
| `format` | Required. One of `openai-responses`, `openai-completions`, or `anthropic-messages`. |
| `base_url` | Required. Public `https://` URL with no credentials, query, or fragment. |
| `api_key_env` | Provide either `api_key_env` or `auth`. Sends the referenced secret as a bearer token (or `x-api-key` for `anthropic-messages`). |
| `auth` | Alternative to `api_key_env`. A JSON object: `{ "type": "none" }`, `{ "type": "bearer", "env": "..." }`, or `{ "type": "api_key_header", "header": "...", "env": "..." }`. |
| `name`, `default_model` | Optional display name and default model ID for the provider. |
| `headers`, `secret_headers` | Static non-secret headers, and header-to-env-var mappings for secret headers. |
| `context_window`, `max_tokens`, `reasoning`, `input`, `models` | Optional provider-wide model defaults and per-model overrides under `models`. |

See [Configuration](https://docs.checkfu.com/self-hosting/configuration.md) for all deployment variables.

For Vercel AI Gateway with Antigravity or Grok Build, configure the OpenAI Chat Completions endpoint and select a Vercel model ID, such as `vercel/anthropic/claude-sonnet-5.5`. [Vercel AI Gateway API](https://vercel.com/docs/ai-gateway/sdks-and-apis)

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
export CHECKFU_PROVIDERS='{"vercel":{"name":"Vercel AI Gateway","format":"openai-completions","base_url":"https://ai-gateway.vercel.sh/v1","api_key_env":"CHECKFU_PROVIDER_SECRET_VERCEL_API_KEY","default_model":"anthropic/claude-sonnet-5.5"}}'
export CHECKFU_PROVIDER_SECRET_VERCEL_API_KEY=...
checkfu deploy
```


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