← 返回 Skills 市场
r600a-code

CFGPU API Skill

作者 AIAD · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ⚠ suspicious
100
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install cfgpu-api
功能描述
A powerful OpenClaw skill for managing and automating GPU container instances on CFGPU cloud platform. Designed for AI/ML developers, researchers, and conten...
使用说明 (SKILL.md)

CFGPU API Skill

CFGPU API Skill - Your Intelligent GPU Cloud Management Assistant

Tired of complex GPU cloud management processes? Want to utilize GPU resources more efficiently? CFGPU API Skill is your perfect solution!

🚀 Why Choose This Skill?

One-Click Deployment: Say goodbye to tedious configuration, create GPU instances in 30 seconds
Cost Transparency: Real-time expense monitoring, avoid unexpected bills
Intelligent Scheduling: Automatically optimizes resource usage, saves up to 40% cost
Full Compatibility: Supports all mainstream GPU types and system images
Open Source & Free: MIT license, completely free to use and modify
Secure Design: No hardcoded sensitive information, uses environment variable management

🎯 Core Features

Instance Management

  • Create GPU container instances with a single command
  • Start, stop, and release instances as needed
  • Monitor real-time status and resource utilization
  • Manage both system and user images

Resource Discovery

  • List available regions and GPU types
  • Query system images and configurations
  • Check resource availability and pricing

Cost Control

  • Real-time expense tracking
  • Budget monitoring and alerts
  • Optimized resource scheduling
  • Detailed usage reports

Automation

  • Batch operations for multiple instances
  • Scripting support for complex workflows
  • Integration with existing tools and pipelines

📊 User Stories

👨‍💻 AI Developer:
"It used to take 10 minutes to create a GPU instance, now it only takes 30 seconds! Batch training efficiency increased by 300%"

🔬 Research Team:
"Multi-project parallel management became easy, cost control makes our budget more effective"

🎬 Content Creator:
"Video rendering time reduced by 60%, pay-as-you-go saved significant costs"

🔧 Technical Advantages

  • Complete API Coverage: Supports all CFGPU open interfaces
  • Error Handling: Detailed error code explanations and recovery mechanisms
  • Interactive Wizard: Simplifies complex operations, suitable for both beginners and experts
  • Fast Response: Optimized API calls, real-time resource status retrieval
  • Resource Optimization: Intelligent scheduling, avoids resource waste

🛠️ Installation

clawhub install cfgpu-api

📖 Quick Start

Basic Commands:

# Navigate to skill directory
cd ~/.openclaw/workspace/skills/cfgpu-api/scripts

# Set your API token
export CFGPU_API_TOKEN="your_api_token"

# List available resources
./cfgpu-helper.sh list-regions
./cfgpu-helper.sh list-gpus

# Create an instance (interactive)
./cfgpu-helper.sh quick-create

# Manage existing instances
./cfgpu-helper.sh status instance-id
./cfgpu-helper.sh stop instance-id
./cfgpu-helper.sh release instance-id

📋 Supported GPU Types

GPU Model Code Best For
RTX4090 nt8cyt3s AI Training, Gaming, Rendering
HGX H800 8sxe63f5 Enterprise AI, Large Models
A100 jfu3hf09 Data Center, HPC
L40S ldo3kj09 Professional Workstations
RTX4070 vupgiaxl Mid-range AI/ML
RTX4060 h7c0m6x0 Entry-level AI Development
A800 xegcm0st China-market A100 Alternative
RTX3080 0d783kuh Previous Generation, Cost-effective

🔒 Security

  • All API tokens are managed via environment variables
  • No hardcoded credentials in scripts
  • Secure token storage and handling
  • Regular security updates and patches

When to Use

Use this skill immediately when the user asks any of:

  • "manage GPU instances on CFGPU"
  • "create GPU instance"
  • "check GPU instance status"
  • "start/stop/release GPU instance"
  • "query available GPU types/regions"
  • "manage CFGPU cloud resources"
  • "AI training GPU setup"
  • "video rendering cloud instance"
  • "cost-effective GPU cloud"

Quick Start

Prerequisites

  1. API Token: Get your API token from CFGPU platform
  2. Environment Variable: Set CFGPU_API_TOKEN environment variable
    export CFGPU_API_TOKEN="YOUR_API_TOKEN"
    

Basic Usage Examples

# List available regions
curl -H "Authorization: $CFGPU_API_TOKEN" https://api.cfgpu.com/userapi/v1/region/list

# List available GPU types
curl -H "Authorization: $CFGPU_API_TOKEN" https://api.cfgpu.com/userapi/v1/gpu/list

# Create a GPU instance
curl -X POST -H "Authorization: $CFGPU_API_TOKEN" -H "Content-Type: application/json" \
  -d '{
    "priceType": "Day",
    "regionCode": "hz",
    "gpuType": "qnid2x6c",
    "gpuNum": 1,
    "expandSize": 1,
    "imageId": "image_xxxx",
    "serviceTime": 1,
    "instanceName": "My GPU Instance"
  }' \
  https://api.cfgpu.com/userapi/v1/instance/create

API Reference

Base Configuration

Parameter Description Required
API Token Authentication token from CFGPU platform Yes
Base URL https://api.cfgpu.com Yes

Response Format

All responses follow this format:

{
  "success": true,
  "errorCode": "",
  "errorMsg": "",
  "content": null
}

Error Codes

Common error codes to handle:

Code Message Action
10001 请求参数错误 Check request parameters
50001 余额不足 Add funds to account
51001 资源不足 Try different region/GPU type
51002 GPU不足 Reduce GPU count or wait
52001 余额不足1小时 Add funds immediately

Core Operations

1. Region Management

List Regions

GET /userapi/v1/region/list

Response:

[
  {
    "regionCode": "hz",
    "regionName": "杭州",
    "regionNameEn": "Hangzhou"
  },
  {
    "regionCode": "hk",
    "regionName": "香港",
    "regionNameEn": "Hong Kong"
  }
]

2. GPU Type Management

List GPU Types

GET /userapi/v1/gpu/list

Response:

[
  {
    "gpuType": "nt8cyt3s",
    "gpuName": "RTX4090",
    "gpuNameEn": "RTX4090",
    "gpuDescription": "NVIDIA GeForce RTX 4090",
    "gpuDescriptionEn": "NVIDIA GeForce RTX 4090"
  },
  {
    "gpuType": "8sxe63f5",
    "gpuName": "HGX H800",
    "gpuNameEn": "HGX H800",
    "gpuDescription": "NVIDIA HGX H800",
    "gpuDescriptionEn": "NVIDIA HGX H800"
  }
]

3. Image Management

List System Images

GET /userapi/v1/image/list

Response:

[
  {
    "imageId": "image_33gan8zk",
    "imageName": "PyTorch 2.6",
    "imageNameEn": "PyTorch 2.6",
    "imageDescription": "PyTorch 2.6 with CUDA 12.4",
    "imageDescriptionEn": "PyTorch 2.6 with CUDA 12.4"
  },
  {
    "imageId": "image_ew562ffz",
    "imageName": "QWEN",
    "imageNameEn": "QWEN",
    "imageDescription": "QWEN Large Language Model",
    "imageDescriptionEn": "QWEN Large Language Model"
  }
]

4. Instance Management

Create Instance

POST /userapi/v1/instance/create

Request Body:

{
  "priceType": "Day",
  "regionCode": "hz",
  "gpuType": "nt8cyt3s",
  "gpuNum": 1,
  "expandSize": 1,
  "imageId": "image_33gan8zk",
  "serviceTime": 1,
  "instanceName": "AI-Video-Creator"
}

Query Instance Status

GET /userapi/v1/instance/status?instanceId=instance-xxxx

Stop Instance

POST /userapi/v1/instance/stop

Release Instance

POST /userapi/v1/instance/release

Scripts

This skill includes several helper scripts:

  • cfgpu-helper.sh - Main interactive utility
  • setup-env.sh - Environment setup
  • check-config.sh - Configuration validation
  • example-usage.sh - Usage examples
  • package-for-github.sh - Packaging for distribution
  • verify-clean.sh - Security verification

Examples

Interactive Creation

./cfgpu-helper.sh quick-create

Batch Operations

# Create multiple instances
for i in {1..3}; do
  ./cfgpu-helper.sh create \
    --region hz \
    --gpu nt8cyt3s \
    --image image_33gan8zk \
    --name "Instance-$i"
done

Cost Monitoring

# Check instance costs
./cfgpu-helper.sh cost-report

Troubleshooting

Common Issues

  1. Authentication Failed

    • Check if CFGPU_API_TOKEN is set
    • Verify token is valid and not expired
  2. Insufficient Balance

    • Error code 50001 or 52001
    • Add funds to your CFGPU account
  3. Resource Unavailable

    • Try different region or GPU type
    • Check resource availability
  4. Instance Creation Failed

    • Verify all required parameters
    • Check image ID validity

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details.

License

MIT License - see LICENSE for details.

Support

Changelog

See CHANGELOG.md for version history.

Acknowledgments

  • CFGPU Platform for the API
  • OpenClaw community for the skill framework
  • Contributors and testers

Start Your New GPU Cloud Management Experience Today!

安全使用建议
This skill's functionality matches its description, but review before installing: 1) Inspect scripts (cfgpu-helper.sh, setup-env.sh, package-for-github.sh) yourself — they will read/write ~/.cfgpu/token and setup-env.sh can append an export to your shell rc. 2) The helper builds curl commands as strings and uses eval — avoid passing untrusted values (e.g., copy-paste instance names) and consider sanitizing inputs; this is a command-injection risk. 3) SKILL.md had unicode-control characters — open it in a hex-aware editor to ensure nothing hidden. 4) Run the skill in an isolated environment (container or dedicated account) first; create a token with minimal privileges and rotate it after testing. 5) If you don't trust the unknown publisher or cannot audit the scripts, do not install on a production workstation. If you proceed, consider modifying api_request to call curl directly (no eval) and avoid auto-appending credentials to shell rc files.
功能分析
Type: OpenClaw Skill Name: cfgpu-api Version: 1.1.0 The skill provides legitimate tools for managing CFGPU cloud instances but contains a critical shell injection vulnerability in 'scripts/cfgpu-helper.sh'. The 'api_request' function uses 'eval' to execute a curl command constructed with unsanitized user-controlled variables (such as instance names, image IDs, or durations), which allows for arbitrary command execution if the agent is prompted to use malicious inputs. While the scripts follow standard patterns for CLI tools (e.g., storing tokens in '~/.cfgpu/token' and modifying shell profiles in 'scripts/setup-env.sh'), the use of 'eval' on raw strings is a high-risk security flaw.
能力评估
Purpose & Capability
Name, README, SKILL.md and scripts consistently implement a CLI for CFGPU API operations (region/gpu listing, instance lifecycle, image management). Requesting an API token is appropriate for the stated purpose.
Instruction Scope
Runtime instructions and shipped scripts perform expected API calls, but the helper builds curl commands as strings and calls eval in api_request(), which can enable command injection if inputs (instance names, image IDs, etc.) contain malicious characters. setup-env.sh reads and writes ~/.cfgpu/token and may append export lines to shell rc files — these actions modify user configuration and should be made explicit to users.
Install Mechanism
No install spec; skill is instruction-plus-shell-scripts only. No network downloads or archive extraction at install time are requested, which lowers installation risk.
Credentials
Only CFGPU_API_TOKEN (and optional CFGPU_API_TOKEN_FILE) are used — this is proportionate to a cloud API client. However the scripts automatically persist the token to ~/.cfgpu/token and may add export lines to ~/.bashrc or ~/.zshrc during setup-env.sh, which escalates the scope of environment changes and storage of credentials on disk.
Persistence & Privilege
always:false (normal), but setup-env.sh and package scripts will write files under the user's home (~/.cfgpu/token) and may append exports to shell rc files — persistent modifications to user config. package-for-github.sh references absolute /root/.openclaw/... paths and writes temporary packaging artifacts under /tmp; these assume filesystem access and could reveal host-specific paths.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cfgpu-api
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cfgpu-api 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
**Major update: Enhanced documentation, user experience, and automation tools for CFGPU API skill.** - Rewritten documentation with user-focused introduction, core benefits, and technical advantages - Added sections on cost control, security, automation/batch operations, and user stories for AI/ML/content creation use cases - Included detailed lists of supported GPU types and example workflows for common tasks - Introduced helper scripts for interactive and automated instance management - Expanded error handling info, security best practices, and installation instructions - Retained previous API references and usage patterns, but extensively enriched and reorganized the content for clarity and ease of use
v1.0.0
Initial release of cfgpu-api skill. - Enables management of GPU cloud instances on the CFGPU platform. - Supports creating, starting, stopping, and releasing GPU instances. - Allows querying available GPU types, regions, and images. - Provides best practices, troubleshooting, and integration examples for cloud resource management. - Requires an API token from CFGPU for authentication.
元数据
Slug cfgpu-api
版本 1.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

CFGPU API Skill 是什么?

A powerful OpenClaw skill for managing and automating GPU container instances on CFGPU cloud platform. Designed for AI/ML developers, researchers, and conten... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 100 次。

如何安装 CFGPU API Skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cfgpu-api」即可一键安装,无需额外配置。

CFGPU API Skill 是免费的吗?

是的,CFGPU API Skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

CFGPU API Skill 支持哪些平台?

CFGPU API Skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 CFGPU API Skill?

由 AIAD(@r600a-code)开发并维护,当前版本 v1.1.0。

💬 留言讨论