Skip to main content

Quickstart

Get started with ASG Agent Cloud — from zero to first call in 3 minutes.
Start free: get_status and echo are always free — no payment required. Validate your setup before spending a cent.

Prerequisites

  • ASG API key (from Console → API Keys)
  • For paid tools: Solana wallet with USDC on mainnet
  • Node.js 18+ or Python 3.10+

Step 1: Get Your API Key

  1. Open Console
  2. Connect wallet → API KeysCreate Key
  3. Export the key:
export ASG_API_KEY="sk-agent-YOUR_KEY"

Step 2: First Call — Free (No Payment!)

Call get_status to verify your key works:
curl -X POST https://agent.asgcompute.com/v1/mcp/tools/call \
  -H "Authorization: Bearer $ASG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tool": "get_status", "params": {}}'
✅ You should see "ok": true with your balance and system status.

Step 3: Discover Tools

curl -s https://agent.asgcompute.com/mcp/capabilities \
  | jq '.tools[] | {name, status, billable}'

Step 4: Make a Paid Call

Call a billable tool. If you have balance, it executes immediately. Otherwise, you get a 402 with a quote.
curl -X POST https://agent.asgcompute.com/v1/mcp/tools/call \
  -H "Authorization: Bearer $ASG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "inference_chat",
    "params": {
      "model": "openai/gpt-4o-mini",
      "messages": [{"role": "user", "content": "Hello!"}]
    }
  }'

If 200: Success!

{
  "ok": true,
  "result": { "type": "text", "content": "Hello! How can I help you?" },
  "receipt": { "receipt_id": "rcpt_123", "debited_usdc_microusd": 10000 }
}

If 402: Payment Required

You receive a quote with payment_instructions:
{
  "code": "PAYMENT_REQUIRED",
  "quote": {
    "quote_id": "abc123",
    "amount_usdc_microusd": 10000,
    "expires_at": "2026-02-10T12:00:00Z"
  },
  "payment_instructions": {
    "network": "solana-mainnet",
    "asset": "USDC",
    "pay_to": "<treasury_ata>",
    "usdc_mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
  },
  "step_id": "step_xyz"
}

Step 5: Pay on Solana Mainnet

Send USDC to pay_to with memo: {step_id}:{quote_id}:1
Faster: Deposit USDC via Console → Balance first. Then all paid calls deduct from your balance automatically — no per-call on-chain transactions needed.

Step 6: Retry with Payment Proof

curl -X POST https://agent.asgcompute.com/v1/mcp/tools/call \
  -H "Authorization: Bearer $ASG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "inference_chat",
    "params": {
      "model": "openai/gpt-4o-mini",
      "messages": [{"role": "user", "content": "Hello!"}]
    },
    "idempotency_key": "550e8400-e29b-41d4-a716-446655440000",
    "payment_proof": {
      "tx_ref": "<solana_tx_signature>",
      "quote_id": "abc123",
      "step_id": "step_xyz",
      "memo": "step_xyz:abc123:1",
      "amount_usdc": "0.010000",
      "network": "solana-mainnet"
    }
  }'

What’s Next?

Agent Quickstart

Full agent integration guide with Python + TypeScript examples

Core Concepts

Runs, Steps, Budgets, and Receipts

SDK Reference

Working code examples

Pricing

Detailed pricing for all services