Developer Resources

MFM API Docs

Use the route /docs to browse API documentation for the existing FastAPI service.

Quick start

  1. Create an API key via API Portal.
  2. Call endpoints under /v1 with Authorization: Bearer <api_key>.
  3. Use GET /v1/contracts to read machine-readable endpoint metadata.

Contract status

Title: MFM Agent API

API version: 1.0.0

OpenAPI version: 3.1.0

Generated: 3/2/2026, 8:08:57 AM

Endpoint catalog

MethodPathSummaryDescription
GET/v1/episodesList Episodes
GET/v1/episodes/{episode_id}Get Episode
GET/v1/episodes/{episode_id}/insightsList Episode Insights
GET/v1/episodes/{episode_id}/peopleList Episode People
GET/v1/episodes/{episode_id}/segmentsList Episode Segments
GET/v1/healthV1 Health Check
GET/v1/insightsList Insights
GET/v1/insights/{insight_id}Get Insight
GET/v1/insights/{insight_id}/relatedGet Related Insights
GET/v1/peopleList People
GET/v1/people/{person_id}Get Person
GET/v1/segments/{segment_id}Get Segment
GET/v1/segments/mfmGet Mfm Segment

Reference

The markdown spec below is derived from the current API implementation and includes usage notes for authentication, pagination, and rate limits.

MFM API v1

Auth Model

  1. Sign in to the API Portal (Supabase authentication) and complete email verification.
  2. Create an API key with POST /v1/auth/api-keys using Authorization: Bearer <supabase_access_token>.
  3. Use the returned API key for API calls:
    • Authorization: Bearer mfm_live_...

Email verification is required before creating API keys.

Core Resources

  • GET /v1/episodes
  • GET /v1/episodes/{episode_id}
  • GET /v1/episodes/{episode_id}/segments
  • GET /v1/episodes/{episode_id}/insights
  • GET /v1/episodes/{episode_id}/people
  • GET /v1/insights
  • GET /v1/insights/{insight_id}
  • GET /v1/insights/{insight_id}/related
  • GET /v1/people
  • GET /v1/people/{person_id}
  • GET /v1/segments/{segment_id}
  • GET /v1/segments/mfm

Machine-Readable Contracts

  • GET /v1/contracts

This endpoint returns a discoverable contract payload for automation clients, including endpoint metadata and OpenAPI version.

Cursor Pagination

List endpoints are iterator-friendly with opaque page tokens.

  • GET /v1/people?limit=50&page_token=<token>
  • GET /v1/episodes?limit=50&page_token=<token>
  • GET /v1/insights?limit=50&page_token=<token>

The limit parameter controls page size. If another page is available, the response includes:

  • next_page_token in the JSON payload
  • X-Next-Page-Token response header

Example successful page response:

{
  "items": [],
  "next_page_token": "MTA=",
  "total_count": 125
}

Markdown Mode

All core GET routes accept markdown output:

  • Query param: ?format=markdown
  • Header: Accept: text/markdown

This mode is intended for agent workflows that prefer LLM-friendly output.

Rate Limits

Rate limits are applied per API key.

  • Default per-minute and per-day limits are set at key creation.

Telemetry Headers

Automations should read quota headers for robust retries:

  • X-RateLimit-Limit-Minute
  • X-RateLimit-Remaining-Minute
  • X-RateLimit-Limit-Day
  • X-RateLimit-Remaining-Day
  • Retry-After (present on 429 responses)
  • X-Request-ID

Request Tracing

Every response includes X-Request-ID.

Server logs are structured JSON and include:

  • request ID
  • path + path template
  • status code
  • duration
  • auth context