Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

z-ai-apiZ AI API 搜索

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

242

周安装

10

GitHub Stars

1

下载量

79
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:z-ai-api(Z AI API 搜索)
来源仓库:https://github.com/jrajasekera/claude-skills
仓库路径:skills/z-ai-api
安装命令:
npx skills add https://github.com/jrajasekera/claude-skills --skill z-ai-api
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jrajasekera/claude-skills --skill z-ai-api

简介

智能 API 设计与文档生成助手。

  • 支持 OpenAPI 规范与 SDK 代码生成。
  • 自动校验参数类型与错误码定义。z-ai-api 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 必须基于真实接口行为编写文档。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 避免虚构不存在的字段或响应格式。

SKILL.md

Z.ai API Skill

Quick Reference

Base URL: https://api.z.ai/api/paas/v4 Coding Plan URL: https://api.z.ai/api/coding/paas/v4 Auth: Authorization: Bearer YOUR_API_KEY

Core Endpoints

EndpointPurpose
/chat/completionsText/vision chat
/images/generationsImage generation
/videos/generationsVideo generation (async)
/audio/transcriptionsSpeech-to-text
/web_searchWeb search
/async-result/{id}Poll async tasks
/v1/agentsTranslation, slides, effects

Model Selection

Chat (pick by need):

  • glm-4.7 — Latest flagship, best quality, agentic coding
  • glm-4.7-flash — Fast, high quality
  • glm-4.6 — Reliable general use
  • glm-4.5-flash — Fastest, lower cost

Vision:

  • glm-4.6v — Best multimodal (images, video, files)
  • glm-4.6v-flash — Fast vision

Media:

  • glm-image — High-quality images (HD, ~20s)
  • cogview-4-250304 — Fast images (~5-10s)
  • cogvideox-3 — Video, up to 4K, 5-10s
  • viduq1-text/image — Vidu video generation

Implementation Patterns

Basic Chat

from zai import ZaiClient

client = ZaiClient(api_key="YOUR_KEY")

response = client.chat.completions.create(
    model="glm-4.7",
    messages=[
        {"role": "system", "content": "You are helpful."},
        {"role": "user", "content": "Hello!"}
    ]
)
print(response.choices[0].message.content)

OpenAI SDK Compatibility

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_ZAI_KEY",
    base_url="https://api.z.ai/api/paas/v4/"
)
# Use exactly like OpenAI SDK

Streaming

response = client.chat.completions.create(
    model="glm-4.7",
    messages=[...],
    stream=True
)
for chunk in response:
    print(chunk.choices[0].delta.content, end="")

Function Calling

tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "Get weather for a city",
        "parameters": {
            "type": "object",
            "properties": {
                "city": {"type": "string"}
            },
            "required": ["city"]
        }
    }
}]

response = client.chat.completions.create(
    model="glm-4.7",
    messages=[{"role": "user", "content": "Weather in Tokyo?"}],
    tools=tools,
    tool_choice="auto"
)

# Handle tool_calls in response.choices[0].message.tool_calls

Vision (Images/Video/Files)

response = client.chat.completions.create(
    model="glm-4.6v",
    messages=[{
        "role": "user",
        "content": [
            {"type": "image_url", "image_url": {"url": "https://..."}},
            {"type": "text", "text": "Describe this image"}
        ]
    }]
)

Image Generation

response = client.images.generate(
    model="glm-image",
    prompt="A serene mountain at sunset",
    size="1280x1280",
    quality="hd"
)
print(response.data[0].url)  # Expires in 30 days

Video Generation (Async)

# Submit
response = client.videos.generate(
    model="cogvideox-3",
    prompt="A cat playing with yarn",
    size="1920x1080",
    duration=5
)
task_id = response.id

# Poll for result
import time
while True:
    result = client.async_result.get(task_id)
    if result.task_status == "SUCCESS":
        print(result.video_result[0].url)
        break
    time.sleep(5)

Web Search Integration

response = client.chat.completions.create(
    model="glm-4.7",
    messages=[{"role": "user", "content": "Latest AI news?"}],
    tools=[{
        "type": "web_search",
        "web_search": {
            "enable": True,
            "search_result": True
        }
    }]
)
# Access response.web_search for sources

Thinking Mode (Chain-of-Thought)

response = client.chat.completions.create(
    model="glm-4.7",
    messages=[...],
    thinking={"type": "enabled"},
    stream=True  # Recommended with thinking
)
# Access reasoning_content in response

Key Parameters

ParameterValuesNotes
temperature0.0-1.0GLM-4.7: 1.0, GLM-4.5: 0.6 default
top_p0.01-1.0Default ~0.95
max_tokensvariesGLM-4.7: 128K, GLM-4.5: 96K max
streamboolEnable SSE streaming
response_format{"type": "json_object"}Force JSON output

Error Handling

  • 429: Rate limited — implement exponential backoff
  • 401: Bad API key — verify credentials
  • sensitive: Content filtered — modify input
if response.choices[0].finish_reason == "tool_calls":
    # Execute function and continue conversation
elif response.choices[0].finish_reason == "length":
    # Increase max_tokens or truncate
elif response.choices[0].finish_reason == "sensitive":
    # Content was filtered

Reference Files

For detailed API specifications, consult:

  • references/chat-completions.md — Full chat API, parameters, models
  • references/tools-and-functions.md — Function calling, web search, retrieval
  • references/media-generation.md — Image, video, audio APIs
  • references/agents.md — Translation, slides, effects agents
  • references/error-codes.md — Error handling, rate limits

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37%
按下载量换算29

Claude

27.39%
按下载量换算22

Cursor

18.5%
按下载量换算15

Gemini CLI

9.01%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills