Cut model costs with hosted open models
Updated August 10, 2026
Goal: keep working in Claude Code, but send the requests to a lower-cost hosted open model that speaks the Anthropic API.
What you need
- An account and API key from a service that hosts open models behind an anthropic-compatible endpoint. z.ai is one example, with hosted GLM models and a Claude Code setup path. We don’t rank hosts or quote prices because both change faster than this page does.
- Nothing else. Storing keys and configuring endpoints is free on every plan.
Steps
-
Get the base URL and key from your provider’s docs.
-
Add an open-model connection in Settings → agents → providers & keys:
Field Value Label z-aiKind anthropic-compatible Base URL https://api.z.ai/api/anthropicKey the key from that provider The key goes to your macOS Keychain and shows masked in the field.
-
Check it’s alive with
crystl status. A401or403counts as reachable on purpose: something is listening and it says your credentials are the problem, which is a different fix from a dead address. -
Open a new shard. Existing shards keep the environment they started with, so this only takes effect on a fresh one.
What you’ll see when it works
crystl status shows the slot as reachable, and in the new shard echo $ANTHROPIC_BASE_URL returns the provider’s URL. Claude Code runs as usual, against their models.
Your Anthropic key stays home. A real hosted Anthropic key is never sent to a configured endpoint. crystl sends the slot’s own key, or a documented dummy value when the endpoint doesn’t need one.
Two things to weigh. These are third-party services with their own terms, their own retention policy, and their own view of your code, so read the terms the way you would for any vendor. And quality varies by task: one of them can be great at mechanical work and weak on a reasoning-heavy change, and that ordering isn’t stable between providers or over time. Try it on your own work rather than trusting a benchmark.
A hosted open model doesn’t have the one-machine limit a local GPU does, so you can fan out on it the way you would on any hosted agent.
Go deeper
- Use z.ai open models with crystl for the complete account, plan, key, and first-shard tutorial.
- open models for the slot fields and the safety rule about keys.
- API key storage for hosted provider keys and custom environment variables.
- Claude Code still hits the frontier API if the change doesn’t seem to take.