{
  "service": "Virga API",
  "description": "Agent-first Weather API with autonomous onboarding, prepaid credits, and normalized weather data from OpenWeatherMap.",
  "baseUrl": "https://api.virga.dev",
  "openapi": "/openapi.json",
  "llmDocs": "/llms.txt",
  "humanDocs": "/docs",
  "onboarding": {
    "description": "Fully autonomous — no human intervention required.",
    "steps": [
      {
        "step": 1,
        "action": "POST /api/v1/accounts",
        "body": {
          "name": "your-agent-name"
        },
        "description": "Create account. Returns a stage API key (sk_virga_stage_...) for testing."
      },
      {
        "step": 2,
        "action": "GET /api/v1/terms",
        "description": "Read current terms of service."
      },
      {
        "step": 3,
        "action": "POST /api/v1/terms/accept",
        "body": {
          "version": "1.0"
        },
        "description": "Accept terms by sending the version string."
      },
      {
        "step": 4,
        "action": "POST /api/v1/billing/activate",
        "description": "Set up payment method via Stripe Checkout. Returns a checkout URL."
      },
      {
        "step": 5,
        "action": "POST /api/v1/billing/credits",
        "body": {
          "bundle": 500
        },
        "description": "Purchase a credit bundle (500, 2000, or 10000 credits). Returns a checkout URL."
      },
      {
        "step": 6,
        "action": "POST /api/v1/keys",
        "description": "Create a production API key (sk_virga_prod_...). Requires terms + billing + credits."
      },
      {
        "step": 7,
        "action": "GET /api/v1/weather/current?lat=51.5&lon=-0.12",
        "description": "Query weather data using the production key."
      }
    ]
  },
  "auth": {
    "method": "API key in X-API-Key header or ?api_key= query parameter",
    "keyPrefixes": {
      "stage": "sk_virga_stage_",
      "production": "sk_virga_prod_"
    }
  },
  "environments": {
    "stage": {
      "rateLimit": "10 req/min",
      "dailyQuota": 500,
      "creditCost": 0,
      "cacheTTL": "15 min"
    },
    "production": {
      "rateLimit": "60 req/min",
      "dailyQuota": 10000,
      "cacheTTL": "5 min"
    }
  },
  "creditCosts": {
    "/weather/current": 1,
    "/weather/forecast/hourly": 2,
    "/weather/forecast/daily": 2,
    "/weather/historical": 3,
    "/weather/batch": "sum of individual"
  },
  "creditBundles": [
    {
      "credits": 500,
      "price": "$5"
    },
    {
      "credits": 2000,
      "price": "$18"
    },
    {
      "credits": 10000,
      "price": "$75"
    }
  ]
}