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": {}}'
import requests, os

ASG = "https://agent.asgcompute.com/v1/mcp/tools/call"
API_KEY = os.environ["ASG_API_KEY"]

r = requests.post(ASG, json={
    "tool": "get_status",
    "params": {}
}, headers={
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
})
print(r.json())
const ASG = 'https://agent.asgcompute.com/v1/mcp/tools/call';
const API_KEY = process.env.ASG_API_KEY!;

const res = await fetch(ASG, {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ tool: 'get_status', params: {} }),
});
console.log(await res.json());
✅ 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}'
import requests

r = requests.get("https://agent.asgcompute.com/mcp/capabilities")
for tool in r.json().get("tools", []):
    print(f"{tool['name']:30} billable={tool.get('billable', 'N/A')}")
const res = await fetch('https://agent.asgcompute.com/mcp/capabilities');
const data = await res.json();
for (const tool of data.tools) {
  console.log(`${tool.name.padEnd(30)} billable=${tool.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!"}]
    }
  }'
import requests, os

ASG = "https://agent.asgcompute.com/v1/mcp/tools/call"
API_KEY = os.environ["ASG_API_KEY"]

r = requests.post(ASG, json={
    "tool": "inference_chat",
    "params": {
        "model": "openai/gpt-4o-mini",
        "messages": [{"role": "user", "content": "Hello!"}]
    }
}, headers={
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
})
print(r.status_code, r.json())
const ASG = 'https://agent.asgcompute.com/v1/mcp/tools/call';
const API_KEY = process.env.ASG_API_KEY!;

const res = await fetch(ASG, {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    tool: 'inference_chat',
    params: {
      model: 'openai/gpt-4o-mini',
      messages: [{ role: 'user', content: 'Hello!' }],
    },
  }),
});
console.log(res.status, await res.json());

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"
    }
  }'
import requests, os

ASG = "https://agent.asgcompute.com/v1/mcp/tools/call"
API_KEY = os.environ["ASG_API_KEY"]

r = requests.post(ASG, json={
    "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"
    }
}, headers={
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
})
print(r.json())
const ASG = 'https://agent.asgcompute.com/v1/mcp/tools/call';
const API_KEY = process.env.ASG_API_KEY!;

const res = await fetch(ASG, {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    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',
    },
  }),
});
console.log(await res.json());

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