OpenAI shim configuration for Z.AI GLM models, shaping requests to match GLM expectations.
// Source: https://github.com/Gitlawb/openclaude | License: MIT | Copyright Anthropic PBC. All rights reserved
// Provided via justclaw.it.com; keep this notice with the code.
import type { OpenAIShimTransportConfig } from '../descriptors.js'
/**
* Z.AI (GLM) reasoning-compatible OpenAI-shim contract.
*
* Single source of truth for the request shaping GLM reasoning models need:
* preserved/echoed reasoning content, the zai-compatible thinking format,
* `max_tokens`, and stripping the unsupported `store` field.
*
* Applied explicitly via `transportOverrides.openaiShim` on catalog entries of
* Z.AI-contract GLM routes (e.g. opencode-go, atlas-cloud). The name-based
* matcher only infers this for non-catalog routes (direct/aggregator aliases),
* so catalog-backed non-Z.AI GLM entri
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key