relay.fast
RU Sign in

Setup guide

Connect OpenClaw to relay.fast as a custom provider

OpenClaw is an open-source AI agent that runs on your own computer as a local gateway. It works with API keys from third-party providers, so relay.fast can be added as a custom provider. Requests are billed per token to your relay.fast balance, and no subscription is needed.

What you need

The steps follow the OpenClaw documentation as of 27 November 2026.

  • Install OpenClaw as its documentation describes.
  • Create an API key in the relay.fast dashboard.
  • Copy model ids exactly from the model catalog.
  • Use the correct base URL. https://relay.fast/v1 is for the OpenAI format (Chat Completions) and serves every chat model in the catalog. https://relay.fast without /v1 is for the Anthropic Messages format and serves Claude models.

OpenClaw custom provider in the wizard

  1. Run openclaw onboard for a new installation or openclaw configure to change an existing one.
  2. At the model and authentication step, choose "Custom Provider".
  3. Enter the base URL https://relay.fast/v1 and your API key. Set compatibility to "OpenAI-compatible" and enter a model id such as deepseek-v4.1-flash.

The wizard can store the key as pasted text or as a secret reference. It reads the model list from the /models endpoint under the base URL, where relay.fast returns the models your key can use. You can pick a model from the list or type it by hand.

Set up the provider in the file

OpenClaw keeps its settings in ~/.openclaw/openclaw.json, written in JSON5. It reads environment variables from the process and from ~/.openclaw/.env, and any string in the settings can refer to a variable as ${VAR_NAME}.

  1. Add this line to ~/.openclaw/.env and put your relay.fast key in it.
    RELAY_FAST_API_KEY=sk-your-api-key
  2. Add the providers to ~/.openclaw/openclaw.json.
    {
      models: {
        mode: "merge",
        providers: {
          relayfast: {
            baseUrl: "https://relay.fast/v1",
            apiKey: "${RELAY_FAST_API_KEY}",
            api: "openai-completions",
            models: [
              { id: "deepseek-v4.1-flash", name: "deepseek-v4.1-flash", contextWindow: 1000000 },
              { id: "glm-5.3", name: "glm-5.3", contextWindow: 1000000 },
            ],
          },
          "relayfast-claude": {
            baseUrl: "https://relay.fast",
            apiKey: "${RELAY_FAST_API_KEY}",
            api: "anthropic-messages",
            models: [
              { id: "claude-sonnet-5-5", name: "claude-sonnet-5-5", contextWindow: 1000000, maxTokens: 128000 },
            ],
          },
        },
      },
      agents: {
        defaults: {
          model: { primary: "relayfast-claude/claude-sonnet-5-5" },
        },
      },
    }

The example describes two providers. relayfast uses api: "openai-completions" with the base URL that ends in /v1 and lists DeepSeek and GLM models. relayfast-claude uses api: "anthropic-messages" with the base URL without /v1 and lists a Claude model. The OpenClaw documentation says the base URL for the Anthropic format omits /v1 because the client adds it.

  • contextWindow tells OpenClaw the size of the model's context window. Without it OpenClaw assumes 200,000 tokens, and its documentation recommends explicit values.
  • maxTokens sets the maximum number of output tokens per response.
  • agents.defaults.model.primary names the model the agent starts with.
  • mode: "merge" is the default. It keeps OpenClaw's built-in catalog and adds these providers to it.

OpenClaw watches the file and applies provider and model changes without restarting the gateway.

Check and switch models

A model is addressed as provider/model.

openclaw models list
openclaw models set relayfast/deepseek-v4.1-flash
openclaw doctor

openclaw models list shows the models OpenClaw knows. openclaw models set changes the default model. openclaw doctor reports problems in the settings. openclaw models status --probe sends live requests to the providers, so it spends tokens.

In a chat, /model relayfast/deepseek-v4.1-flash switches the model. The Control UI opens at http://127.0.0.1:18789/.

Troubleshooting

  • 401 with the text Invalid token means the key is wrong, disabled or pasted with spaces, or RELAY_FAST_API_KEY is not in ~/.openclaw/.env.
  • 404 invalid_endpoint means the OpenAI-format base URL is missing /v1.
  • 404 with the text Invalid URL means the Anthropic-format base URL has an extra /v1.
  • 404 model_not_found means the model id does not match the catalog.
  • A 400 error saying the model is not available through this endpoint means a non-Claude model is listed under the anthropic-messages provider. Move it to the provider with openai-completions.
  • Run openclaw doctor to see which settings are wrong.

Keep agent costs under control

An agent sends the conversation, file contents and tool results with every step, so input tokens make up most of the bill. Use a mid-priced model for routine work and a frontier model for hard tasks, prefer models with a cache-read price for long sessions, and watch the usage in the dashboard until you know what a typical task costs. Current prices are in the live pricing catalog.

Current prices of the models in this guide

Prices checked from the live catalog. "From" is the lowest price among the relay.fast sources that currently serve the model. The price you pay depends on the source your request uses and can change on any day. The pricing page always shows current values.

ModelModel IDOfficial input / output per 1M tokensrelay.fast from, input / outputCache read fromContext
DeepSeek V4.1 Flash
price depends on the time of day; the peak-hours price is shown
deepseek-v4.1-flash$0.3 / $1.2$0.03 / $0.12 (−90%)$0.00061M
GLM-5.3glm-5.3$1.4 / $4.4$0.035 / $0.11 (−97%)$0.00651M
Claude Sonnet 5.5claude-sonnet-5-5$2 / $10$0.238 / $1.19 (−88%)$0.02381M

Frequently asked questions

Does OpenClaw need a subscription?

No. It takes an API key, and requests are billed per token to the relay.fast balance.

Which models work in OpenClaw through relay.fast?

Every chat model in the relay.fast catalog works through the OpenAI format. Claude models can also go through the Anthropic Messages format.

Do I need to restart OpenClaw after editing the config?

No. According to its documentation, OpenClaw applies provider and model changes without restarting the gateway.

Where is the OpenClaw API key stored?

With the file setup, the key is stored in the file ~/.openclaw/.env on your computer. The settings file only refers to the variable.

Is OpenClaw affiliated with relay.fast?

No. OpenClaw is a separate product. This page shows how to connect it to relay.fast.

Start with relay.fast