API Documentation

Complete reference for HGM APIs with code examples and integration guides

Quick Start

1. Get API Key

Sign up and generate an API key from your dashboard

2. Check Pricing

Estimate costs before making API calls using /pricing/estimate

3. Make Request

Include X-API-Key header in all requests

4. Verify Receipt

Verify cryptographic receipts for trust and security

Code Examples

import requests
import json

# Initialize HGM client
API_KEY = "your-api-key"
BASE_URL = "https://api.hgm.io/api/v1"

headers = {
    "X-API-Key": API_KEY,
    "Content-Type": "application/json"
}

# Get opportunities
response = requests.get(
    f"{BASE_URL}/opportunities",
    params={"asset": "BTC", "min_return": 5},
    headers=headers
)

opportunities = response.json()
print(json.dumps(opportunities, indent=2))

# Check cost before executing
cost_response = requests.post(
    f"{BASE_URL}/pricing/estimate",
    json={
        "endpoint": "/opportunities",
        "tier": "pro",
        "monthly_calls": 1000
    },
    headers=headers
)

pricing = cost_response.json()
print(f"Cost: {pricing['data']['cost_per_call']} cents")

Core Endpoints

GET/opportunities

Fetch market opportunities

Cost per call

$0.001

GET/market-intelligence

Get market trends and analysis

Cost per call

$0.0005

GET/sentiment

Get sentiment analysis

Cost per call

$0.002

GET/pricing

Get pricing for all endpoints

Cost per call

Free

POST/pricing/estimate

Estimate cost for API call

Cost per call

Free

GET/latency-metrics

Get latency metrics

Cost per call

Free

GET/trust/receipt/:id

Get receipt details

Cost per call

Free

GET/agents

List internal agents

Cost per call

Free

Authentication

API Key

Include X-API-Key header in all requests

X-API-Key: your-api-key-here

Bearer Token

Use JWT tokens for session-based auth

Authorization: Bearer eyJhbGc...

Payment Proof

Include x402 payment proof for premium endpoints

X-Payment-Proof: base64-encoded-proof

Signature

Sign requests with HMAC-SHA256

X-Signature: hmac-sha256-signature

Response Format

All API responses follow a standard format:

{
  "success": true,
  "data": {
    // Response data
  },
  "pricing": {
    "cost": 100,
    "currency": "USDC",
    "tier": "pro",
    "endpoint": "/opportunities"
  },
  "receipt": {
    "receipt_id": "receipt_...",
    "signature": "abc123...",
    "timestamp": 1234567890
  },
  "timestamp": "2026-03-17T18:00:00Z"
}

Downloads

OpenAPI Specification

Complete OpenAPI 3.1 specification

MCP Manifest

Model Context Protocol manifest for Claude

Capability Matrix

Complete capability matrix for agents

Support & Resources

Documentation

Complete API documentation and guides

Learn More

Agent Integration

Guide for integrating with AI agents

Learn More

Pricing Guide

Understand x402 pricing model

Learn More

Status Page

API status and incident reports

Learn More