เชื่อมต่อบัญชี
คุณมีบัญชี EQVPS อยู่แล้วและอยากให้สคริปต์หรือเอเจนต์ใช้งาน: รับโทเคน ใส่ในการตั้งค่า รันแซนด์บ็อกซ์แรก และเติมยอดเงินไว้เสมอ
ทุกอย่างเชื่อมกันอย่างไร
1. รับโทเคน
ง่ายที่สุด: ในแดชบอร์ดเปิด การตั้งค่า → โทเคน API สร้างโทเคน (ตั้งชื่อตามเอเจนต์ เลือกอายุ) แล้วคัดลอก โทเคนจะแสดงเพียงครั้งเดียว
จากบรรทัดคำสั่ง: เข้าสู่ระบบด้วยอีเมลและรหัสผ่านเพื่อรับโทเคนใหม่ ถ้าคุณสมัครด้วยรหัสทางอีเมลและไม่เคยตั้งรหัสผ่าน ให้ตั้งครั้งเดียวโดยใช้โทเคนจากแดชบอร์ด หรือสร้างบัญชีใหม่ด้วย POST /auth/register ซึ่งคืนโทเคนให้ทันที
# log in with email + password → token
curl -s https://api.eqvps.com/api/v1/eqvps/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","password":"your-password"}'
# → {"token":"eyJ0…","token_type":"Bearer","token_expires_at":"2027-10-03T…","user":{…}}
# signed up with an email code and have no password? set one once
# (authorise with a token from Settings → API tokens)
curl -s https://api.eqvps.com/api/v1/eqvps/auth/set-password \
-H "Authorization: Bearer $EQVPS_API_KEY" -H "Content-Type: application/json" \
-d '{"password":"new-pass-123","password_confirmation":"new-pass-123"}'
# no account yet: register straight from the API (password is optional)
curl -s https://api.eqvps.com/api/v1/eqvps/auth/register \
-H "Content-Type: application/json" -d '{"email":"you@example.com"}'
# extend a token before it expires
curl -s -X POST https://api.eqvps.com/api/v1/eqvps/auth/token/refresh \
-H "Authorization: Bearer $EQVPS_API_KEY"โทเคนมีอายุ 1 ปี (ดู token_expires_at ในคำตอบ) ต่ออายุด้วย POST /auth/token/refresh และเพิกถอนโทเคนที่ไม่ใช้แล้วในการตั้งค่า
2. ใส่ในการตั้งค่า
อย่าเก็บโทเคนไว้ในโค้ด: export เป็น EQVPS_API_KEY ไคลเอนต์ MCP รับโทเคนผ่านเฮดเดอร์ Authorization
# shell / CI secret — keep it out of the code
export EQVPS_API_KEY="eyJ0…"
# SDKs read the same variable (0.2.0+: give your code its secrets as env, not in the source)
pip install -U eqvps # Python
npm i @eqvps/sdk@latest # TypeScript / JavaScript
# Claude Code
claude mcp add --transport http eqvps https://mcp.eqvps.com/mcp \
--header "Authorization: Bearer $EQVPS_API_KEY"
# Cursor, Claude Desktop, other MCP clients (mcp.json)
{
"mcpServers": {
"eqvps": {
"type": "streamable-http",
"url": "https://mcp.eqvps.com/mcp",
"headers": { "Authorization": "Bearer <YOUR_TOKEN>" }
}
}
}3. รันแซนด์บ็อกซ์แรก
สร้าง รันโค้ด ลบ exit_code ที่ไม่ใช่ศูนย์คือผลลัพธ์ปกติของคำสั่ง ไม่ใช่ข้อผิดพลาด HTTP
API=https://api.eqvps.com/api/v1/eqvps
H="Authorization: Bearer $EQVPS_API_KEY"
SB=$(curl -s -X POST $API/sandboxes -H "$H" -H "Content-Type: application/json" \
-d '{"tariff":"micro"}' | python3 -c 'import sys,json; print(json.load(sys.stdin)["id"])')
curl -s -X POST $API/sandboxes/$SB/run -H "$H" -H "Content-Type: application/json" \
-d '{"language":"bash","code":"uname -sr && python3 --version && node --version"}'
# → {"exit_code":0,"stdout":"Linux 6.1…\nPython 3.12…\nv22…\n","stderr":"",…}
curl -s -X DELETE $API/sandboxes/$SB -H "$H"โหมด แพ็กเกจ และตัวอย่าง Python / Node.js: แซนด์บ็อกซ์ →
4. เติมยอดเงิน
แซนด์บ็อกซ์และเซิร์ฟเวอร์จ่ายจากยอดเงินเติมล่วงหน้าก้อนเดียว เติมได้ในแดชบอร์ด (ยอดเงิน: คริปโต, Monero หรือโค้ดโปรโมชัน) หรือด้วย POST /balance/topup ซึ่งคืนลิงก์ชำระเงิน GET /balance แสดงยอดคงเหลือ
curl -s $API/balance -H "$H"
# → {"balance":12.4,"currency":"USD","promo_balance":0,"real_balance":12.4,"promo_scope":"sandboxes"}
curl -s -X POST $API/balance/topup -H "$H" -H "Content-Type: application/json" -d '{"amount":10}'
# → {"invoice_id":…,"checkout_url":"https://…"} open the link and pay with cryptoข้อผิดพลาดที่คุณน่าจะเจอ
- 401 Unauthenticated — ไม่มีโทเคน พิมพ์ผิด หมดอายุ หรือถูกเพิกถอน ตรวจเฮดเดอร์ Authorization: Bearer สร้างโทเคนใหม่ในการตั้งค่า หรือเข้าสู่ระบบอีกครั้ง
- 402 insufficient_balance — ยอดเงินว่าง จึงเริ่มแซนด์บ็อกซ์ใหม่ไม่ได้ เติมเงินแล้วส่งคำขอซ้ำ แซนด์บ็อกซ์ถาวรที่กำลังรันจะถูกพักไว้แทนการลบ
- 429 และ 503 หมายความว่าคำขอถูกปฏิเสธก่อนมีอะไรรัน: รอตาม Retry-After แล้วส่งใหม่ 409 sandbox_paused: เติมเงินแล้วแซนด์บ็อกซ์จะทำงานต่อ
HTTP 401 {"message":"Unauthenticated."}
HTTP 402 {"error":"insufficient_balance","message":"Your balance cannot cover this sandbox. Top up (topup_balance / POST /balance/topup) and retry."}
HTTP 429 {"error":"too_many_concurrent", …} → wait Retry-After, then retry
HTTP 503 {"error":"capacity","retry_after":30, …} → wait Retry-After, then retry
ความคิดเห็น
ยังไม่มีความคิดเห็น เป็นคนแรกสิ