Skip to main content

ASG Serverless

Execute Python and Node.js jobs with automatic scaling.

Overview

ASG Serverless provides:
  • Python & Node.js — Popular runtimes
  • Auto-scaling — Scale to zero, scale to thousands
  • Per-second billing — Pay only when running
  • Up to 10 minutes — Long-running job support

Quick Example

curl -X POST https://agent.asgcompute.com/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "serverless_invoke",
      "arguments": {
        "runtime": "python3.11",
        "code": "def main():\n    return {\"message\": \"Hello from serverless!\"}",
        "entrypoint": "main"
      },
      "_meta": {
        "payment": {"tx_signature": "<your-signature>"}
      }
    }
  }'

Parameters

ParameterTypeRequiredDescription
runtimestringYespython3.11 or node18
codestringYesSource code to execute
entrypointstringYesFunction name to call
timeout_secondsnumberNoMax execution time (default: 60)
memory_mbnumberNoMemory allocation (default: 512)

Runtimes

RuntimeVersionPackages
python3.11Python 3.11numpy, pandas, requests
node18Node.js 18axios, lodash, dayjs

Response

{
  "result": {
    "output": {"message": "Hello from serverless!"},
    "logs": "Function executed successfully",
    "duration_ms": 234,
    "_meta": {
      "receipt_id": "rcpt_xyz789",
      "debited_usdc_microusd": 5000
    }
  }
}

Use Cases

  • Data processing — Transform files, parse logs
  • API integrations — Call external APIs
  • Batch operations — Process queues
  • Webhooks — Handle external events
Timeout: Jobs are killed after timeout_seconds. Break long work into smaller chunks.

Pricing

See Pricing for per-second rates.