通过 Green Compute Cloud REST API,以编程方式管理你的 GPU 实例、监控资源用量、查询账单,并接收实时事件通知。
所有 API 请求须在 Header 中携带 Authorization 字段:
Authorization: Bearer gcc_live_xxxxxxxxxxxxxxxxxxxxxxxx
# POST /v2/instances curl -X POST https://api.greencompute.cloud/v2/instances \ -H "Authorization: Bearer gcc_live_xxxx" \ -H "Content-Type: application/json" \ -d '{ "name": "my-llm-trainer", "instance_type": "GC-A100-4x", "region": "singapore", "image": "pytorch-2.3-cuda12", "ssh_key_id": "key_abc123", "auto_stop_hours": 24 }'
# 响应 { "id": "inst_7kQm9xP2", "status": "provisioning", "ip": "103.22.78.91", "created_at": "2026-05-17T08:30:00Z", "carbon_offset_kg": 0 }
/v2/instances
创建 GPU 实例
/v2/instances
列出所有实例
/v2/instances/:id
查询单个实例详情
/v2/instances/:id/start
启动实例
/v2/instances/:id/stop
停止实例
/v2/instances/:id
销毁实例
/v2/billing/usage
查询用量与费用
/v2/metrics/:id
获取实例监控指标
pip install greencompute
npm install @greencompute/sdk
go get greencompute.cloud/sdk
cargo add greencompute