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.
What You’ll Need
Section titled “What You’ll Need”- An active
SYNTHETIC_API_KEY. - OpenClaw installed on your machine.
Quick Start
Section titled “Quick Start”You can get this running in about five minutes. I recommend using the onboarding wizard because it handles the heavy lifting for you.
-
Set your API key: Export your key to your environment so OpenClaw can find it.
Terminal window export SYNTHETIC_API_KEY="your-sk-here" -
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, }, ], }, }, },}Troubleshooting
Section titled “Troubleshooting”Even simple setups have quirks. Here are two things that usually trip people up:
- The URL Suffix: OpenClaw’s Anthropic client adds
/v1to the end of the base URL automatically. Make sure yourbaseUrlishttps://api.synthetic.new/anthropic. If you add/v1yourself, 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_KEYis actually loaded in your current shell session.
If you hit a wall, you can always ask the AI Setup Assistant for help.
What’s Next
Section titled “What’s Next”OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.