API Documentation

26 services, 47 models, one endpoint. Base URL: https://api.gpubridge.xyz

Quick Start

From zero to running AI jobs in 3 steps:

# 1. Register (free, instant)
curl -X POST https://api.gpubridge.xyz/account/register \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com"}'
# Returns: {"api_key":"gpub_...", ...}

# 2. Top up credits ($10 minimum)
curl -X POST https://api.gpubridge.xyz/account/topup \
  -H "Authorization: Bearer gpub_your_key" \
  -H "Content-Type: application/json" \
  -d '{"package":"credits_10"}'
# Returns: {"checkout_url":"https://checkout.stripe.com/..."}

# 3. Run a job
curl -X POST https://api.gpubridge.xyz/run \
  -H "Authorization: Bearer gpub_your_key" \
  -H "Content-Type: application/json" \
  -d '{"service":"llm-4090","input":{"prompt":"Hello world"}}'
# Returns: {"job_id":"...","status":"pending","estimated_cost_usd":0.003}

# 4. Get results
curl https://api.gpubridge.xyz/status/{job_id}
# Returns: {"status":"completed","output":{"text":"..."}}
Copy

Authentication

Three payment methods. Use any one per request:

Option A: API Key (developers)

Register, buy credits, authenticate with a Bearer token.

Authorization: Bearer gpub_your_api_key
Copy

Option B: x402 USDC Direct (AI agents)

No account needed. Send USDC on Base, include tx proof. See x402 Protocol for full details.

X-Payment: base64({"txHash":"0x...","from":"0xYourWallet"})
Copy

Option C: Crypto Top-Up (humans preferring crypto)

Register an account, then top up with USDC instead of card. 0.5% fee vs 2.9% for card.

Media URLs: When providing audio_url or image_url, use direct CDN links (e.g. soundhelix.com, imgbb.com). GitHub raw and Wikimedia URLs often return 403 from compute nodes.

POST /run

Main endpoint for all 26 services. Submit a job, get results via polling or webhook.

POST /run
Requires authentication (API key or x402)

Request body

{
  "service": "llm-4090",
  "input": { "prompt": "Explain quantum computing", "max_tokens": 512 },
  "webhook_url": "https://your-server.com/callback"  // optional
}
Copy

Optional headers

HeaderValuesDescription
X-Priorityfast | cheapRouting hint: lowest latency or lowest cost
Idempotency-KeyAny unique stringPrevents duplicate charges on retry

Response (202)

{
  "job_id": "a1b2c3d4-...",
  "service": "llm-4090",
  "status": "pending",
  "status_url": "/status/a1b2c3d4-...",
  "estimated_cost_usd": 0.003
}
Copy

GET /status/:job_id

GET /status/:job_id
Public — no authentication required

Poll until status is completed or failed. Sync services (LLM, Whisper) complete in the initial response.

{
  "id": "a1b2c3d4-...",
  "status": "completed",
  "output": { "text": "Quantum computing leverages..." },
  "execution_time_seconds": 0.45
}
Copy

GET /catalog

GET /catalog
Public — full service catalog with pricing and input schemas

GET /catalog/estimate

GET /catalog/estimate?service=llm-4090&seconds=30
Public — cost estimator, no auth required
{
  "service": "llm-4090",
  "estimated_seconds": 25,
  "price_per_second": 0.0024,
  "estimated_cost_usd": 0.06
}
Copy

GET /account/balance

GET /account/balance
Returns balance, daily spend, volume discount tier
curl https://api.gpubridge.xyz/account/balance \
  -H "Authorization: Bearer gpub_your_key"
Copy
{
  "balance": 8.50,
  "email": "you@example.com",
  "daily_spend": 1.50,
  "daily_limit": 50,
  "volume_discount": { "tier": "Standard", "discount_percent": 0 }
}
Copy

POST /account/topup

POST /account/topup
Create Stripe checkout session for credit card top-up
PackagePriceCreditsBonus
credits_10$10$10.00
credits_25$25$26.25+5%
credits_50$50$55.00+10%
credits_100$100$115.00+15%
curl -X POST https://api.gpubridge.xyz/account/topup \
  -H "Authorization: Bearer gpub_your_key" \
  -H "Content-Type: application/json" \
  -d '{"package":"credits_25"}'
# Returns: {"checkout_url":"https://checkout.stripe.com/..."}
Copy

POST /account/topup-crypto

POST /account/topup-crypto
Top up with USDC on Base. Same packages, 0.5% fee
curl -X POST https://api.gpubridge.xyz/account/topup-crypto \
  -H "Authorization: Bearer gpub_your_key" \
  -H "Content-Type: application/json" \
  -d '{"package":"credits_10"}'
# Returns payment address — send USDC, credits added automatically
Copy

GET /account/jobs

GET /account/jobs?limit=50&offset=0
Job history with costs, refunds, execution times

POST /account/spending-limit

POST /account/spending-limit
Set daily spending limit ($1–$10,000). Default: $50/day
curl -X POST https://api.gpubridge.xyz/account/spending-limit \
  -H "Authorization: Bearer gpub_your_key" \
  -H "Content-Type: application/json" \
  -d '{"daily_limit":100}'
Copy

POST /account/auto-topup

POST /account/auto-topup
Automatically buy credits when balance drops below threshold
'{"enabled":true,"threshold":1.00,"package":"credits_10"}'
Copy

Key Recovery

POST /account/recover
Check if an account exists for an email
POST /account/recover-reset
Generate a new API key (invalidates old one)
curl -X POST https://api.gpubridge.xyz/account/recover-reset \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com"}'
# Returns: {"api_key":"gpub_new_key_...", ...}
Copy
POST /account/regenerate-key
Generate new key using current valid key (requires auth)
GET /account/dashboard
Web dashboard — check balance, top up (card or USDC), view job history. Sign in with email + API key.
Tip: Bookmark api.gpubridge.xyz/account/dashboard for quick access to your balance, top-ups, and job history.

Text & Intelligence

5 services
ServiceKeyInputFrom
LLM Inference
4 models, sub-second
llm-4090{"prompt":"...","model":"llama-3.3-70b-versatile","max_tokens":512}$0.003
Text Embeddings
1024-dim vectors
embedding-l4{"text":"..."}$0.01
Visual Q&A
Moondream2
llava-4090{"image_url":"...","prompt":"..."}$0.05
Image Captioning
BLIP
caption{"image_url":"..."}$0.01
CLIP Interrogator
Image to text prompt
clip{"image_url":"..."}$0.02
LLM models: llama-3.3-70b-versatile (default), llama-3.1-8b-instant, meta-llama/llama-4-scout-17b-16e-instruct, qwen/qwen3-32b

Image & Video

11 services
ServiceKeyInputFrom
Image Generation
6 models
image-4090{"prompt":"..."}$0.003
Video Generationvideo{"prompt":"...","image_url":"..."}$0.30
Inpaintinginpaint{"image_url":"...","mask_url":"...","prompt":"..."}$0.04
ControlNetcontrolnet{"image_url":"...","prompt":"..."}$0.05
Image-to-Imageimg2img{"image_url":"...","prompt":"..."}$0.04
Image Variationsimage-variation{"image_url":"..."}$0.04
AI Portraitsphotomaker{"image_url":"...","prompt":"..."}$0.05
Sticker Makersticker{"image_url":"...","prompt":"..."}$0.02
Product Adsad-inpaint{"image_url":"...","prompt":"..."}$0.05
Image Animationanimate{"image_url":"..."}$0.10
Image models: flux-schnell (fastest, $0.003), flux-dev ($0.025), flux-1.1-pro ($0.04), sd-3.5-large, sdxl-lightning, playground-v2.5

Audio & Speech

6 services
ServiceKeyInputFrom
Speech-to-Text
Whisper, sub-second
whisper-l4{"audio_url":"..."}$0.05
Diarized STT
Speaker separation
whisperx{"audio_url":"..."}$0.05
Text-to-Speech
40+ voices
tts-l4{"text":"...","voice":"af_alloy"}$0.02
Expressive TTS
XTTS v2, sound effects
bark{"text":"Hello [laughter]"}$0.03
Music Generationmusicgen-l4{"prompt":"...","duration_seconds":10}$0.05
Voice Cloningvoice-clone{"audio_url":"..."}$0.10
TTS voices: af_alloy, af_nova, af_sky, am_adam, am_echo, am_onyx, bf_emma, bm_george, and 30+ more. See catalog for full list.

Utilities

5 services
ServiceKeyInputFrom
Background Removalrembg-l4{"image_url":"..."}$0.01
Image Upscale
2x or 4x
upscale-l4{"image_url":"...","scale":4}$0.04
Face Restoration
CodeFormer
face-restore{"image_url":"..."}$0.02
OCR
Florence-2
ocr{"image_url":"..."}$0.01
Segmentation
SAM-2
segmentation{"image_url":"..."}$0.02

Pricing

Always check cost before running: GET /catalog/estimate?service=llm-4090

x402 Protocol

For AI agent developers building autonomous clients. Spec-compliant with x402.org.

ParameterValue
NetworkBase (Chain ID 8453)
AssetUSDC (6 decimals)
Contract0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Recipient0xB0FdC6030B9f30652e8B221B8090d443Dd3C6381
Payment window300 seconds (5 minutes)
Confirmations1 (≤$10), 5 (>$10)
Anti-replayEach tx hash used once
OFAC screeningChainalysis Sanctions Oracle

Flow

  1. Call any endpoint without auth → receive HTTP 402
  2. Parse accepts[0].maxAmountRequired (USDC units) and accepts[0].payTo
  3. Send USDC on Base to payTo (amount ≥ maxAmountRequired)
  4. Base64-encode {"txHash":"0x...","from":"0x..."} as X-Payment header
  5. Retry the same request → job executes

402 response format

{
  "x402Version": 1,
  "accepts": [{
    "scheme": "exact",
    "network": "base",
    "maxAmountRequired": "10000",  // varies per service
    "payTo": "0xB0FdC6030B9f30652e8B221B8090d443Dd3C6381",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "maxTimeoutSeconds": 300
  }]
}
Copy

Important Notes