Skip to content

Use ZhiFlo in OpenClaw

This guide adds a model provider to your local OpenClaw configuration. At the end, openclaw models status will recognize ZhiFlo and you can select zhiflo/<model ID> for a local chat.

  • Install OpenClaw from its official documentation, then confirm that openclaw --version prints version information.
  • Create a Token for this device.
  • Copy a complete model ID from your account.
Terminal window
read -s ZHIFLO_API_TOKEN
export ZHIFLO_API_TOKEN
Terminal window
$secureToken = Read-Host "Paste your ZhiFlo Token" -AsSecureString
$env:ZHIFLO_API_TOKEN = [System.Net.NetworkCredential]::new("", $secureToken).Password

The Token is available to processes for this user session. Do not write its real value into openclaw.json or a project repository.

Open:

~/.openclaw/openclaw.json

Merge models.providers.zhiflo from the example below into your existing JSON. Keep other providers, Gateway settings, and user preferences. Replace both <MODEL_FROM_ZHIFLO> values with the same complete model ID.

{
"models": {
"providers": {
"zhiflo": {
"baseUrl": "https://api.zhiflo.com/v1",
"apiKey": "${ZHIFLO_API_TOKEN}",
"api": "openai-completions",
"models": [
{
"id": "<MODEL_FROM_ZHIFLO>",
"name": "<MODEL_FROM_ZHIFLO>"
}
]
}
}
}
}

Use openai-completions with the /v1 Base URL. The name controls a local label; the id must match the account model exactly.

  1. Save openclaw.json.

  2. In the same terminal where you set the environment variable, run:

    Terminal window
    openclaw models status

    The output should recognize zhiflo and the configured model.

  3. Replace the placeholder with the same model ID and make it current:

    Terminal window
    openclaw models set "zhiflo/<MODEL_FROM_ZHIFLO>"
  4. Open your local OpenClaw chat interface from the same terminal.

  5. Run /model status in the chat.

    The status should show the ZhiFlo provider address and OpenAI Completions mode.

  6. Confirm that the current model is zhiflo/<model ID>.

  7. Send:

    Do not run tools. Reply with OK only.

An OK reply confirms both model selection and an actual request.

  • No zhiflo in status: verify the exact models.providers.zhiflo nesting and correct any JSON punctuation errors.
  • A running Gateway still shows old settings: restart that Gateway after saving, then run openclaw models status again. Do not disable authentication or enable insecure access as a workaround.
  • The model appears but requests fail: check that api is openai-completions, baseUrl is https://api.zhiflo.com/v1, and the current terminal can read ZHIFLO_API_TOKEN.
  • Model unavailable: copy the ID again and update id, name, and the models set command together.

Next: Troubleshoot by visible symptom.