# CalendarICS Edge API (v1.0.0)

> Generate Outlook/Google/Apple-proof RFC 5545 .ics invites, VTIMEZONE blocks, and calendar deep links in <5ms.

Deterministic RFC 5545 / iTIP .ics invite compiler with 75-octet UTF-8 safe line folding, IANA VTIMEZONE synthesis, multi-client Add-to-Calendar deep links, and .ics auto-repair linting.

## Why Agents Use This API Instead of DIY
LLM-generated .ics strings routinely fail in Outlook and Apple Calendar due to LF-only line breaks, >75-octet UTF-8 emoji corruption, and missing VTIMEZONE definitions. One $0.001 call guarantees byte-accurate RFC 5545 compliance.

## Connection & Payment (x402 Default + Optional Bearer API Key)
- **MCP Server (Streamable HTTP):** `https://calendar-ics.apikeg.com/mcp` (Registry ID: `com.apikeg/calendar-ics` — `initialize`, `tools/list`, `resources/*`, and `prompts/*` are free)
- **OpenAPI 3.1 Spec:** [openapi.json](https://calendar-ics.apikeg.com/openapi.json)
- **Full Schema & Examples:** [llms-full.txt](https://calendar-ics.apikeg.com/llms-full.txt)
- **RFC 9727 API Catalog:** [.well-known/api-catalog](https://calendar-ics.apikeg.com/.well-known/api-catalog)
- **x402 Bazaar Manifest:** [.well-known/x402.json](https://calendar-ics.apikeg.com/.well-known/x402.json)
- **MCP Discovery Manifest:** [.well-known/mcp.json](https://calendar-ics.apikeg.com/.well-known/mcp.json)
- **A2A Agent Card:** [.well-known/agent-card.json](https://calendar-ics.apikeg.com/.well-known/agent-card.json)
- **Primary Payment (Zero Signup):** Cloudflare Monetization Gateway (`HTTP 402` / `x402` v2 with USDC on Base).
- **Optional Monthly API Key:** Pass `Authorization: Bearer ak_live_...` ($5 / $20 / $50 monthly per-product Stripe plans at [apikeg.com/account](https://apikeg.com/account)).
- **Free Preflight:** Append `?dry_run=true` (or header `X-Dry-Run: true`) to validate any request payload at `$0.00` cost.

## Tools & REST Endpoints
- [`generate_calendar_invite`](https://calendar-ics.apikeg.com/tools/generate-calendar-invite.md) (`POST https://calendar-ics.apikeg.com/v1/generate-calendar-invite`) — $0.001 USD per generated .ics invite + deep-link bundle (x402 instant micropayment): Compiles a strict RFC 5545 / RFC 5546 .ics invite (PUBLISH, REQUEST with RSVP attendees, or CANCEL) with UTF-8 code-point-safe 75-octet CRLF folding, IANA VTIMEZONE blocks, and Google/Outlook/Yahoo/data-URI calendar links.
- [`validate_ics_payload`](https://calendar-ics.apikeg.com/tools/validate-ics-payload.md) (`POST https://calendar-ics.apikeg.com/v1/validate-ics-payload`) — $0.001 USD per .ics audit (with optional deterministic auto-repair) (x402 instant micropayment): Audits raw .ics text for RFC 5545 & iTIP defects (LF-only line breaks, >75-octet lines, missing VCALENDAR/VERSION/PRODID/UID/DTSTAMP/DTSTART, DTEND <= DTSTART, missing VTIMEZONE for TZID, METHOD:CANCEL without STATUS:CANCELLED, METHOD:REQUEST without ORGANIZER, unescaped commas/newlines) and optionally returns a deterministically repaired .ics string.

## Instant MCP Configuration
```json
{
  "mcpServers": {
    "calendar-ics": {
      "type": "streamable-http",
      "url": "https://calendar-ics.apikeg.com/mcp"
    }
  }
}
```

## Common Agent Use Cases
- generate RFC 5545 ics calendar invite API
- create Outlook Google Calendar invite MCP tool
- IANA VTIMEZONE generator API
- validate and repair broken .ics file
- add to calendar deep link generator
