GLM-Legal on Vercel AI Gateway

GLM-5 · Zhipu AI

Serverless

Last refreshed 2026-11-02. Next refresh: weekly.

Why use GLM-Legal on Vercel AI Gateway?

Vercel AI Gateway offers GLM-Legal with pay-as-you-go pricing at $0.37/1M input tokens. Vercel AI Gateway is a unified AI proxy providing a single OpenAI-compatible API endpoint to 275+ models from 25+ providers including Anthropic, OpenAI, Google, Meta, Mistral, DeepSeek, xAI, Alibaba, Amazon, ByteDance, Cohere, MiniMax, MoonshotAI, KwaiPilot, Black Forest Labs, Recraft, Voyage AI, NVIDIA, and more.

Compare GLM-Legal across 3 providers to find the best fit for your use case
Input / 1M
$0.37
Output / 1M
$1.25
Cache
read $0.075
Batch
Not sourced

Setup recipe

Python + curl
Install
pip install openai
Auth
export AI_GATEWAY_API_KEY=...
Call
import os
from openai import OpenAI
client = OpenAI(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
Model ID
zai/glm-5.3-flashx-legal

Request example

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
    base_url="https://ai-gateway.vercel.sh/v1"
)
response = client.chat.completions.create(
    model="zai/glm-5.3-flashx-legal",
    messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)

Gotchas

  • Use provider model ID "zai/glm-5.3-flashx-legal", not the LLMReference slug "glm-legal".
  • creator/model-name e.g. kwaipilot/kat-coder-pro-v2
  • The examples expect AI_GATEWAY_API_KEY; rename it only if your application config maps the new variable.

Compare GLM-Legal Across Providers

ProviderInput (per 1M)Output (per 1M)
Z.ai$0.37$1.25
OpenRouter$0.37$1.25
Vercel AI Gateway$0.37$1.25

Pricing

TypePrice (per 1M)
Input tokens$0.37
Output tokens$1.25

Capabilities

VisionMultimodalReasoningJSON / Tool useStructured OutputsPrompt Caching

About GLM-Legal

GLM-Legal is Z.ai's legal-domain model, built on GLM-5.3-Flash with legal mid-training and reinforcement-learning post-training across legal agent environments. Z.ai reports a 19.2% all-pass rate on the Harvey Legal Agent Benchmark, 12.5 points above its base model, as evaluated by Vals.

Get Started

Model Specs

Released2026-10-12
Context1M

Related Models on Vercel AI Gateway