{"id":295650,"date":"2026-06-19T19:09:18","date_gmt":"2026-06-19T19:09:18","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/ai-provider-for-z-ai\/"},"modified":"2026-06-19T19:08:42","modified_gmt":"2026-06-19T19:08:42","slug":"ai-provider-for-zai","status":"publish","type":"plugin","link":"https:\/\/frp.wordpress.org\/plugins\/ai-provider-for-zai\/","author":20983055,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.0","stable_tag":"1.0.0","tested":"7.0","requires":"7.0","requires_php":"7.4","requires_plugins":null,"header_name":"AI Provider for Z.AI","header_author":"Huzaifa Al Mesbah","header_description":"AI Provider for Z.AI (GLM models) for the WordPress AI Client.","assets_banners_color":"364fc3","last_updated":"2026-06-19 19:08:42","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/huzaifaalmesbah\/ai-provider-for-zai","header_author_uri":"https:\/\/profiles.wordpress.org\/huzaifaalmesbah\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":79,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"huzaifaalmesbah","date":"2026-06-19 19:08:42"}},"upgrade_notice":{"1.0.0":"<p>Initial release.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3579132,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3579132,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3579132,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3579132,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":[],"screenshots":{"1":"AI Client Credentials settings page where you enter your Z.AI API key."}},"plugin_section":[],"plugin_tags":[2353,5739,25308,267983,267982],"plugin_category":[],"plugin_contributors":[221881],"plugin_business_model":[],"class_list":["post-295650","plugin","type-plugin","status-publish","hentry","plugin_tags-ai","plugin_tags-artificial-intelligence","plugin_tags-connector","plugin_tags-glm","plugin_tags-zai","plugin_contributors-huzaifaalmesbah","plugin_committers-huzaifaalmesbah"],"banners":{"banner":"https:\/\/ps.w.org\/ai-provider-for-zai\/assets\/banner-772x250.png?rev=3579132","banner_2x":"https:\/\/ps.w.org\/ai-provider-for-zai\/assets\/banner-1544x500.png?rev=3579132","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/ai-provider-for-zai\/assets\/icon-128x128.png?rev=3579132","icon_2x":"https:\/\/ps.w.org\/ai-provider-for-zai\/assets\/icon-256x256.png?rev=3579132","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin provides Z.AI integration for the WP AI Client SDK. It enables WordPress sites to use Z.AI GLM models for text generation and related AI capabilities.<\/p>\n\n<p><strong>Features:<\/strong><\/p>\n\n<ul>\n<li>Text generation with Z.AI GLM models (glm-4.5, glm-4.6, glm-4.7, glm-5, and more)<\/li>\n<li>Chat history support<\/li>\n<li>Function calling support<\/li>\n<li>JSON output support<\/li>\n<li>Automatic provider registration<\/li>\n<\/ul>\n\n<p>Available models are dynamically discovered from the Z.AI API.<\/p>\n\n<p><strong>Requirements:<\/strong><\/p>\n\n<ul>\n<li>PHP 7.4 or higher<\/li>\n<li>WP AI Client plugin must be installed and activated<\/li>\n<li>Z.AI API key from z.ai<\/li>\n<\/ul>\n\n<h3>Usage<\/h3>\n\n<p>The provider automatically registers itself on the <code>init<\/code> hook. Once both plugins are active and your API key is configured, you can start generating text:<\/p>\n\n<h4>Basic Text Generation<\/h4>\n\n<pre><code>$text = AI_Client::prompt( 'Explain quantum computing.' )-&gt;using_provider( 'zai' )-&gt;generate_text();\n<\/code><\/pre>\n\n<h4>With System Instructions<\/h4>\n\n<pre><code>$text = AI_Client::prompt( 'Summarize the history of WordPress.' )-&gt;using_provider( 'zai' )-&gt;using_system_instruction( 'Be concise and accurate.' )-&gt;using_temperature( 0.2 )-&gt;using_max_tokens( 500 )-&gt;generate_text();\n<\/code><\/pre>\n\n<h4>JSON Output<\/h4>\n\n<pre><code>$json = AI_Client::prompt( 'Analyze this topic: WordPress plugins' )-&gt;using_provider( 'zai' )-&gt;as_json_response( $schema )-&gt;generate_text();&lt;h3&gt;External services&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>This plugin connects to the Z.AI API to provide AI-powered text generation capabilities within WordPress. Z.AI is a third-party service.<\/p>\n\n<h4>What data is sent and when<\/h4>\n\n<ul>\n<li><strong>API key<\/strong>: Your Z.AI API key is sent with every request for authentication.<\/li>\n<li><strong>API type auto-detection<\/strong>: When you save or change your API key, the plugin sends one minimal test request (a one-word prompt) to each Z.AI endpoint to determine which API type your key belongs to. This happens only at the moment the key is saved.<\/li>\n<li><strong>Model listing<\/strong>: When the plugin checks provider availability or lists available models, it sends a request to the Z.AI API to retrieve the current list of GLM models.<\/li>\n<li><strong>Text generation prompts<\/strong>: When your site uses the plugin to generate text, the prompt text (and any system instructions and conversation history) is sent to the Z.AI API for processing.<\/li>\n<\/ul>\n\n<p>Communication is sent to the Z.AI API at one or both of the following base URLs (the API-type auto-detection contacts both; all other requests use the detected one):<\/p>\n\n<ul>\n<li>General API: <a href=\"https:\/\/api.z.ai\/api\/paas\/v4\">https:\/\/api.z.ai\/api\/paas\/v4<\/a><\/li>\n<li>Coding API: <a href=\"https:\/\/api.z.ai\/api\/coding\/paas\/v4\">https:\/\/api.z.ai\/api\/coding\/paas\/v4<\/a><\/li>\n<\/ul>\n\n<p>Data is only sent when the plugin is actively used to generate text or when checking model availability. No data is sent passively or in the background.<\/p>\n\n<h4>Service links<\/h4>\n\n<ul>\n<li>Z.AI website: <a href=\"https:\/\/z.ai\">https:\/\/z.ai<\/a><\/li>\n<li>Z.AI Terms of Service: <a href=\"https:\/\/z.ai\/terms\">https:\/\/z.ai\/terms<\/a><\/li>\n<li>Z.AI Privacy Policy: <a href=\"https:\/\/z.ai\/privacy\">https:\/\/z.ai\/privacy<\/a><\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Ensure the WP AI Client plugin is installed and activated<\/li>\n<li>Upload the plugin files to <code>\/wp-content\/plugins\/ai-provider-for-zai\/<\/code><\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Open the WP AI Client credentials screen (the AI Credentials \/ \"Connectors\" settings provided by the WP AI Client plugin) and enter your Z.AI API key. The correct API type is auto-detected from the key.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"how%20do%20i%20get%20a%20z.ai%20api%20key%3F\"><h3>How do I get a Z.AI API key?<\/h3><\/dt>\n<dd><p>Visit <a href=\"https:\/\/z.ai\">z.ai<\/a> to create an account and generate an API key.<\/p><\/dd>\n<dt id=\"which%20models%20are%20available%3F\"><h3>Which models are available?<\/h3><\/dt>\n<dd><p>Available models include glm-4.5, glm-4.5-air, glm-4.6, glm-4.7, glm-5, and glm-5-turbo. Models are dynamically fetched from the Z.AI API, so new models will appear automatically.<\/p><\/dd>\n<dt id=\"does%20this%20plugin%20work%20without%20the%20wp%20ai%20client%3F\"><h3>Does this plugin work without the WP AI Client?<\/h3><\/dt>\n<dd><p>No, this plugin requires the WP AI Client plugin to be installed and activated. It provides the Z.AI-specific implementation that the WP AI Client uses.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<li>Support for Z.AI GLM text generation models (glm-4.5, glm-4.6, glm-4.7, glm-5, and more)<\/li>\n<li>Chat history support<\/li>\n<li>Function calling support<\/li>\n<li>JSON output support<\/li>\n<\/ul>","raw_excerpt":"AI Provider for Z.AI (GLM models) for the WordPress AI Client.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/295650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=295650"}],"author":[{"embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/huzaifaalmesbah"}],"wp:attachment":[{"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=295650"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=295650"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=295650"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=295650"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=295650"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=295650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}