CogView-4
CogView-4 for OpenAI-style Image Generation, Image editing, OpenAI-style Chat Completions, Anthropic-style Messages, OpenAI-style Responses.
Explore CogView-4 for OpenAI-style Image Generation, Image editing, OpenAI-style Chat Completions, Anthropic-style Messages, OpenAI-style Responses through the unified API. Supported interfaces and current availability are shown below.
- OpenAI-style Image Generation
- Image editing
- OpenAI-style Chat Completions
- Anthropic-style Messages
- OpenAI-style Responses
Model details
- Context window
- 2K tokens
- Max output
- 4K tokens
- Input
- Text
- Output
- Text, images
- Capabilities
- —
- Interfaces
- OpenAI-style Image Generation, Image editing, OpenAI-style Chat Completions, Anthropic-style Messages, OpenAI-style Responses
Pricing
What each generation costs. The Cloakray price is what you are charged — no gateway fee is added on top of it.
| Metric | Price |
|---|---|
| / request | $0.01 |
Why teams pick it
- CogView-4 for OpenAI-style Image Generation, Image editing, OpenAI-style Chat Completions, Anthropic-style Messages, OpenAI-style Responses.
Call CogView-4
CogView-4 answers on any of the APIs below — pick the one your code already speaks and just swap in your Cloakray key.
/v1/images/generationsOpenAI-style Image Generation · openai SDK or plain HTTP
curl https://api.cloakray.com/v1/images/generations \
-H "Authorization: Bearer ckr_..." \
-H "Content-Type: application/json" \
-d '{
"model": "cogview-4",
"prompt": "A quartz crystal on a workbench"
}'/v1/images/editsImage editing · openai SDK or plain HTTP
curl https://api.cloakray.com/v1/images/edits \ -H "Authorization: Bearer ckr_..." \ -F 'model=cogview-4' \ -F 'prompt=Make the background blue' \ -F 'image=@input.png'
/v1/chat/completionsOpenAI-style Chat Completions · openai SDK or plain HTTP
curl https://api.cloakray.com/v1/chat/completions \
-H "Authorization: Bearer ckr_..." \
-H "Content-Type: application/json" \
-d '{
"model": "cogview-4",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}'/v1/messagesAnthropic-style Messages · @anthropic-ai/sdk SDK or plain HTTP
curl https://api.cloakray.com/v1/messages \
-H "Authorization: Bearer ckr_..." \
-H "Content-Type: application/json" \
-d '{
"model": "cogview-4",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}'/v1/responsesOpenAI-style Responses · openai SDK or plain HTTP
curl https://api.cloakray.com/v1/responses \
-H "Authorization: Bearer ckr_..." \
-H "Content-Type: application/json" \
-d '{
"model": "cogview-4",
"input": "Hello"
}'Conversation compaction is also available at POST /v1/responses/compact.
More from Z.ai
GLM-5.3A coding-first flagship with a million-token context.$0.77 in · $2.42 outGLM-5.2Long-horizon coding and agentic engineering, at a lower price.$1.4 / 1M input tokens · $4.4 / 1M output tokens · See all rates on the model pageGLM-4 32B (0414-128k)GLM-4 32B (0414-128k) for OpenAI-style Chat Completions, Anthropic-style Messages, OpenAI-style Responses.$0.1 in · $0.1 out