{ "model_id": "z-ai/glm-5.3", "name": "GLM-5.3", "description": "GLM-5.3 from Z.ai, available through Cloudflare Workers AI and Subconscious.", "task": "Text Generation", "author": "z-ai", "modality": "text-generation", "tags": [ "LLM", "Reasoning", "Coding" ], "context_length": null, "max_output_tokens": null, "schema_version": "1.0.0", "pricing": { "Input tokens (per 1M)": 1.4, "Cached input tokens (per 1M)": 0.26, "Output tokens (per 1M)": 4.4 }, "examples": [ { "name": "Simple Question", "description": "Ask GLM-5.3 a short question using Chat Completions", "input": { "messages": [ { "role": "user", "content": "What is 2+2? Answer in one sentence." } ], "max_tokens": 128 }, "output": { "text": "2+2 equals 4." }, "raw_response": { "id": "ca570486-2b1b-4571-be5b-4fda719245d3", "object": "chat.completion", "created": 1795545292, "model": "z-ai/glm-5.3", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "2+2 equals 4.", "reasoning_content": "The user asks \"What is 2+2?\" and wants the answer in one sentence. This is a simple arithmetic question. The answer is 4. They want it in one sentence. I should just answer directly and concisely." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 24, "completion_tokens": 58, "total_tokens": 82, "prompt_tokens_details": { "cached_tokens": 0 } }, "metadata": { "weight_version": "default", "weight_versions": [ { "end": 58, "start": 0, "version": "default" } ] }, "subconscious": { "logical_model": "subconscious/glm-5.3-marathon", "request_id": "req_74d82f6f1c644d6fa70eda4efde5153d", "trace_id": "811fe0355f3d45ddb8312e84fd768dc3" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'z-ai/glm-5.3',\n {\n messages: [{ role: 'user', content: 'What is 2+2? Answer in one sentence.' }],\n max_tokens: 128,\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"z-ai/glm-5.3\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is 2+2? Answer in one sentence.\"\n }\n ],\n \"max_tokens\": 128\n}'" } ] }, { "name": "Responses API", "description": "Ask GLM-5.3 a short question using the Responses API", "input": { "input": "Explain in two sentences when to use a mutex in Go.", "max_output_tokens": 256 }, "output": { "text": "In Go, use a mutex when multiple goroutines need safe access to shared state (like a map, slice, or struct) that they both read and write, preventing race conditions and data corruption. Prefer alternatives like channels or atomic operations for simpler cases, but reach for a mutex when protecting a small critical section or when the shared data doesn't fit a message-passing model." }, "raw_response": { "id": "resp_req_f1bfe9d18afa45c98c0e961da4669d38", "object": "response", "created_at": 1795545293, "model": "z-ai/glm-5.3", "output": [ { "content": [ { "annotations": [], "text": "In Go, use a mutex when multiple goroutines need safe access to shared state (like a map, slice, or struct) that they both read and write, preventing race conditions and data corruption. Prefer alternatives like channels or atomic operations for simpler cases, but reach for a mutex when protecting a small critical section or when the shared data doesn't fit a message-passing model.", "type": "output_text" } ], "id": "msg_req_f1bfe9d18afa45c98c0e961da4669d38", "role": "assistant", "status": "completed", "type": "message" } ], "status": "completed", "usage": { "input_tokens": 25, "output_tokens": 78, "total_tokens": 103, "input_tokens_details": { "cached_tokens": 0 }, "output_tokens_details": { "reasoning_tokens": 0 } }, "error": null, "incomplete_details": null, "parallel_tool_calls": true, "subconscious": { "logical_model": "subconscious/glm-5.3-marathon", "request_id": "req_f1bfe9d18afa45c98c0e961da4669d38", "trace_id": "122fa51309e2428a8ff2cb988b3e1874" }, "tool_choice": "auto", "tools": [] }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'z-ai/glm-5.3',\n { input: 'Explain in two sentences when to use a mutex in Go.', max_output_tokens: 256 },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/responses \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"z-ai/glm-5.3\",\n \"input\": \"Explain in two sentences when to use a mutex in Go.\",\n \"max_output_tokens\": 256\n}'" } ] }, { "name": "System Message", "description": "Use a system instruction to set the style of a short programming answer", "input": { "messages": [ { "role": "system", "content": "You are a concise programming tutor. Answer in one sentence." }, { "role": "user", "content": "What does the size property of a JavaScript Map return?" } ], "max_tokens": 512 }, "output": { "text": "The `size` property returns the number of key-value pairs (entries) currently stored in the Map." }, "raw_response": { "id": "487104f9-94fb-40af-808a-acff99daca58", "object": "chat.completion", "created": 1795545294, "model": "z-ai/glm-5.3", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The `size` property returns the number of key-value pairs (entries) currently stored in the Map.", "reasoning_content": "The user is asking about the `size` property of a JavaScript Map. The answer is simple: it returns the number of key-value pairs (entries) in the Map.\n\nThe system prompt says I'm a concise programming tutor and should answer in one sentence." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 36, "completion_tokens": 75, "total_tokens": 111, "prompt_tokens_details": { "cached_tokens": 0 } }, "metadata": { "weight_version": "default", "weight_versions": [ { "end": 75, "start": 0, "version": "default" } ] }, "subconscious": { "logical_model": "subconscious/glm-5.3-marathon", "request_id": "req_cfaa20b5ec9c4b27bf8a6b1984de75de", "trace_id": "888150ab9fc944cdb0093c93d35cad36" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'z-ai/glm-5.3',\n {\n messages: [\n { role: 'system', content: 'You are a concise programming tutor. Answer in one sentence.' },\n { role: 'user', content: 'What does the size property of a JavaScript Map return?' },\n ],\n max_tokens: 512,\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"z-ai/glm-5.3\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a concise programming tutor. Answer in one sentence.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What does the size property of a JavaScript Map return?\"\n }\n ],\n \"max_tokens\": 512\n}'" } ] }, { "name": "Multi-turn Conversation", "description": "Use earlier messages to answer a brief follow-up question", "input": { "messages": [ { "role": "user", "content": "Name a primary color." }, { "role": "assistant", "content": "Red is a primary color." }, { "role": "user", "content": "Name a different primary color. Reply with just the color." } ], "max_tokens": 256 }, "output": { "text": "Blue" }, "raw_response": { "id": "a71d4fa4-8cfc-4f91-8143-950d794bb000", "object": "chat.completion", "created": 1795545295, "model": "z-ai/glm-5.3", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Blue", "reasoning_content": "The user asked for a primary color, I said red. Now they want a different primary color, and they want just the color as the reply. Primary colors are red, blue, and yellow (in traditional color theory). So I should say blue or yellow. They said reply with just the color, so I should just say the color name." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 39, "completion_tokens": 73, "total_tokens": 112, "prompt_tokens_details": { "cached_tokens": 0 } }, "metadata": { "weight_version": "default", "weight_versions": [ { "end": 73, "start": 0, "version": "default" } ] }, "subconscious": { "logical_model": "subconscious/glm-5.3-marathon", "request_id": "req_300cc825967c4a708016f1715babfa6e", "trace_id": "7ea79b1b3586485384db0c761b6096cc" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'z-ai/glm-5.3',\n {\n messages: [\n { role: 'user', content: 'Name a primary color.' },\n { role: 'assistant', content: 'Red is a primary color.' },\n { role: 'user', content: 'Name a different primary color. Reply with just the color.' },\n ],\n max_tokens: 256,\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"z-ai/glm-5.3\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Name a primary color.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Red is a primary color.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Name a different primary color. Reply with just the color.\"\n }\n ],\n \"max_tokens\": 256\n}'" } ] } ], "default_example": null, "code_snippets": [], "supports_async": false, "zdr": false, "zdr_comment": null, "external_info": "https://www.zhipuai.cn/", "terms": null, "cover_image_url": null, "metadata": {}, "request_formats": [ "chat-completions", "responses" ], "provider_id": "z-ai", "providers": null, "provider_details": [ { "id": "subconscious", "pricing": { "input_tokens": 1.4, "input_cached_tokens": 0.26, "output_tokens": 4.4 } }, { "id": "workers-ai", "pricing": { "input_tokens": 1.4, "input_cached_tokens": 0.26, "output_tokens": 4.4 } } ], "model_providers": [ { "provider": "workers-ai", "pricing": { "input_tokens": 1.4, "input_cached_tokens": 0.26, "output_tokens": 4.4 }, "rates": [], "byok_only": false }, { "provider": "subconscious", "pricing": { "input_tokens": 1.4, "input_cached_tokens": 0.26, "output_tokens": 4.4 }, "rates": [ { "key": null, "label": null, "description": null, "rates": [ { "key": "input_tokens", "label": "Input", "unit": "per_1m_tokens", "value": 1.4 }, { "key": "input_cached_tokens", "label": "Cached input", "unit": "per_1m_tokens", "value": 0.26 }, { "key": "output_tokens", "label": "Output", "unit": "per_1m_tokens", "value": 4.4 } ] } ], "byok_only": false } ], "banner": null, "pinned": false, "created_at": "2026-11-10 19:23:00", "schema": { "input": { "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string", "enum": [ "system", "developer", "user", "assistant", "tool" ] }, "content": { "anyOf": [ { "type": "string" }, { "type": "null" }, { "type": "array", "items": {} } ] } }, "required": [ "role" ], "additionalProperties": {} } }, "temperature": { "type": "number", "minimum": 0, "maximum": 2 }, "max_tokens": { "type": "number", "exclusiveMinimum": 0 }, "max_completion_tokens": { "type": "number", "exclusiveMinimum": 0 }, "top_p": { "type": "number", "minimum": 0, "maximum": 1 }, "frequency_penalty": { "type": "number", "minimum": -2, "maximum": 2 }, "presence_penalty": { "type": "number", "minimum": -2, "maximum": 2 }, "stream": { "type": "boolean" }, "stream_options": { "type": "object", "properties": { "include_usage": { "type": "boolean" } }, "additionalProperties": false }, "tools": { "type": "array", "items": {} }, "tool_choice": {}, "response_format": {}, "modalities": { "type": "array", "items": { "type": "string", "enum": [ "text", "audio" ] } }, "audio": { "type": "object", "properties": { "voice": { "type": "string", "enum": [ "alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse" ] }, "format": { "type": "string", "enum": [ "wav", "mp3", "flac", "opus", "pcm16" ] } }, "additionalProperties": false }, "reasoning_effort": { "description": "Optional reasoning control; availability and accepted values are model-dependent.", "type": [ "string", "null" ] } }, "required": [ "messages" ], "additionalProperties": {}, "title": "Chat Completions" }, { "type": "object", "properties": { "input": { "anyOf": [ { "type": "string" }, { "type": "array", "items": {} } ] }, "instructions": { "type": "string" }, "temperature": { "type": "number", "minimum": 0, "maximum": 2 }, "max_output_tokens": { "type": "number", "exclusiveMinimum": 0 }, "top_p": { "type": "number", "minimum": 0, "maximum": 1 }, "stream": { "type": "boolean" }, "tools": { "type": "array", "items": {} }, "tool_choice": {}, "text": { "type": "object", "properties": { "format": {} }, "additionalProperties": {} }, "reasoning": { "type": "object", "properties": { "effort": { "description": "Reasoning effort; availability and accepted values are model-dependent.", "type": "string", "enum": [ "none", "low", "medium", "high", "xhigh", "max" ] } }, "additionalProperties": {} } }, "required": [ "input" ], "additionalProperties": {}, "title": "Responses" } ] }, "output": { "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" }, "created": { "type": "number" }, "model": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "number" }, "message": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": [ "string", "null" ] }, "tool_calls": { "anyOf": [ { "type": "array", "items": {} }, { "type": "null" } ] }, "audio": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "number" }, "transcript": { "type": "string" } }, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "role" ], "additionalProperties": {} }, "finish_reason": { "type": [ "string", "null" ] } }, "required": [ "index", "message", "finish_reason" ], "additionalProperties": {} } }, "usage": { "type": "object", "properties": { "prompt_tokens": { "type": "number" }, "completion_tokens": { "type": "number" }, "total_tokens": { "type": "number" } }, "required": [ "prompt_tokens", "completion_tokens", "total_tokens" ], "additionalProperties": {} } }, "required": [ "id", "object", "created", "model", "choices" ], "additionalProperties": {}, "title": "Chat Completions" }, { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string", "const": "response" }, "created_at": { "type": "number" }, "model": { "type": "string" }, "output": { "type": "array", "items": {} }, "output_text": { "type": "string" }, "status": { "type": "string", "enum": [ "in_progress", "completed", "failed", "incomplete" ] }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "number" }, "output_tokens": { "type": "number" }, "total_tokens": { "type": "number" } }, "required": [ "input_tokens", "output_tokens", "total_tokens" ], "additionalProperties": {} } }, "required": [ "id", "object", "created_at", "model", "output" ], "additionalProperties": {}, "title": "Responses" } ] } } }