feat: add GLM-Image model via Z.AI provider - #1452
Conversation
Add GLM-Image text-to-image generation model with verified pricing and configuration. Model uses Z.AI's existing image generation API infrastructure which is already implemented for CogView-4. - Model ID: glm-image - Pricing: $0.015 per image - Provider: Z.AI - Test skip: Excluded from E2E tests due to cost - API support: Uses existing Z.AI image generation endpoint 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughAdds a new GLM-Image model entry to the Z.AI model registry and updates the image-generation docs table and CogView-4 callout to include the new model and note embedded text capabilities. Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add GLM-Image model to the image generation documentation with pricing and description. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary
Adds GLM-Image text-to-image generation model via Z.AI provider with verified pricing and configuration.
Model Details
glm-image/api/paas/v4/images/generationsImplementation
packages/models/src/models/zai.tstest: "skip"flag to exclude from E2E tests (as requested, due to cost)Technical Notes
API Support Already Exists
The Z.AI image generation API integration is already fully implemented in the codebase:
get-provider-endpoint.ts:227-231routes to/api/paas/v4/images/generationsprepare-request-body.ts:232-259formats image generation requestsparse-provider-response.ts:475-496handles Z.AI image response formatThis implementation was created for CogView-4 and works uniformly for all Z.AI image models through provider-based checks (not model-specific logic).
Response Format
Z.AI image API returns:
{ "created": 1760335349, "data": [{"url": "https://..."}], "content_filter": [{"role": "assistant", "level": 1}] }This format is handled by the existing parser that checks
usedProvider === "zai" && json.data.Configuration Flags
Test Plan
test: "skip"flag set to exclude from automated E2E testspnpm formatpnpm build/v1/modelsAPI correctlyNote: Manual testing confirmed the model routes correctly and uses the existing Z.AI image generation infrastructure. Full end-to-end image generation testing was performed once to verify the implementation (as requested, to avoid unnecessary API costs).
Files Changed
packages/models/src/models/zai.ts- Added GLM-Image model definition🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.