OpenClaw Codex

Recipe

Non-OpenAI Models: Minimax, Kimi & DeepSeek

Connect OpenClaw to Chinese and alternative LLM providers. These models are often significantly cheaper than OpenAI equivalents and perform well on Chinese-language tasks, coding, and reasoning.

Provider Comparison

Provider Best Model Strength Price (input/1M)
Moonshot (Kimi)kimi-k2-0711-previewLong context, coding, agents~$0.60
DeepSeekdeepseek-chat (V3)Coding, reasoning, very cheap~$0.27
MiniMaxabab6.5-chatChinese NLP, voice, multimodal~$0.04
DeepSeek R1deepseek-reasonerComplex reasoning, math~$0.55

Moonshot / Kimi Setup

Get your API key at platform.moonshot.cn.

bashsecrets.env
MOONSHOT_API_KEY=sk-your-moonshot-key-here
jsonprovider config
{
  "providers": {
    "moonshot": {
      "type": "moonshot",
      "api_key": "${MOONSHOT_API_KEY}",
      "models": {
        "kimi-k2-0711-preview": {
          "alias": "kimi",
          "max_tokens": 131072,
          "temperature": 0.6
        },
        "moonshot-v1-8k": {
          "alias": "kimi-fast",
          "max_tokens": 8192
        }
      }
    }
  }
}

Kimi K2 is especially strong for agent tasks — it reliably calls tools, handles long context, and follows AGENTS.md / SOUL.md instructions well. This is why OpenClaw Codex uses it for autonomous cron jobs.

DeepSeek Setup

Get your API key at platform.deepseek.com.

bashsecrets.env
DEEPSEEK_API_KEY=sk-your-deepseek-key-here
jsonprovider config
{
  "providers": {
    "deepseek": {
      "type": "deepseek",
      "api_key": "${DEEPSEEK_API_KEY}",
      "models": {
        "deepseek-chat": {
          "alias": "ds-v3",
          "max_tokens": 8192,
          "temperature": 0.7
        },
        "deepseek-reasoner": {
          "alias": "ds-r1",
          "max_tokens": 32768,
          "temperature": 0.6,
          "note": "Use for complex reasoning and math tasks"
        }
      }
    }
  }
}

MiniMax Setup

Get your API key at platform.minimaxi.com. MiniMax requires both an API key and a Group ID.

bashsecrets.env
MINIMAX_API_KEY=your-minimax-api-key
MINIMAX_GROUP_ID=your-group-id
jsonprovider config
{
  "providers": {
    "minimax": {
      "type": "minimax",
      "api_key": "${MINIMAX_API_KEY}",
      "group_id": "${MINIMAX_GROUP_ID}",
      "models": {
        "abab6.5-chat": {
          "alias": "minimax",
          "max_tokens": 4096,
          "temperature": 0.9
        },
        "abab6.5s-chat": {
          "alias": "minimax-turbo",
          "max_tokens": 2048
        }
      }
    }
  }
}

Cost-Optimized Routing

Route short/simple requests to cheap models, complex tasks to capable ones:

json
{
  "routing": {
    "strategy": "cost_optimized",
    "rules": [
      {
        "if": { "estimated_tokens_lt": 500 },
        "use": "minimax/abab6.5s-chat"
      },
      {
        "if": { "task_type": "reasoning" },
        "use": "deepseek/deepseek-reasoner"
      },
      {
        "default": true,
        "use": "moonshot/kimi-k2-0711-preview"
      }
    ]
  }
}

What's Next?