Synthetic Claude Code wrapper (defaults to K3 as the model) A developer created a shell wrapper called 'synclaude' that routes Claude Code's interface through Synthetic's API, allowing users to run open models like Kimi K3, GLM 5.2, and MiniMax M3 while keeping Claude Code's agent and tool features. The wrapper validates models against Synthetic's live catalogue and ensures all model slots use the chosen model. A shell wrapper that points Claude Code https://claude.com/claude-code at Synthetic https://synthetic.new , so you keep the Claude Code interface — agents, tools, subagents, slash commands — while inference runs on open models like Kimi K3, GLM 5.2 and MiniMax M3. It is one function plus three helpers. Paste the block below into your shell rc and you are done. - Picks a model per run with a substring: --model k3 , --model glm-5.2 - Validates the model against Synthetic's live catalogue, so a typo fails immediately with the real options instead of silently doing the wrong thing - Points every model slot at your choice — main, opus, sonnet, haiku and subagents — so delegated work does not quietly fall back to something else - Leaks nothing into your shell: every variable is scoped to the child process | Tool | Why | |---|---| claude | the CLI itself — npm i -g @anthropic-ai/claude-code | curl | fetches the model catalogue | jq | parses it — brew install jq | awk , sed , find | matching and caching already on macOS/Linux | Shell: bash 3.2+ or zsh . It uses arrays, so it is not POSIX sh . A Synthetic API key: https://synthetic.new https://synthetic.new → Settings → API Keys . Add your key and the function to ~/.zshrc or ~/.bashrc : export SYNTHETIC API KEY="syn xxxxxxxxxxxxxxxx" Then paste this block: ── synclaude ──────────────────────────────────────────────────────────────── Run Claude Code against Synthetic https://synthetic.new . Works in bash 3.2+ and zsh. Requires: claude, curl, jq, awk. Fetches the model catalogue, cached for six hours under TMPDIR. Pass any argument to force a refetch. synclaude models { local cache="${TMPDIR:-/tmp}/synclaude-models-$ id -u .json" if -n "${1:-}" || -s "$cache" || -n "$ find "$cache" -mmin +360 2 /dev/null " ; then if curl -fsS -m 20 https://api.synthetic.new/v1/models \ -H "Authorization: Bearer ${SYNTHETIC API KEY:-}" -o "$cache.tmp" 2 /dev/null; then mv -f "$cache.tmp" "$cache" else rm -f "$cache.tmp" A stale cache still beats failing outright when the network is down. -s "$cache" || return 1 fi fi jq -r '.data ?.id' "$cache" 2 /dev/null | sort } Turns a shorthand into exactly one model id, e.g. k3 - hf:moonshotai/Kimi-K3. An exact id wins over a substring, without which a model whose name is a prefix of another could never be selected. Ambiguous or unknown input fails with the real options rather than guessing. awk, not grep: a GREP OPTIONS containing -n in the environment prefixes line numbers onto every match and corrupts the resolved id. synclaude resolve model { local query="$1" ids matches if command -v jq /dev/null 2 &1; then printf &2 "synclaude: --model needs 'jq' to read the catalogue brew install jq \n" return 1 fi if ids="$ synclaude models "; then printf &2 'synclaude: could not fetch the catalogue from api.synthetic.new\n' return 1 fi if "$query" = "--list" ; then printf '%s\n' "$ids" return 0 fi matches="$ printf '%s\n' "$ids" | awk -v q="$query" '$0 == q' " -z "$matches" && matches="$ printf '%s\n' "$ids" | awk -v q="$query" 'BEGIN{q=tolower q } index tolower $0 , q ' " A model published since the cache was written: refetch once before failing. if -z "$matches" ; then ids="$ synclaude models force " || : matches="$ printf '%s\n' "$ids" | awk -v q="$query" 'BEGIN{q=tolower q } index tolower $0 , q ' " fi if -z "$matches" ; then printf &2 "synclaude: no model matches '%s'. Available:\n" "$query" printf '%s\n' "$ids" | sed 's/^/ /' &2 return 1 fi if "$ printf '%s\n' "$matches" | awk 'END{print NR}' " -gt 1 ; then printf &2 "synclaude: '%s' is ambiguous, it matches:\n" "$query" printf '%s\n' "$matches" | sed 's/^/ /' &2 return 1 fi printf '%s\n' "$matches" } synclaude help { cat <