Skip to content

Setting up Synthetic with OpenClaw

I used to spend way too much time tweaking API calls every time I wanted to try a new model. It felt like I was writing boilerplate instead of building features. I wanted a way to use different models without rewriting my entire integration.

Then I found Synthetic. It maps everything to the Anthropic Messages API, which is exactly what OpenClaw likes. It makes switching between models like MiniMax or DeepSeek feel like a simple configuration change instead of a major project.

  • An active SYNTHETIC_API_KEY.
  • OpenClaw installed on your machine.

You can get this running in about five minutes. I recommend using the onboarding wizard because it handles the heavy lifting for you.

  1. Set your API key: Export your key to your environment so OpenClaw can find it.

    Terminal window
    export SYNTHETIC_API_KEY="your-sk-here"
  2. Run the onboarding: This command registers the provider and sets up your initial config.

    Terminal window
    openclaw onboard --auth-choice synthetic-api-key

The default model is synthetic/hf:MiniMaxAI/MiniMax-M2.1. If you want to customize your setup, here is what your config.json5 should look like:

{
env: { SYNTHETIC_API_KEY: "sk-..." },
agents: {
defaults: {
model: { primary: "synthetic/hf:MiniMaxAI/MiniMax-M2.1" },
models: { "synthetic/hf:MiniMaxAI/MiniMax-M2.1": { alias: "MiniMax M2.1" } },
},
},
models: {
mode: "merge",
providers: {
synthetic: {
baseUrl: "https://api.synthetic.new/anthropic",
apiKey: "${SYNTHETIC_API_KEY}",
api: "anthropic-messages",
models: [
{
id: "hf:MiniMaxAI/MiniMax-M2.1",
name: "MiniMax M2.1",
reasoning: false,
input: ["text"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 192000,
maxTokens: 65536,
},
],
},
},
},
}

Even simple setups have quirks. Here are two things that usually trip people up:

  • The URL Suffix: OpenClaw’s Anthropic client adds /v1 to the end of the base URL automatically. Make sure your baseUrl is https://api.synthetic.new/anthropic. If you add /v1 yourself, the final URL will be broken and calls will fail.
  • Missing Models: If you use an allowlist in agents.defaults.models, you have to manually add every model ID you want to use. If a model isn’t in that list, OpenClaw will block the request.
  • Incorrect Prefixes: Always use the synthetic/ prefix when referencing models in your agent settings.
  • Authentication Errors: Double-check that your SYNTHETIC_API_KEY is actually loaded in your current shell session.

If you hit a wall, you can always ask the AI Setup Assistant for help.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.