๐Ÿ“š Documentation

Everything you need to integrate ASG Agent Cloud with your AI agents.

โšก Quick Start (5 minutes)

Get your first inference running in minutes, not hours.

Prerequisites

Step 1: Install SDK

Python
pip install asg-cloud
TypeScript / JavaScript
npm install @asg/agent-cloud

Step 2: Connect & Run

Python
import asyncio
from asg_cloud import AgentClient

async def main():
    client = AgentClient(
        mcp_url="wss://mcp.asgcompute.com",
        wallet_secret="YOUR_WALLET_SECRET"  # or use environment variable
    )
    
    # Run inference
    response = await client.inference(
        model="deepseek-v3",
        messages=[{"role": "user", "content": "Hello!"}]
    )
    
    print(response.content)
    print(f"Cost: ${response.cost} USDC")

asyncio.run(main())
๐Ÿ’ก
Tip: Use devnet first! Set network="devnet" to test with fake USDC.

๐Ÿ” Authentication

ASG Agent Cloud uses Wallet = Identity. No API keys needed.

๐Ÿ“ก MCP Protocol

We implement the Model Context Protocol (MCP) standard for agent communication.

MCP Server URL
# Production
wss://mcp.asgcompute.com

# Devnet (testing)
wss://mcp-devnet.asgcompute.com

๐Ÿ’ณ x402 Payment Flow

When a request requires payment, the server returns HTTP 402 Payment Required:

402 Response Headers
HTTP/1.1 402 Payment Required
X-Payment-Amount: 0.015
X-Payment-Currency: USDC
X-Payment-Network: solana
X-Payment-Address: ASGtreasury...
X-Payment-Memo: req_abc123
X-Payment-Expires: 1706234567

Your agent signs a USDC transfer transaction and retries with the payment proof.

โš ๏ธ
Important: Always check the payment amount before signing!

๐Ÿ”ง MCP Tools Reference

get_pricing()

Returns current pricing for all resources.

Response
{
  "inference": {
    "deepseek-v3": { "per_1k_tokens": 0.001 },
    "qwen3-235b": { "per_1k_tokens": 0.003 }
  },
  "gpu": {
    "H200": { "per_second": 0.00125 }
  }
}

run_inference()

Execute model inference.

Parameters
{
  "model": "deepseek-v3",
  "messages": [{ "role": "user", "content": "..." }],
  "max_tokens": 4096,
  "payment_wallet": "YOUR_WALLET"
}

provision_gpu()

Allocate dedicated GPU resources (H100/H200) for training or heavy inference.

Parameters
{
  "gpu_type": "H200",
  "duration_seconds": 3600,
  "payment_wallet": "YOUR_WALLET"
}

terminate_compute()

Terminate a provisioned GPU instance to stop billing.

Parameters
{
  "pod_id": "pod-abc-123",
  "payment_wallet": "YOUR_WALLET"
}

run_modal()

Execute custom models deployed on serverless infrastructure.

Parameters
{
  "endpoint_name": "my-custom-model",
  "input_data": { "prompt": "..." },
  "payment_wallet": "YOUR_WALLET"
}

๐Ÿง  Available Models

Model ID Price / 1K
deepseek-v3 $0.001
qwen3-235b $0.003
llama3.3-70b $0.0008
minimax-m2 $0.005