BlockRun
Z.ai · Image Generation

CogView-4 API

Zhipu AI's CogView-4 image generation model — high quality, supports up to 1440x1440

$0.0168–$0.022 per image, by size · priced before it runs · no subscription

About Z.ai CogView-4

CogView-4 is an image model from Z.ai. It renders 6 sizes and is billed per image at the size you ask for, from $0.0168 per image. The image comes back on a hosted URL that does not expire. You can call it without an account, an API key or a subscription.

Use CogView-4 for

  • Product shots, ad creative and social images generated per request
  • Illustrations and diagrams an agent produces alongside its written answer
  • Concept art and mood boards, several variations from one prompt
  • Placeholder and test imagery inside an app's own pipeline

CogView-4 specs

Endpoint
POST /api/v1/images/generations
Price
$0.0168–$0.022 per image, by size
Sizes
512×512, 768×768, 1024×1024, 768×1344, 1344×768, 1440×1440
Output
A hosted image URL that does not expire

How to call CogView-4

Pass zai/cogview-4 as the model field. The first request returns a 402 with the exact price; a signed retry runs it, and the client libraries fold the two into one call — how the payment works. Request and response shapes are in the docs.

curl -X POST https://blockrun.ai/api/v1/images/generations \
  -H "Content-Type: application/json" \
  -d '{"model": "zai/cogview-4", "prompt": "a lighthouse at dawn, watercolor", "size": "512x512"}'

CogView-4 or another image model

Every image model here takes the same request on the same endpoint, so trying another is a one-line change to the model field. The AI Image Generator page lists all of them side by side.

CogView-4 API questions

How much does the CogView-4 API cost?

$0.0168–$0.022 per image, by size, including the per-call transaction fee. The exact price is quoted in the 402 response before anything is generated, and you pay per request with no subscription.

Do I need an API key to use CogView-4?

No. Each request carries its own payment, so an agent or script can call CogView-4 with no account and no key. Teams that prefer one can use an API key with card or invoice billing instead.

How do I call CogView-4?

Send a POST to /api/v1/images/generations with "model": "zai/cogview-4". The request shape is shown above, and the same endpoint serves every image model on the catalog, so switching models is a one-line change.

What sizes does CogView-4 support?

512×512, 768×768, 1024×1024, 768×1344, 1344×768, 1440×1440. Each size has its own price, and the one you request is the one you pay for.

CogView-4 or another model — which should I use?

Compare it with GPT Image 1 (from $0.022 per image), ChatGPT Images 2.0 (from $0.064 per image), GPT Image 2.5 Flare (from $0.295 per image) in the table above. They take the same request on the same endpoint, so you can try two on one prompt and keep the one you prefer.

Two ways to run this

Get an API key

Sign in, get a key, and call the same endpoints with usage billed to your account. For teams that want one invoice instead of one wallet.

Get an API key 

Or let your agent pay per call, in USDC

No account, no API key. Three steps, and the last one is the request this page is about.

  1. 01
    Point your agent at BlockRun

    Install ClawRouter, or add the BlockRun MCP server to Claude Code, Cursor, Codex or OpenClaw. Any OpenAI-compatible client works too — change the base URL, nothing else.

    curl -fsSL https://blockrun.ai/ClawRouter-update | bash
  2. 02
    Fund a wallet with USDC

    Send USDC to a wallet on Base, Solana or Arc. There is no account to create and no API key to issue: the wallet is the account, and it pays per call.

  3. 03
    Call CogView-4

    The first call returns HTTP 402 with the exact price, your agent signs it, and the answer comes back. Payment settles on-chain; nothing is charged if the call fails.

    curl -X POST https://blockrun.ai/api/v1/images/generations \
      -H "Content-Type: application/json" \
      -d '{"model": "zai/cogview-4", "prompt": "a lighthouse at dawn, watercolor", "size": "512x512"}'