API Documentation

Complete reference for REST endpoints, MCP tools, and agent integration.

REST API Endpoints

Interactive OpenAPI specification. Expand endpoints to view schemas, try requests, and see responses.

MCP Tools for Claude

32 tools across 4 categories — install via npx glashaus-mcp

Available in Claude Desktop after setup. Each category below lists the tool names you can call.

Educational (13 tools)

Learn the platform before spending a single cent. Ask Claude to explain any concept.

  • explain_deployment_flow
  • explain_x402_payment
  • explain_wallet_setup
  • explain_setup
  • explain_architecture
  • explain_upload
  • explain_deploy
  • explain_domains
  • explain_wallet
  • explain_cid_and_indexing
  • explain_free_tier
  • get_implementation_guide
  • get_deployment_api
MCP Setup Guide

Wallet Management (5 tools)

Create, import, and inspect the EVM wallet that pays for operations.

  • setup_wallet
  • import_wallet
  • get_wallet_info
  • start_github_link
  • check_github_link
MCP Setup Guide

Upload & Deploy (7 tools)

Check paths, preview costs, upload files, and track deployment status.

  • check_path
  • prepare_upload
  • upload_files
  • confirm_upload
  • get_deployment_status
  • get_pricing
  • get_system_info
MCP Setup Guide

Domains & Analytics (7 tools)

Manage custom domains and query analytics for pinned content.

  • add_domain
  • remove_domain
  • list_domains
  • list_files
  • get_analytics
  • get_agent_stats
  • get_network_info
MCP Setup Guide

Agent Discovery Flow

Recommended sequence for agents to discover and interact with the platform.

1

Discover the Platform

Call /api/info to learn about available features, networks, and interfaces

2

Choose Your Network

Call /api/info/networks to select between testnet or mainnet with proper endpoints

3

Understand Authentication

Call /api/info/auth to grasp x402 signature-based payment verification

4

Implement Rate Limits

Call /api/info/limits to build rate-limit-aware retry logic

5

Preview Costs

Query /api/pricing to display deployment costs before requesting payment

6

Deploy with x402 Payments

Use MCP tools or REST endpoints to deploy files with signed wallet transactions

Best Practices

Key guidelines for building reliable integrations against the Glashaus API.

Caching

Cache /api/info* responses for 1+ hours — they rarely change. Never cache pricing or wallet balances; these change per request and per transaction.

Error Handling

Respect HTTP 429 Retry-After headers. Use exponential backoff (1s, 2s, 4s, 8s, max 60s). Handle 402 by signing the challenge and 403 by re-reading it.

Security

Validate all signatures to prevent replay attacks. Check wallet approval before payment. Verify USDC balance and store private keys encrypted — never in environment variables.