Zhipu: CogView 4
CogView 4 is Zhipu's text-to-image model, available in Ailoot Ultra under the exact ID cogview-4. Supply a scene description to create an illustration, product setting or visual concept. Its documented controls include image size, standard or hd quality, and watermark_enabled; the response supplies image URLs that should all be saved.
About the model
This description covers the model’s capabilities. Available in Ailoot inputs, outputs and options are listed for the selected method below.
CogView 4 turns a written image brief into image outputs. Select cogview-4 in POST /v1/images/generations and supply prompt as a text string. The required inputs are model and prompt. Use the brief to describe the main subject, its placement, the surrounding scene and the visual treatment you want to evaluate.
For a product setting, describe the object, the surface beneath it, the background and the direction of light. For an illustration, specify the characters or objects, the intended mood and the composition. If the image will sit beside a headline or product description, state where the composition should leave clear space. Review the result against those concrete requirements before using it in a layout.
The CogView-specific size guidance lists 1024x1024, 768x1344, 864x1152, 1344x768, 1152x864, 1440x720 and 720x1440. Its custom-size guidance places each side between 512 and 2048 pixels, divisible by 16, with no more than 2^21 total pixels. Match the framing to the placement: a portrait illustration, a square product scene and a wide visual call for different compositions as well as different dimensions.
quality accepts standard or hd, with standard documented as the CogView default. watermark_enabled is a boolean with a documented default of true. An optional user_id string identifies the end user and must contain 6 to 128 characters. Keep that identifier separate from the creative prompt. Changes to quality or size should accompany a clear intended use for the image, rather than replacing the description of what should appear.
Generation returns a synchronous JSON response containing created and data. Each data[] item supplies a url. Download every returned image and keep the response with the brief and chosen settings; do not retain only the first item merely because a preview shows one image. The documented contract does not introduce a separate video-style job polling step for this image request. If the response is interrupted or incomplete, retain the original request information and received result before deciding whether a further creation request is appropriate. Ailoot stores these images as owned media assets and returns signed Ailoot links. Find the asset records through GET /v1/media/assets?family=image, following every next_cursor. Read GET /v1/media/assets/{asset_id} with each actual asset_id to obtain its content_url; read that same asset again if its signed link expires.
Ailoot Ultra · Images POST /v1/images/generations cogview-4
cogview-4Overview
CogView 4 is Zhipu's text-to-image model, available in Ailoot Ultra under the exact ID cogview-4. Supply a scene description to create an illustration, product setting or visual concept. Its documented controls include image size, standard or hd quality, and watermark_enabled; the response supplies image URLs that should all be saved.
- Accepted inputs
- Text
- Results
- Images
Available in Ailoot · inputs & methods
Ailoot Ultra · Images POST /v1/images/generations
- Input types
text- Output types
image- Output format
- Image file
| Field | Type | Requirement | Values & limits | Default |
|---|---|---|---|---|
Fieldmodel | Typestring | RequirementRequired | Values & limits cogview-4 | Default— |
Fieldprompt | Typestring | RequirementRequired | Values & limits | Default— |
Fieldsize | Typestring | RequirementOptional | Values & limits 1280x1280, 1568x1056, 1056x1568, 1472x1088, 1088x1472, 1728x960, 960x1728 | Default1280x1280 |
Fielduser_id | Typestring | RequirementOptional | Values & limits | Default— |
Fieldquality | Typestring | RequirementOptional | Values & limits hd, standard | Default— |
Fieldwatermark_enabled | Typeboolean | RequirementOptional | Values & limits | Defaulttrue |
Fieldstream | Typeboolean | RequirementOptional | Values & limits false | Default— |
Method parameters and lifecycle
| Parameter | Contract |
|---|---|
Parametercontent_type | Contractapplication/json |
Parameterrequired | Contractmodel, prompt |
Parameteroptional | Contractsize, user_id, quality, watermark_enabled, stream |
Parametermaterial_types | Contracttext |
Parameterconditions | ContractUse stream:false or omit stream. The complete buffered JSON result contains all generated images. |
Lifecycle: synchronous_result_then_owned_library
GET /v1/media/assets
GET /v1/media/assets/{asset_id}
Pricing
How the final charge is calculated
The displayed rates estimate the cost before generation. The final charge is calculated from the cost recorded for the original generation. Measured output duration and forecast quantities are not the final billable quantity.
Tariff references do not add request options. Supported parameters are listed for the selected method.
- Fast mode
- Not specified When fast mode is selected
- Flex mode
- Not specified When flex mode is selected
- Maximum reasoning effort
- Not specified When maximum reasoning effort uses the default adjustment
Estimated rates for comparison
Prices by configuration
Match each charge to the conditions shown. Use one rate for each set of alternative configurations.
| Configuration | Rate schedule | Forecast quantity | Charge |
|---|---|---|---|
| ConfigurationBase token rates | Rate scheduleBase rate | Forecast quantity— | Charge Input · Input tokens · Estimate for comparison only — / 1K tokens Output · Output tokens · Estimate for comparison only — / 1K tokens Input · Cache read · Estimate for comparison only — / 1K tokens Input · Cache write · Estimate for comparison only — / 1K tokens Input · Cache write, 1 hour · Estimate for comparison only — / 1K tokens |
| ConfigurationEstimated generation cost | Rate schedule— | Forecast quantityone generation estimate | Charge Input · Estimated generation cost · Estimate for comparison only $0.09 estimate before generation This estimate is not an additional charge or a fixed rate for the completed generation. |
Ailoot reserves an estimated amount before a request. After the result, it settles the final charge from measured usage. Streaming settlement uses the final usage record. How reservation and settlement work →
Example requests
Ailoot Ultra · Images
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "cogview-4", "prompt": "A calm studio product photograph with a plain background."}')
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/images/generations \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
# Submit once. Retain the complete result, original identifiers and every response header.
Receive and save results
Ailoot Ultra · Images
Download each returned image or save its Base64 contents
GET /v1/media/assetsGET /v1/media/assets/{asset_id}
Keep all completed results
Save every completed image; retrieve each returned URL or decode its Base64 contents.
Retain every returned image and field. Use owned content_url values and actual asset_id records; refresh the same asset when a link expires.
If the original response needs checking
Preserve the original response, headers and X-Client-Request-ID. An uncertain outcome does not authorize another creation.
Aliases
Model aliases
Ailoot Ultra cogview-4
Method path aliases
Use the method paths shown above.
Related caller IDs
FAQ · Zhipu: CogView 4
- What inputs and results are available?
POST /v1/images/generations·cogview-4:text→image- Which fields does the request use?
POST /v1/images/generations·cogview-4:model,prompt,size,user_id,quality,watermark_enabled,stream