API Documentation

Rent cloud GPUs programmatically. Built for AI agents, bots, and developers using HTTP 402 Machine Payable Protocol.

🤖 Machine Payable Protocol v1.0 — AI agents can discover, rent, and manage GPUs via HTTP
Base URL
https://gpuhog.com/api

🔑 Authentication

Most endpoints are currently open and do not require authentication. For credit-based rentals and balance checks, include your API key via the X-Api-Key header. You receive an API key automatically when you purchase your first credit pack. Full API key authentication for all endpoints is coming soon.

List Available GPUs

GET /api/gpus

Returns all available GPUs with pricing, tier, and rental info. This is the discovery endpoint for Machine Payable Protocol.

curl example
curl https://gpuhog.com/api/gpus
Response
{ "gpus": [ { "gpu_id": "NVIDIA GeForce RTX 3090", "name": "RTX 3090", "vram": "24 GB", "price_per_hour_usd": 0.34, "tier": "piglet", "rent_url": "https://gpuhog.com/api/rent", "payment_methods": ["stripe"], "protocol": "HTTP-402-MPP" } // ... more GPUs ], "protocol": "Machine-Payable-Protocol/1.0", "docs": "https://gpuhog.com/api/docs" }

API Docs (JSON)

GET /api/docs

Returns machine-readable API documentation listing all endpoints.

curl example
curl https://gpuhog.com/api/docs
Response
{ "name": "GPU Hog - Machine Payable GPU Rental", "version": "2.0", "protocol": "Machine-Payable-Protocol/1.0 (HTTP 402)", "base_url": "https://gpuhog.com/api", "endpoints": [ /* array of endpoint objects */ ] }

Rent a GPU (Stripe)

POST /api/rent

Request a GPU rental. Returns HTTP 402 with a Stripe checkout URL for payment. After payment, the pod deploys automatically.

ParameterTypeRequiredDescription
gpu_idstringYesGPU RunPod ID or name from /api/gpus
hoursintegerNoRental duration (1-720, default 1)
curl example
curl -X POST https://gpuhog.com/api/rent \ -H "Content-Type: application/json" \ -d '{"gpu_id": "NVIDIA GeForce RTX 4090", "hours": 2}'
Response (402 Payment Required)
{ "status": 402, "message": "Payment Required", "protocol": "Machine-Payable-Protocol/1.0", "order_id": "HOG-a1b2c3d4e5f6", "gpu": "RTX 4090", "vram": "24 GB", "hours": 2, "total_usd": "0.98", "payment": { "method": "stripe_checkout", "checkout_url": "https://checkout.stripe.com/...", "expires_at": "2026-03-30T12:30:00+00:00" } }

Rent with Credits

POST /api/rent-with-credits

Rent a GPU using your token balance. Requires API key. Pod deploys instantly without a Stripe checkout step.

ParameterTypeRequiredDescription
gpu_idstringYesGPU RunPod ID or name
hoursintegerNoRental duration (1-720, default 1)
curl example
curl -X POST https://gpuhog.com/api/rent-with-credits \ -H "Content-Type: application/json" \ -H "X-Api-Key: ghk_your_api_key_here" \ -d '{"gpu_id": "RTX 4090", "hours": 3}'
Response
{ "status": "deploying", "order_id": "HOG-a1b2c3d4e5f6", "pod_id": "abc123xyz", "gpu": "RTX 4090", "credits_spent": 147, "balance": 853 }

Pig Chat

POST /api/pig-chat

Chat with the GPU Hog pig assistant. Ask questions about GPUs, pricing, setup, and more.

ParameterTypeRequiredDescription
messagestringYesYour question (max 500 chars)
curl example
curl -X POST https://gpuhog.com/api/pig-chat \ -H "Content-Type: application/json" \ -d '{"message": "What GPU should I use for training a 7B model?"}'
Response
{ "reply": "For a 7B parameter model, I would recommend the A100 80GB..." }

Order Status

GET /api/order/{order_id}

Check order status including live pod details, GPU utilization, and SSH/Jupyter access info.

curl example
curl https://gpuhog.com/api/order/HOG-a1b2c3d4e5f6
Response
{ "order_id": "HOG-a1b2c3d4e5f6", "status": "running", "gpu": "RTX 4090", "vram": "24 GB", "hours": 2, "pod_id": "abc123xyz", "access": { "ssh": "ssh root@203.0.113.42 -p 22042", "jupyter": "https://gpuhog.com/pod/abc123xyz/" }, "gpu_stats": [ { "gpu_util": "23%", "mem_util": "18%" } ] }

Stop Pod

POST /api/order/{order_id}/stop

Stop a running pod to pause billing. Volume data is preserved. Storage costs 5 tokens/hr while stopped.

curl example
curl -X POST https://gpuhog.com/api/order/HOG-a1b2c3d4e5f6/stop
Response
{ "status": "stopped", "order_id": "HOG-a1b2c3d4e5f6" }

Start Pod

POST /api/order/{order_id}/start

Restart a stopped or reserved pod. Resumes billing at the GPU hourly rate.

curl example
curl -X POST https://gpuhog.com/api/order/HOG-a1b2c3d4e5f6/start
Response
{ "status": "starting", "order_id": "HOG-a1b2c3d4e5f6" }

Terminate Pod

POST /api/order/{order_id}/terminate

Permanently terminate a pod. All data is deleted. This action cannot be undone.

curl example
curl -X POST https://gpuhog.com/api/order/HOG-a1b2c3d4e5f6/terminate
Response
{ "status": "terminated", "order_id": "HOG-a1b2c3d4e5f6" }

Credit Packs

GET /api/credits/packs

List available token packs with pricing and savings info.

curl example
curl https://gpuhog.com/api/credits/packs
Response
{ "packs": [ { "id": "pack_500", "credits": 500, "price_usd": "5.00", "label": "Starter Pack", "savings": "" } // ... more packs ], "note": "Credits never expire. 1 token = 1 cent" }

Credit Balance

GET /api/credits/balance

Check your token balance and API key. Authenticate with your API key or email.

curl example
curl -H "X-Api-Key: ghk_your_api_key_here" \ https://gpuhog.com/api/credits/balance
Response
{ "email": "you@example.com", "credits_balance": 1847, "total_purchased": 2500, "total_spent": 653, "api_key": "ghk_your_api_key_here" }

Machine Payable Protocol

How AI agents interact with GPU Hog

GPU Hog implements HTTP 402 Machine Payable Protocol (MPP), enabling AI agents to autonomously discover, negotiate, and pay for GPU resources:

1
Discover — Agent calls GET /api/gpus to list available GPUs and pricing
2
Request — Agent calls POST /api/rent with desired GPU and hours
3
Pay — GPU Hog returns HTTP 402 with a Stripe checkout URL. Agent or user completes payment.
4
Deploy — Pod spins up automatically. Agent polls GET /api/order/{id} for SSH/Jupyter access.
5
Manage — Agent can stop, start, or terminate pods via API. Or use tokens for instant deploy with POST /api/rent-with-credits.