Learn more:https://treerouter.com

Abstract

Developers integrating Zhipu GLM‑5.3 into agent and tool‑call pipelines frequently encounter HTTP 400 bad‑request responses that do not appear when sending identical payloads to GLM‑5.2 or older model variants. This article documents a real‑world debugging case from an agent project, where tool invocation requests consistently failed with status 400 on GLM‑5.3, while the same JSON body worked flawlessly against GLM‑5.2. Root cause analysis points to a tightening of JSON Schema validation rules inside the tools[].function.parameters object. Specifically, GLM‑5.3 now requires explicit definition of the additionalProperties keyword; omitting this field triggers an immediate validation rejection and returns error code 1214. This guide separates two common 400 error classes, provides a lookup table for frequently seen Zhipu error codes, lays out three complete investigation workflows, and presents actionable fixes aligned with OpenAI‑compatible tool‑call schemas. It also notes boundary cases around model identifier spelling, endpoint configuration, and permission scopes when routing requests through an API gateway. All error examples, error codes and trigger scenarios are sourced from live API traffic, and readers should treat error‑code interpretations as operational experience rather than formal official documentation.

1. Background of the Issue

The original incident occurred during integration of GLM‑5.3 into an agent workflow with tool calling enabled. The developer used the model identifier glm-5.3, constructed a standard OpenAI‑style chat completion payload containing a tools array, and sent the request to the Zhipu API endpoint. Every attempt returned HTTP 400. After swapping only the model ID to glm-5.2 and reusing the exact same request JSON, the API accepted the payload and returned valid tool‑call responses without modification.

This behaviour is a critical signal. When a payload succeeds on an older model but fails on a newer release, the problem is rarely a broken network path or invalid API key. It usually means the upstream service has changed its internal validation schema, adding stricter constraints that older models ignored. In this case, GLM‑5.3’s validator for function parameter schemas became significantly stricter. Any tool parameter schema that does not explicitly declare additionalProperties will fail validation and emit the 1214 error.

Many developers build their tool schemas against older GLM behaviour, or reuse schemas originally written for OpenAI models. Some OpenAI‑compatible servers automatically supply a default value for additionalProperties when the keyword is missing. GLM‑5.3 no longer applies that implicit fallback. The missing keyword becomes a hard validation violation.

Two distinct 400 families appear repeatedly in GLM‑5.3 integration work:

  1. Code 1214: Request parameter validation failure, typically schema‑related defects inside tools, messages, or token limit fields.
  2. Code 1301: The requested model cannot be resolved; this stems from wrong model IDs, unsupported endpoints, or missing account permissions.

These two require entirely different debugging workflows. Mixing them up wastes time chasing schema fixes when the real problem is access control or endpoint routing.

2. Raw Error Payload Breakdown

2.1 Error 1214: Schema validation failure for tool parameters

This is the error seen in the original agent‑tooling failure case.

{
  "error": {
    "code": "1214",
    "message": "tools[0].function.parameters: additionalProperties is required",
    "type": "invalid_request_error"
  }
}

The message is self‑documenting: the JSON Schema object under tools[0].function.parameters lacks the mandatory additionalProperties property.
In JSON Schema, additionalProperties controls whether keys not explicitly defined in the schema are permitted inside the object. It accepts a boolean or a nested schema definition. GLM‑5.3 now treats this as a required top‑level keyword for every tool parameter schema, whereas GLM‑5.2 accepted schemas that omitted it.

Important caveat: the error message is the source of truth. Code 1214 is an umbrella error for all parameter validation failures. The same code can surface for other issues: malformed role values, invalid max_tokens data types, broken ordering inside the messages array, or missing required top‑level fields. Do not assume all 1214 errors relate to additionalProperties. Always parse the message string first.

2.2 Error 1301: Model not found or access denied

This is the second frequent 400 error, encountered when developers first connect to the API or switch gateway endpoints.

{
  "error": {
    "code": "1301",
    "message": "The model `glm-5.3` does not exist",
    "type": "invalid_request_error"
  }
}

Three common root causes produce this exact response:

  1. The model identifier string is misspelled or uses an unsupported variant name.
  2. The API endpoint address is incorrect or points to a gateway instance that has not been granted access to GLM‑5.3.
  3. The calling account has not been enabled for GLM‑5.3 access on Zhipu’s platform.

The official Zhipu base endpoint for the v4 API is open.bigmodel.cn/api/paas/v4/. If your request is routed through a middle layer, confirm that the upstream gateway forwards the request to the correct Zhipu endpoint and that your API credential has the matching model permission. Teams that centralize multi‑model traffic through Treerouter can configure per‑model access lists and upstream endpoint mappings in one place, which simplifies auditing and reduces repeated permission misconfiguration across client services.

3. Zhipu 400 Error Quick Reference Table

This table summarizes operational experience gathered from repeated debugging. Zhipu’s public documentation on these numeric error codes is limited, so the message field in the returned error body must always take priority over this lookup table.

Error CodeInformal Operational MeaningCommon Trigger ScenariosRecommended Repair Direction
1301Model does not exist, or caller lacks permissionTypo in model ID, endpoint does not expose this model, account access not activatedVerify exact model identifier, confirm upstream endpoint, check Zhipu console permission status
1214Request parameter schema validation failedMissing schema keywords such as additionalProperties, invalid role values, wrong type for max_tokens, malformed messages arrayRead the error message path, fix the specific JSON schema or field that failed validation

4. Three Systematic Diagnostic Paths

Path One: Distinguish 1214 (Schema) vs 1301 (Model/Permission)

This is the first filter step for every 400.

  1. Capture the full error JSON from the API response.
  2. Extract the code and message fields.
  3. If code = 1301, stop schema debugging and validate model name, endpoint and permissions.
  4. If code = 1214, parse the JSON path in the message (tools[0].function.parameters, messages, etc.) and focus validation on that subtree.

Many developers jump straight into rewriting their tool schemas on any 400, only to discover later that their gateway or API key simply cannot call GLM‑5.3. Separating these two classes eliminates wasted work.

Path Two: Isolate the Payload with Minimal Reproduction

When the message points to a schema problem, build a minimal reproducible payload. Remove all custom tools, extra metadata and optional fields until you have the smallest JSON that still reproduces the 400.
For the additionalProperties case, the broken schema looks like this:

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "User search query"
    }
  },
  "required": ["query"]
}

This worked on GLM‑5.2 but fails GLM‑5.3, because additionalProperties is missing.

The corrected schema adds the keyword explicitly:

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "User search query"
    }
  },
  "required": ["query"],
  "additionalProperties": false
}

Setting additionalProperties: false is the typical choice for strict tool parameters, preventing unexpected extra keys. You may also set it to true or a nested schema if your tool accepts dynamic extra fields. The critical change is that the key must exist.

Once the minimal payload succeeds, add your other tools and metadata back one by one. This isolates whether only one tool definition is invalid, or if all tools need the schema adjustment.

Path Three: Validate Endpoint, Credential and Gateway Forwarding

For 1301 or intermittent 400s after schema fixes, run a simple credential health check.

  1. Confirm your base URL matches Zhipu’s official v4 endpoint.
  2. Log into the Zhipu developer console and confirm the current API key has GLM‑5.3 enabled.
  3. If using an intermediate gateway, verify the gateway’s upstream configuration and access allowlist. Some gateways strip or rewrite the model field, or route requests to older backends that do not support GLM‑5.3.
  4. Test the same key and model directly against the official Zhipu endpoint. If the direct call works but the gateway call fails, the issue belongs to the gateway forwarding layer, not your request body.

5. Common Secondary Pitfalls Beyond additionalProperties

Even after fixing the additionalProperties omission, 1214 can reappear from other rule changes in GLM‑5.3 validation:

  • `max_tokens` type mismatch: The validator may reject numeric values wrapped in quotation marks. It expects an integer, not a string.
  • Message array ordering or role violations: Some custom agent loops inject invalid role strings or place system messages after user/assistant turns, which the stricter validator catches.
  • Nested schema inheritance: If you reuse shared schema fragments across many tools, every nested object inside parameters may also need its own additionalProperties declaration, depending on the depth of validation enforced by the backend.
  • Auto‑generated schemas: Libraries that generate tool schemas from function signatures often omit additionalProperties by default. You will need a post‑processing step to inject the keyword into every top‑level parameter schema before sending the request.

This last point is especially important for agent frameworks like Codex, Mastra and custom tool runners. These frameworks automatically serialize function definitions into the tools array. A code change or middleware filter must be added to patch each generated schema object before the HTTP call leaves your service.

Sample middleware pseudocode for schema patching:

function patchToolSchema(tool) {
  const schema = tool.function.parameters;
  if (!("additionalProperties" in schema)) {
    schema.additionalProperties = false;
  }
  return tool;
}

Apply this transform to every entry in the tools array before sending to GLM‑5.3. This keeps your upstream tool definitions compatible with older GLM versions while satisfying GLM‑5.3’s new hard requirement.

6. Recommended Production Workflow

For teams supporting both GLM‑5.2 and GLM‑5.3 in the same stack, use conditional schema patching:

  1. Inspect the target model identifier before building the request.
  2. If the model is glm-5.3 or later, run the schema patch to inject additionalProperties.
  3. For older GLM models, send the original unmodified schema.
  4. Log validation failures with the full message and JSON path for observability.
  5. Add a fallback test: route the same tool payload to GLM‑5.2 for comparison when debugging.

This pattern avoids breaking existing workloads while adopting the newer model. It also makes rollback straightforward if GLM‑5.3’s schema rules shift again in later releases.

When operating multi‑model agent pipelines, separating model routing, credential management and schema transformation logic improves maintainability. Gateways can centralize these rules so application code does not need branching logic for every model variant.

7. Conclusion

GLM‑5.3’s HTTP 400 errors often look identical from the status code alone, but they split into two very different root categories. Error 1301 points to model existence, permissions or endpoint routing. Error 1214 is a parameter validation failure, and the most frequent new failure for tool‑call workflows comes from the mandatory additionalProperties keyword inside each tool’s parameter JSON Schema.

The three diagnostic paths provide a repeatable process: classify the error code and message first, then build a minimal reproduction payload for schema issues, or validate credentials and upstream routing for model access issues. Developers relying on auto‑generated tool schemas from agent frameworks must add a post‑processing step to inject the missing schema field for GLM‑5.3 requests.

Because Zhipu’s published documentation for these numeric error codes remains limited, operational teams should always treat the human‑readable message field as the authoritative source. The lookup table in this article serves only as a quick reference to accelerate triage. With the schema patch and careful endpoint validation, developers can adopt GLM‑5.3’s tool‑call capability without rewriting their entire agent tooling stack.