360 Secure SkillHub
360 安全技能中心

Guishu GPT Image 2

核心功能:基于Guishu Token的gpt-image-2模型,通过OpenAI兼容接口生成图片,支持指定尺寸、质量,可单/多提示词批量生成,本地保存图片及请求记录。典型场景:prompt转图测试、客户演示、搭建图片库。输入为文本提示词(或批量文件)及可选参数;输出为本地图片、预览网页等,支持dry-run测试,超时需确认后再重试。

quqi1599
quqi1599
热度 72.81
最近更新 2026-06-22 12:23:41
分类:创作依赖:代码执行 / 第三方 API / 读写文件应用场景:图像生成 / 自动化脚本 / 品牌素材

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add guishu-gpt-image-2
Metadata
name
guishu-gpt-image-2
description
Generate images with Guishu Token gpt-image-2 through the OpenAI-compatible images endpoint. Use when the user wants Guishu gpt-image-2 image generation, an OpenClaw image skill, scripted image creation, local image output, prompt-to-image tests, customer demos, or a gallery of generated images through https://api.llm-token.cn/v1/images/generations.

Guishu GPT Image 2

Generate images through the Guishu Token OpenAI-compatible image endpoint.

Quick Start

Use the bundled script. It reads the API key from environment variables in this order:

  1. LLM_TOKEN_API_KEY
  2. GUI_SHU_TOKEN_KEY
  3. OPENAI_API_KEY
export LLM_TOKEN_API_KEY="sk-..."
python3 {baseDir}/scripts/generate.py \
  --prompt "a clean product poster for a blue smart speaker, studio lighting" \
  --size 1024x1024 \
  --quality high \
  --n 1

The default endpoint is:

https://api.llm-token.cn/v1/images/generations

The default model is:

gpt-image-2

Workflow

  1. Read references/gpt-image-2-api.md when you need endpoint details, supported request fields, timeout guidance, or customer-facing setup notes.
  2. Prepare one specific image prompt. Keep prompts concrete about subject, style, composition, camera, lighting, color, and output use.
  3. Run scripts/generate.py. Prefer --response-format b64_json so the script can save files locally without depending on temporary URLs.
  4. Inspect the saved output directory. The script writes generated images, prompts.json, request.json, and index.html.
  5. If the request times out after a long wait, do not automatically retry. High-resolution requests can take 70-150 seconds and may still be billable upstream.

Useful Commands

# Dry-run without sending a billable request.
python3 {baseDir}/scripts/generate.py --prompt "test prompt" --dry-run

# Tall portrait.
python3 {baseDir}/scripts/generate.py \
  --prompt "ultra realistic portrait photo, natural light, shallow depth of field" \
  --size 1024x1792 \
  --quality high

# Multiple prompts from a text file, one prompt per line.
python3 {baseDir}/scripts/generate.py --prompt-file ./prompts.txt --n 1

# Custom endpoint if the gateway changes.
python3 {baseDir}/scripts/generate.py \
  --endpoint https://api.llm-token.cn/v1/images/generations \
  --model gpt-image-2 \
  --prompt "minimal app icon, white background"

Safety and Cost Notes

  • Do not print API keys. Prefer environment variables over command-line --api-key.
  • Avoid blind retries after long timeouts. Ask the user before retrying a request that may already have been processed.
  • For casual users, recommend the web UI first: https://image2.gpt-agent.cc/.
  • For automation or agent workflows, use the script and save local outputs.