Skip to content
Connect a clientZCode

ZCode

new

Z.ai desktop agent: the Guard address and key go into the settings window, no files to edit.

Set up with your own AI
Model protocol

ZCode is the desktop agent app from Z.ai for macOS, Windows and Linux (download page). A third-party provider is added right in the settings: name, address, key and a model list. Guard connects as one provider for every family at once.

  1. Open Settings (the button in the lower-left corner), then Model settings, Add provider, Custom endpoint.
  2. Name: Guard AI.
  3. Base URL: https://api.guardrelay.ai (without /v1: ZCode appends the /v1/messages path itself).
  4. API key: your gd-… key from the bot.
  5. API format: Anthropic messages (/v1/messages).
  6. Add model: enter the Model ID from the list below and the context window; under Advanced set Max output tokens = 32000. Repeat for every model you need.
  7. Click Add provider, switch the provider on and pick a model in the chat.

Type the model id exactly as listed: ZCode sends it to the server unchanged. The context window is the budget the client uses for the chat history. The 32,000 output limit is the Guard reply cap for Claude, Composer and Grok; Kimi receives the value as is.

Model IDContext window
claude-sonnet-51M
claude-opus-51M
claude-fable-5-11M
claude-fable-51M
claude-opus-4-81M
claude-opus-4-71M
claude-opus-4-61M
claude-opus-4-5200K
claude-sonnet-4-61M
claude-sonnet-4-5200K
claude-haiku-4-5200K
Model IDContext window
k31M
k3-256k256K
kimi-for-coding256K
kimi-for-coding-highspeed256K
Model IDContext window
cursor-grok-4.6-low500K
cursor-grok-4.6-medium500K
cursor-grok-4.6-high500K
cursor-grok-4.6-xhigh500K
cursor-grok-4.6-low-fast500K
cursor-grok-4.6-medium-fast500K
cursor-grok-4.6-high-fast500K
cursor-grok-4.6-xhigh-fast500K
Model IDContext window
composer-2.5200K
composer-2.5-fast200K

Context window takes a number: Claude 1M is 1000000, Kimi K3 is 1048576, other Kimi models use 262144, Grok 500000, and Composer or 200K Claude models use 200000.

Prices and details for every model are on the Models page. For Grok the reasoning level is chosen by the model name (low, medium, high, xhigh); Composer has no reasoning: the ZCode reasoning switch does not affect these models.

The reasoning mode ZCode enables by default is adjusted by Guard to what each model accepts: Fable 5.1 always reasons adaptively, and the effort level is not applied on Haiku 4.5 and Sonnet 4.5. Kimi takes the ZCode reasoning parameters as is.

To receive an image created by Grok or Composer, ask the model to save it in the working folder. Supported images are delivered at the end of the reply as a download link valid for 24 hours, accessible without a key. Automatically created assets without that save step are not delivered. This delivers images, not arbitrary files. There is no separate file fee; request tokens are billed.

Documentation sections

On this page