AI SDK Adds Z.ai Model Capability Query Function

AI SDK's @ai-sdk/zai 3.0.63 adds a typed model capability query function.
@ai-sdk/zai releases patch version 3.0.63, whose core change is exporting a provider-specific model capability query function with typed model IDs. Developers can query locally—without API requests or extra configuration—whether a model supports tool calling, streaming output, multimodal input, and more, while also getting endpoint-level capability descriptions and provider option support info. Typed IDs give TypeScript editors autocompletion and compile-time validation, reducing risks from typos and model renames. The release also upgrades @ai-sdk/provider-utils and @ai-sdk/openai-compatible to stay consistent with the OpenAI-compatible protocol implementation. Overall it is an incremental iteration, but valuable for projects that rely on model capabilities for dynamic routing or configuration generation.
Version Update Overview
The AI SDK's @ai-sdk/zai package has released version 3.0.63. This update is a patch-level change (Patch Changes), but it introduces a capability that is quite useful for developers: exporting a provider-specific model capability query function with typed model IDs.

The release page shows that this version was automatically built and signature-verified by GitHub Actions, and it also updated two dependencies: @ai-sdk/provider-utils and @ai-sdk/openai-compatible.
What Problem Does the Capability Query Function Solve?
When building applications based on large models, developers often need to determine whether a model supports specific capabilities—such as tool calling, streaming output, or multimodal input. Previously, this kind of determination either relied on hardcoded model lists or required making a real API request to probe. Neither is ideal: hardcoding easily becomes outdated as models iterate, while making requests introduces extra latency and cost.
The query function exported in this update lets developers directly query a model's capability information without making any API requests or requiring additional configuration. In other words, this is a purely local, static capability description; calling it incurs no network overhead.
To understand this type of capability query function, it helps to first distinguish between two paradigms: "model capability metadata" and "runtime probing." Metadata is a static description distributed with the SDK, usually maintained by the provider or community, with fields covering tool calling, structured output, vision input, context window, and more. Runtime probing, by contrast, infers capabilities by observing model behavior through actual requests. The former is zero-cost but may lag behind the online model version; the latter is accurate but expensive. A common industry practice is to combine the two: prefer reading metadata, and fall back to conservative assumptions or explicit probing when encountering unknown models. The query function exported here belongs to the metadata paradigm, and its value lies in consolidating capability information scattered across documentation and source code into a unified, programmatically accessible interface.
Development Experience Improvements Brought by Typed Model IDs
The update notes specifically emphasize "typed model IDs." In TypeScript projects, this means the editor can provide autocompletion and type checking for model IDs, and typos will be exposed at compile time rather than only causing errors at runtime.
For teams maintaining integrations with multiple models, this type safety can significantly reduce hidden issues caused by model name changes or inconsistent spelling. Combined with endpoint-level capability descriptions, developers can match the appropriate capability set to each deployment endpoint, accommodating differences in the same model across environments.
"Typed model IDs" are typically implemented using TypeScript's union of string literal types or as const assertions: the SDK internally maintains a constant table of model IDs and preserves literal types on export rather than degrading to string. This way, when calling generateText({ model: 'xxx' }), the editor can provide a completion list, and invalid values directly trigger type errors. A common accompanying pattern is a "type-narrowed mapping table"—declaring the capability table with Record<ModelId, Capabilities>, so that if you forget to add a capability description when adding a new model, the compiler will report an error. Note that typed IDs only cover models known at the time the SDK is released; custom or self-hosted models often need to fall back to plain strings, so libraries usually retain a permissive overload to accommodate unknown IDs.
Provider Option Descriptions and Support Information
In addition to model capabilities themselves, the function also provides descriptions and support status for provider options. This is essentially exposing parameter descriptions that were previously scattered across documentation to programs in the form of structured data. Developers can use this to dynamically generate configuration interfaces or provide more accurate prompts when validating user input.
This approach of "turning documentation into machine-readable data" is gradually becoming a trend in SDK design, reducing the maintenance burden caused by documentation drifting out of sync with implementation.
"Provider options" refer to proprietary parameters exposed by various models beyond standard parameters, such as thinking budgets, cache control, and safety levels from certain vendors. In the AI SDK's design, such parameters are typically passed through a unified providerOptions field, grouped by provider namespace. Exposing option descriptions as structured data means you can programmatically learn which keys an endpoint supports, their value ranges, and default values, thereby completing parameter validation before runtime. This is in line with the JSON Schema-driven approach: documentation as data, data as validation, reducing the work of hand-writing forms and prompt text, and also preventing documentation updates from lagging behind the actual implementation.
Synchronized Dependency Updates
This version also upgrades @ai-sdk/provider-utils to 5.0.88 and @ai-sdk/openai-compatible to 3.0.99. Since the Z.ai provider is built on the OpenAI-compatible protocol, synchronizing these dependencies helps maintain consistency with the underlying protocol implementation.
@ai-sdk/openai-compatible is the generic adapter layer that the AI SDK provides for "OpenAI-compatible protocol" providers. Many vendors' inference services (including Z.ai) expose interfaces that are highly consistent with OpenAI's Chat Completions or Responses protocols, so this adapter can be reused directly without implementing one separately for each vendor. @ai-sdk/provider-utils, meanwhile, carries utility functions shared across providers, such as streaming parsing, error wrapping, and schema validation. Both are low-level dependencies under semantic versioning, and their patch upgrades usually bring protocol detail fixes and compatibility improvements. Since upper-layer packages reference them through peer or regular dependencies, you should pay attention to whether version ranges match when upgrading, to avoid type incompatibilities caused by multiple provider-utils instances in the same project.
Developer Recommendations
If you already use @ai-sdk/zai in your project, you can upgrade directly to this version and try the new capability query function. It is recommended to replace hardcoded checks with the query function in model selection logic, especially in scenarios where dynamic routing based on model capabilities is needed. For other providers that rely on OpenAI-compatible interfaces, you can also watch whether corresponding updates to @ai-sdk/openai-compatible bring similar capabilities.
Related articles

Unpacking the OpenAI–Anthropic Joint Statement Line by Line: AI Finds Math Weakness, Global Encryption Faces Major Overhaul
OpenAI and Anthropic's joint statement reveals AI-discovered cryptographic mathematical weaknesses. A line-by-line breakdown of the 15 sentences: existing encryption security drops sharply, the post-quantum migration window is shorter than official reassurances suggest, and H1 2027 becomes a key milestone.

MedGemma 2: A New Breakthrough in Open Medical Models Built on Gemma 4
Google releases MedGemma 2, an open medical model built on Gemma 4, shifting from medical Q&A to supporting authorized medical record retrieval, clinical score evaluation, and clinical guideline-based Q&A to help developers build real clinical workflow applications.
Six Experts on AI for Good: How to Ret…
Six Experts on AI for Good: How to Return AI to Public Value
Six experts on Hacker News discuss how to return AI to public value: challenging technological neutrality, building public AI infrastructure, and the governance debate over who defines the public good—mapping consensus and unresolved challenges in AI for good.