# fx

Vercel Labs fx CLI on macOS/Linux, not the JSON processor.

Source: https://zrelay.net/docs/agents/coding-agents/fx/

## Manual setup

1. Check fx --version and FX_HOME. Back up and merge the JSON below into ~/.fx/settings.json or $FX_HOME/settings.json. Do not use .fx.json or replace existing providers and the default provider.

2. Use a Grok/Flex key. Enter it locally with hidden input in Bash and export ZRELAY_API_KEY. FX_PROVIDER=zrelay fx status --json should show the intended provider_endpoint and model; inspect only nonsecret fields.

3. Launch fx --provider zrelay when ready. The model_metadata entry bounds context and output; grok-4.7-latest is the enabled Chat Completions example. Sending a prompt consumes balance.

## Configuration and commands

```
{
  "providers": {
    "zrelay": {
      "protocol": "openai-chat-completions",
      "base_url": "https://api.zrelay.net/v1",
      "auth": { "type": "bearer", "env": "ZRELAY_API_KEY" },
      "model_metadata": {
        "grok-4.7-latest": {
          "context_window": 128000,
          "max_output_tokens": 4096
        }
      }
    }
  },
  "models": { "zrelay": "grok-4.7-latest" }
}
```

```
read -rsp 'Zrelay API key: ' ZRELAY_API_KEY
printf '\n'
export ZRELAY_API_KEY
FX_PROVIDER=zrelay fx status --json
```

## Alternative: ask an AI assistant

Copy this complete prompt into your coding assistant. It describes configuration work; installation and paid tests need your authorization.

```
Configure Vercel Labs fx CLI for Zrelay. Identify the executable, version, OS and effective FX_HOME; do not confuse it with the JSON processor. Read https://fx.sh/docs/configure-fx/custom-model-connections and https://fx.sh/docs/configure-fx/configuration plus https://keys.zrelay.net/api/catalog. Ask before installing or upgrading software or making paid inference requests.
Back up and merge the effective settings.json, preserving existing settings and default provider. Add providers.zrelay with protocol=openai-chat-completions, base_url=https://api.zrelay.net/v1 and auth={type:bearer,env:ZRELAY_API_KEY}. Set models.zrelay=grok-4.7-latest only if enabled for Chat Completions and my Grok/flex key. Set its model_metadata context_window=128000 and max_output_tokens=4096, verifying current catalog limits first. Never request, print or save my key; let me enter it locally through hidden input. Check JSON and the installed configuration schema, then FX_PROVIDER=zrelay fx status --json. Report configuration findings separately from untested inference, streaming and tools. Give launch command fx --provider zrelay; do not send a prompt automatically.
```

## Limits and verification

Documented custom-provider support is not a runtime integration test. Do not confuse fx with a same-named JSON utility or assume Windows support. Streaming and tool behavior remain untested.

These recipes were reviewed against documentation and public catalog data. No client installation, authenticated request, paid inference, streaming or tool loop was executed. Validate configuration first; a later short text test does not establish complete agent compatibility.

Recheck the [live catalog](https://keys.zrelay.net/api/catalog) and your key’s provider/pool. The reviewed examples have 128000 input and 4096 output maxima unless a client limitation above prevents controlling the request. Never print, log or commit credentials.

## Official sources

Documentation checked 2026-11-09; mutable sources can differ from your installed version.

[https://fx.sh/docs/configure-fx/custom-model-connections](https://fx.sh/docs/configure-fx/custom-model-connections)

[https://fx.sh/docs/configure-fx/configuration](https://fx.sh/docs/configure-fx/configuration)

[https://keys.zrelay.net/api/catalog](https://keys.zrelay.net/api/catalog)

[https://fx.sh/about](https://fx.sh/about)

[https://fx.sh/docs/using-fx/cli](https://fx.sh/docs/using-fx/cli)

[https://fx.sh/docs/getting-started/installation](https://fx.sh/docs/getting-started/installation)

[https://fx.sh/docs/using-fx/fx-ask](https://fx.sh/docs/using-fx/fx-ask)

[https://keys.zrelay.net/api/catalog](https://keys.zrelay.net/api/catalog)
