跳到正文
FunCoding

Liquid Inference

Connect Liquid Inference as a custom OpenAI-compatible provider

Liquid Inference is an inference exchange with an OpenAI-compatible endpoint. Configure it with OpenClaw's existing custom-provider support and the openai-completions API.

PropertyValue
Provider idliquid (custom)
AuthLiquid Inference API key with spend scope
APIopenai-completions
Base URLhttps://router.inference.ai.exchange/v1

Quick start

Create a key

Sign in at inference.ai.exchange, add credit to your workspace, and create an API key with the spend scope. Export it in the shell you use for the next steps:

export LIQUID_API_KEY="example-liquid-key-not-real"

Configure the provider

Merge this block into your openclaw.json. Keep the /v1 suffix in baseUrl: the OpenAI client appends chat/completions.

{
  models: {
    providers: {
      liquid: {
        baseUrl: "https://router.inference.ai.exchange/v1",
        api: "openai-completions",
        headers: {
          "X-Title": "OpenClaw",
          "x-liquid-cap-usd": "1.00",
        },
        models: [
          {
            id: "liquid.auto",
            name: "liquid.auto",
            input: ["text"],
            contextWindow: 128000,
            maxTokens: 8192,
          },
        ],
      },
    },
  },
}

Save the key

printf '%s\n' "$LIQUID_API_KEY" | openclaw models auth paste-api-key --provider liquid --agent main

With the custom provider configured, this stores the key in OpenClaw's shared credential store and binds the provider to it. The key does not need to stay in the Gateway service's environment. If the command reports that the Gateway has not applied the settings, restart the Gateway before testing.

Select and test the model

openclaw models set liquid/liquid.auto
openclaw agent exec --cwd . --model liquid/liquid.auto "Reply with the word ready"

Models

The model id is sent to the exchange unchanged. liquid.auto lets the exchange choose a model for each request. To list the current model names:

curl https://router.inference.ai.exchange/v1/models

Add a models entry for each name you want to select. Set contextWindow and maxTokens to limits supported by that model and the offers you use; OpenClaw uses the context window when deciding when to compact a session.

Request headers and spending

HeaderPurpose
X-TitleIdentifies OpenClaw on Liquid Inference receipts.
x-liquid-cap-usdMaximum charge for one request, in USD.

The configured headers accompany requests to this provider, including compaction requests. A turn can make several requests, so a per-request cap does not cap the whole turn's cost. Use the key's spend limit to bound total spending.

To change the per-request cap:

openclaw config set models.providers.liquid.headers.x-liquid-cap-usd '"0.25"' --strict-json

Errors and fallback models

OpenClaw applies its normal retry, credential cooldown, and model-fallback behavior. See Model failover, including Billing disables for 402 responses.

A fallback at another provider can answer a refused request and bill you there. If you want requests to remain on Liquid Inference, use only liquid/ fallback models or clear the fallback list:

openclaw config set agents.defaults.model.fallbacks '[]' --strict-json
SymptomCheck
401Save a valid key with the command above.
402Check workspace credit and the key's spend limit, then billing cooldowns.
404Keep /v1 at the end of baseUrl.
no_eligible_offerInspect eligibility.excluded in the error response.
No receipt for a successful turnCheck whether a fallback at another provider answered.

See Model providers for custom-provider configuration and Models for model selection.