Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions glm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ GLM (General Language Model) generative services by Zhipu AI, including chat com

API home page: [Ace Data Cloud - GLM](https://platform.acedata.cloud/service/glm)

Keywords: glm-api, glm-5.2, glm-5.1, glm-4.7, chat-completions, zhipu-ai, rest-api, ai-api, developer-tools, AI API, REST API, Developer API, Ace Data Cloud
Keywords: glm-api, glm-5.3, glm-5.2, glm-5.1, glm-4.7, chat-completions, zhipu-ai, rest-api, ai-api, developer-tools, AI API, REST API, Developer API, Ace Data Cloud

## Why Use GLM on Ace Data Cloud

Expand All @@ -17,13 +17,13 @@ Keywords: glm-api, glm-5.2, glm-5.1, glm-4.7, chat-completions, zhipu-ai, rest-a

## Overview

GLM (General Language Model) is the next-generation large language model series by Zhipu AI (Z.ai), featuring powerful Chinese and English understanding and generation capabilities. The current flagship `glm-5.2`, along with `glm-5.1`, `glm-5`, `glm-4.7`, `glm-4.6` and other new-generation models, has been extensively optimized for long-context, tool calling, and code tasks. They are widely applicable to intelligent Q&A, content creation, code assistance, customer service bots, and more.
GLM (General Language Model) is the next-generation large language model series by Zhipu AI (Z.ai), featuring powerful Chinese and English understanding and generation capabilities. The current flagship `glm-5.3`, along with `glm-5.2`, `glm-5.1`, `glm-5`, `glm-4.7`, `glm-4.6` and other new-generation models, has been extensively optimized for long-context, tool calling, and code tasks. They are widely applicable to intelligent Q&A, content creation, code assistance, customer service bots, and more.

## Application Process

To use the GLM API, apply for the corresponding service on the [GLM Chat Completion API](https://platform.acedata.cloud/documents/ccfbc8fa-0dce-424b-85a4-99c280ddb5cf) page. After entering the page, click the "Acquire" button.
To use the GLM API, obtain an API token from the [Ace Data Cloud Console](https://platform.acedata.cloud/console/applications). One API token can call all services on the platform.

There is a free quota available for first-time applicants, allowing you to use this API for free.
There is a free quota available for first-time applicants. When it is used up, you can recharge your general balance in the [console](https://platform.acedata.cloud/console/coin).

## Quick Start

Expand All @@ -47,4 +47,4 @@ Explore the supported endpoints and integration guides for GLM.

| API | Path | Integration Guidance |
| ---- | ---- | ------------ |
| [GLM Chat Completion API](https://platform.acedata.cloud/documents/ccfbc8fa-0dce-424b-85a4-99c280ddb5cf) | `/glm/chat/completions` | [GLM Chat Completion API Integration Guide](docs/glm_chat_completions_api_integration_guide.md) |
| [GLM Chat Completion API](https://platform.acedata.cloud/documents/glm-chat-completions) | `/glm/chat/completions` | [GLM Chat Completion API Integration Guide](docs/glm_chat_completions_api_integration_guide.md) |
38 changes: 26 additions & 12 deletions glm/docs/glm_chat_completions_api_integration_guide.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# GLM Chat Completion API Integration Guide

GLM (General Language Model) is the next-generation large language model series by Zhipu AI (Z.ai), featuring powerful Chinese and English understanding and generation capabilities. The flagship GLM-5.2, along with GLM-5.1, GLM-5, GLM-4.7, GLM-4.6 and other new-generation models, has been extensively optimized for long-context, tool calling, and code tasks. They are widely applicable to intelligent Q&A, content creation, code assistance, customer service bots, and more.
GLM (General Language Model) is the next-generation large language model series by Zhipu AI (Z.ai), featuring powerful Chinese and English understanding and generation capabilities. The flagship GLM-5.3, along with GLM-5.2, GLM-5.1, GLM-5, GLM-4.7, GLM-4.6 and other new-generation models, has been extensively optimized for long-context, tool calling, and code tasks. They are widely applicable to intelligent Q&A, content creation, code assistance, customer service bots, and more.

This document introduces the usage process of the GLM Chat Completion API. It provides a unified OpenAI-compatible interface to easily call GLM series models.

## Application Process

To use the GLM Chat Completion API, you can first visit the [GLM Chat Completion API](https://platform.acedata.cloud/documents/ccfbc8fa-0dce-424b-85a4-99c280ddb5cf) page and click the "Acquire" button to obtain the credentials needed for the request:
To use the GLM Chat Completion API, first obtain your API token from the [Ace Data Cloud Console](https://platform.acedata.cloud/console/applications):

![](https://cdn.acedata.cloud/nyq0xz.png)
![](https://cdn.acedata.cloud/dvc3cg.jpg)

If you are not logged in or registered, you will be automatically redirected to the login page inviting you to register and log in. After logging in or registering, you will be automatically returned to the current page.

When applying for the first time, there will be a free quota available for you to use the API for free.
One API token can call all services on the platform without requiring a separate application for each service. First-time applicants receive a free quota; when it is used up, you can recharge your general balance in the [console](https://platform.acedata.cloud/console/coin).

Complete API documentation is available on the [GLM Chat Completion API](https://platform.acedata.cloud/documents/glm-chat-completions) page.

## Basic Usage

Expand All @@ -22,14 +24,15 @@ When using this interface for the first time, you need to fill in at least three

- `authorization`: Select the Bearer Token directly from the dropdown list.
- `model`: The GLM model to call. Currently supported models include:
- `glm-5.2`: The latest flagship model with the strongest overall capabilities.
- `glm-5.1`: High-capability model for reasoning, tool calling, and code tasks.
- `glm-5.3`: The latest flagship model, supporting a 1M-token context and up to 128K output tokens for complex reasoning, code, and Agent tasks.
- `glm-5.2`: Previous-generation flagship model with strong overall capabilities.
- `glm-5.1`: Mature flagship model for general complex tasks.
- `glm-5`: General-purpose flagship-tier dialogue model.
- `glm-5-turbo`: Faster, cost-efficient variant of the GLM-5 series.
- `glm-4.7`: Excellent performance on reasoning, tool calling, and code tasks.
- `glm-4.6`: General-purpose dialogue model, balancing capability and cost.
- `glm-3-turbo`: Classic dialogue model, suitable for general text generation tasks.
- `messages`: An array of prompts. Each message contains `role` and `content`. The `role` supports three values: `user`, `assistant`, and `system`.
- `messages`: An array of prompts. Each message contains `role` and `content`. Supported roles are `developer`, `system`, `user`, `assistant`, and `tool`. Content can be a string or an array of text, image URL, or file parts.

Common optional parameters:

Expand All @@ -39,6 +42,12 @@ Common optional parameters:
- `n`: How many candidate replies to generate at once.
- `stream`: Whether to enable streaming response, default `false`.
- `stop`: Custom stop sequences.
- `reasoning_effort`: Controls reasoning effort. Supported values are `minimal`, `low`, `medium`, and `high`; the default is `medium`.
- `max_completion_tokens`: Limits generated tokens, including visible output and reasoning tokens.
- `response_format`: Selects text or structured JSON output.
- `stream_options`: Configures streaming behavior, including whether usage is included.
- `parallel_tool_calls`: Allows multiple tool calls in parallel; the default is `true`.
- `tool_choice`: Controls whether and which declared tool the model calls.

Below is a simple Python call example:

Expand All @@ -54,7 +63,7 @@ headers = {
}

payload = {
"model": "glm-4.7",
"model": "glm-5.2",
"messages": [
{"role": "user", "content": "hello"}
]
Expand All @@ -69,7 +78,7 @@ After the call, we find the return result is as follows:
```json
{
"id": "msg_202604262252030313862701a04e33",
"model": "glm-4.7",
"model": "glm-5.2",
"object": "chat.completion",
"created": 1777215124,
"choices": [
Expand Down Expand Up @@ -97,6 +106,10 @@ The main fields in the return result are described as follows:
- `model`: The actual GLM model name called.
- `choices`: The list of replies generated by the model. `choices[i].message.content` is the specific text of the model's reply. `finish_reason` indicates the reason for stopping (`stop`, `length`, `tool_calls`, `content_filter`, etc.).
- `usage`: Token usage statistics for this request, including `prompt_tokens`, `completion_tokens`, and `total_tokens`.
- `system_fingerprint`: Identifies the backend configuration used for the response, when provided.
- `choices[i].message.tool_calls`, `refusal`, and `audio`: Optional assistant tool calls, refusal text, and audio output.
- `choices[i].logprobs`: Optional token log-probability details when requested.
- `usage.prompt_tokens_details` and `usage.completion_tokens_details`: Optional detailed token accounting.

## Streaming Response

Expand Down Expand Up @@ -279,8 +292,9 @@ If the model decides to call a tool, the `finish_reason` in the return result wi

| Model | Use Case |
| --- | --- |
| `glm-5.2` | Latest flagship with the strongest overall capabilities; recommended for complex reasoning and long document analysis |
| `glm-5.1` | High-capability model for reasoning, tool calling, and code tasks |
| `glm-5.3` | Latest flagship with a 1M-token context and up to 128K output tokens; recommended for complex reasoning, code, and Agent tasks |
| `glm-5.2` | Previous-generation flagship for complex reasoning, code, and Agent tasks |
| `glm-5.1` | Mature flagship for complex reasoning and long document analysis |
| `glm-5` | General-purpose flagship-tier dialogue model |
| `glm-4.7` | Tool calling, code generation, Agent orchestration tasks |
| `glm-4.6` | Balanced choice for general dialogue and content creation |
Expand Down Expand Up @@ -308,7 +322,7 @@ When calling the API, if an error occurs, the API will return the corresponding
}
```

When `api_error` is returned with the message `Service is temporarily unavailable, please retry later.`, it usually means the upstream GLM service is temporarily unavailable. It is recommended to retry with exponential backoff, or temporarily switch to another available GLM model (e.g., switch from `glm-5.1` to `glm-4.7` or `glm-3-turbo`).
When `api_error` is returned with the message `Service is temporarily unavailable, please retry later.`, it usually means the upstream GLM service is temporarily unavailable. It is recommended to retry with exponential backoff, or temporarily switch to another available GLM model (e.g., switch from `glm-5.1` to `glm-4.7` or `glm-4.6`).

## Conclusion

Expand Down
11 changes: 7 additions & 4 deletions nanobanana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Nano Banana AI image generation and editing service.

API home page: [Ace Data Cloud - Nano Banana Image Generation](https://platform.acedata.cloud/service/nano-banana)

Keywords: nanobanana-api, ai-image, image-editing, image-generation, rest-api, ai-api, aiimage, AI API, REST API, Developer API, Ace Data Cloud
Keywords: nanobanana-api, nano-banana-2-lite, ai-image, image-editing, image-generation, rest-api, ai-api, aiimage, AI API, REST API, Developer API, Ace Data Cloud

## Why Use Nano Banana Image Generation on Ace Data Cloud

Expand Down Expand Up @@ -1082,7 +1082,10 @@ Based on the Google Gemini 2.5 Flash/3 Pro Image model, it achieves high-quality
curl --request POST "https://api.acedata.cloud/nano-banana/images" \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{}'
--data '{
"action": "generate",
"prompt": "A watercolor painting of a mountain lake at sunrise"
}'
```

## APIs and Guides
Expand All @@ -1091,8 +1094,8 @@ Explore the supported endpoints and integration guides for Nano Banana Image Gen

| API | Path | Integration Guidance |
| ---- | ---- | ------------ |
| [Nano Banana Images API](https://platform.acedata.cloud/documents/23985a11-d713-41d1-ad84-24b021805b3d) | `/nano-banana/images` | [Nano Banana Images API Integration Guide](https://platform.acedata.cloud/documents/2fb479f8-63ec-424c-a93e-b12cd4250f9e) |
| [$t(document_title_nanobanana_tasks_api)](https://platform.acedata.cloud/documents/617810f5-081f-4866-a21a-cededecb0ccd) | `/nano-banana/tasks` | [Nano Banana Tasks API Integration Guide](https://platform.acedata.cloud/documents/e01ef840-3158-4eec-a6e7-337dada8d155) |
| [Nano Banana Images API](https://platform.acedata.cloud/documents/nano-banana-images) | `/nano-banana/images` | [Nano Banana Images API Integration Guide](docs/nano_banana_images_api_integration_guide.md) |
| [Nano Banana Tasks API](https://platform.acedata.cloud/documents/617810f5-081f-4866-a21a-cededecb0ccd) | `/nano-banana/tasks` | [Nano Banana Tasks API Integration Guide](docs/nano_banana_tasks_api_integration_guide.md) |

## Related Resources

Expand Down
13 changes: 11 additions & 2 deletions nanobanana/docs/nano_banana_images_api_integration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ This document introduces the integration and usage of the Nano Banana Images API

## Application Process

Before use, please enter the [Nano Banana Images API](https://platform.acedata.cloud/documents/23985a11-d713-41d1-ad84-24b021805b3d) on the Ace Data Cloud platform and click Acquire to apply for activation. The first application usually has free quotas available. Once activated, you can obtain the Bearer Token used to call the API from the platform.
Before use, obtain your API token from the [Ace Data Cloud Console](https://platform.acedata.cloud/console/applications). One API token can call all services on the platform without requiring a separate application for each service. First-time applicants receive a free quota; when it is used up, you can recharge your general balance in the [console](https://platform.acedata.cloud/console/coin).

Complete API documentation is available on the [Nano Banana Images API](https://platform.acedata.cloud/documents/nano-banana-images) page.

## Interface Overview

Expand All @@ -19,9 +21,12 @@ Before use, please enter the [Nano Banana Images API](https://platform.acedata.c
- `edit`: Edit based on given images
- **Model** (optional):
- `nano-banana` (default): Based on Gemini 2.5 Flash Image, fast speed, low cost
- `nano-banana-2-lite`: Based on Gemini 3.1 Flash Lite Image, supports only 1K, fast generation speed
- `nano-banana-2`: Based on Gemini 3.1 Flash Image Preview, Pro-level quality + Flash speed
- `nano-banana-pro`: Based on Gemini 3 Pro Image Preview, highest quality
- `nano-banana:official`, `nano-banana-2-lite:official`, `nano-banana-2:official`, `nano-banana-pro:official`: Official channel versions of the corresponding models, with different billing and improved image quality and stability
- **Asynchronous Callback**: Optional, receive task completion notifications and results via `callback_url`
- **Number of Images**: Optional, specify 1–4 images via `count`, default 1. Each image uses an independent generation call; failures or provider safety refusals affect only that call, while successful images are returned and billed normally.

## Quick Start: Generate Image (`action=generate`)

Expand All @@ -37,6 +42,7 @@ curl -X POST 'https://api.acedata.cloud/nano-banana/images' \
-H 'content-type: application/json' \
-d '{
"action": "generate",
"model": "nano-banana-pro",
"prompt": "A photorealistic close-up portrait of an elderly Japanese ceramicist with deep, sun-etched wrinkles and a warm, knowing smile. He is carefully inspecting a freshly glazed tea bowl. The setting is his rustic, sun-drenched workshop. The scene is illuminated by soft, golden hour light streaming through a window, highlighting the fine texture of the clay. Captured with an 85mm portrait lens, resulting in a soft, blurred background (bokeh). The overall mood is serene and masterful. Vertical portrait orientation.",
"count": 1
}'
Expand All @@ -55,6 +61,7 @@ headers = {
}
payload = {
"action": "generate",
"model": "nano-banana-pro",
"prompt": (
"A photorealistic close-up portrait of an elderly Japanese ceramicist "
"with deep, sun-etched wrinkles and a warm, knowing smile. He is carefully "
Expand Down Expand Up @@ -91,6 +98,7 @@ print(resp.json())
- `success`: Whether the request was successful.
- `task_id`: Task ID.
- `trace_id`: Trace ID for troubleshooting.
- `count` (request): The number of images requested for generation or editing, from 1–4 with a default of 1. `data` contains only successful images, which are billed by the number returned. If every generation call is rejected by the provider's safety policy, the API returns `403`.
- `data[]`: Result list.
- `prompt`: The prompt used for generation (echo).
- `image_url`: Direct URL of the generated image.
Expand Down Expand Up @@ -200,6 +208,7 @@ When a call fails, a standard error format and trace ID will be returned. Common
- **400 `token_mismatched`**: The request is invalid or parameters are incorrect.
- **400 `api_not_implemented`**: The interface is not implemented (please contact support).
- **401 `invalid_token`**: Authentication failed or token is missing.
- **403 `forbidden`**: The provider's safety policy denied the request or generated result. The rejected call returns no image and is not billed; other successful calls in a multi-image request can still return and be billed.
- **429 `too_many_requests`**: Request frequency limit exceeded.
- **500 `api_error`**: Server exception.

Expand All @@ -222,7 +231,7 @@ When a call fails, a standard error format and trace ID will be returned. Common

- **Required**: `action`, `prompt`
- **Edit Only**: `image_urls` (array, at least 1 item)
- **Optional**: `model` (default `nano-banana`, optional `nano-banana-2` or `nano-banana-pro`), `aspect_ratio` (width-to-height ratio, such as `1:1`, `16:9`), `resolution` (resolution, such as `1K`, `2K`, `4K`), `callback_url` (for asynchronous callback)
- **Optional**: `model` (default `nano-banana`, optional `nano-banana-2-lite`, `nano-banana-2`, `nano-banana-pro`, or the corresponding `:official` variant), `count` (1–4, default 1), `aspect_ratio` (`1:1`, `3:2`, `2:3`, `16:9`, `9:16`, `4:3`, or `3:4`), `resolution` (`1K`, `2K`, or `4K`; `nano-banana-2-lite` supports only `1K`), `callback_url` (for asynchronous callback), `async` (boolean)
- **Headers**: Must provide `authorization: Bearer {token}`; `accept` is recommended to be set to `application/json`
- **Image Accessibility**: `image_urls` must be direct links accessible publicly (HTTP/HTTPS), HTTPS is recommended
- **Idempotency and Tracking**: Retain `task_id` and `trace_id` for troubleshooting and result association
Loading