{
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "description": "API key (prefix gf_) created in Dashboard → API Keys.",
        "in": "header",
        "name": "X-API-Key",
        "type": "apiKey"
      },
      "SessionBearer": {
        "bearerFormat": "JWT",
        "description": "Web session token issued to the browser at sign-in. It is not part of the public API and cannot be created from an API key; an API key sent to an operation that requires it receives 401.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "externalDocs": {
    "description": "API documentation",
    "url": "https://gatiflow.io/api-docs"
  },
  "info": {
    "contact": {
      "email": "support@gatiflow.io",
      "name": "GatiFlow Support",
      "url": "https://gatiflow.io/api-docs"
    },
    "description": "Customer-facing GatiFlow Intelligence API. Authenticate with an API key in the `X-API-Key` header.\n\nRate limits and daily quotas are per plan. `GET /api/v1/intelligence/report`, `GET /api/v1/intelligence/report/export` return both `X-RateLimit-*` and `X-DailyQuota-*` response headers. `GET /api/v1/intelligence/report-history`, `GET /api/v1/intelligence/report/at/{snapshot_id}` return `X-RateLimit-*` alone: they are rate limited and consume no quota. The remaining operations are metered without reporting a header, so read the figures from `GET /api/v1/usage` or from the plan. The operation that takes no credential is capped per caller address instead, and states its own ceiling.\n\n## What people use it for\n\n**You own an API and want to know what your sector is doing** -- `GET /api/v1/intelligence/report` returns the week filtered to the topics on your organization profile, and its `trend_analysis` block carries the movement (`velocity`, `spikes`, `emerging`, `declining`) instead of a feed you have to read. A daily call is enough: rather than serve intelligence older than 24 hours the endpoint returns 503 with `Retry-After`.\n\n**You built the product and marketing is the part you are worst at** -- `sections.market_trends` and the `emerging` list in `GET /api/v1/intelligence/report` name the topics your buyers are already reading about, so a post has a subject before it has a deadline. `GET /api/v1/public/deep-dive` returns the preview of the current long-form article with no API key, so you can see the treatment before you pay for it.\n\n**You want the signals inside the tools your team already uses** -- `GET /api/v1/intelligence/report/export` returns the same report as a file for a warehouse load or a weekly deck: CSV on Pro, CSV or PDF on Business. `GET /api/v1/intelligence/report-history` and `GET /api/v1/intelligence/report/at/{snapshot_id}` walk the snapshots your plan retains, so a dashboard starts with history instead of one row, and `GET /api/v1/usage` shows every call a scheduled job made without a second log.",
    "license": {
      "name": "Proprietary",
      "url": "https://gatiflow.io/terms"
    },
    "termsOfService": "https://gatiflow.io/terms",
    "title": "GatiFlow SaaS API — Public API",
    "version": "2.2.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v1/intelligence/report": {
      "get": {
        "description": "Runs a report for the calling organization over the most recent collection cycle and returns it as JSON. Every signal carries its sources, a mention count and a confidence score, and on plans that include evidence, the raw evidence behind that count.\n\nSignal caps per plan: Starter 15, Pro 40, Business 100. An expired trial falls back to a watermarked 3-signal preview with confidence and evidence removed.\n\nResults are filtered to the topics configured on the organization profile. A successful call consumes one unit of the daily quota; a failed generation refunds it. If the underlying data is older than 24 hours the endpoint returns 503 with a Retry-After header rather than serving stale intelligence.\n\nThe schema_version query parameter selects the shape of the contract block, not the version of the payload: 1.1 and 1.2 both return the full contract with capabilities and limits, while the default 1.0 returns the compact one. The response reports the schema it actually is, at the top level and inside the contract, and the two always agree.",
        "operationId": "report_api_v1_intelligence_report_get",
        "parameters": [
          {
            "in": "query",
            "name": "schema_version",
            "required": false,
            "schema": {
              "default": "1.0",
              "pattern": "^(1\\.0|1\\.1|1\\.2)$",
              "title": "Schema Version",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "pro": {
                    "description": "Same shape as Starter with the Pro caps: up to 40 signals and CSV export.",
                    "summary": "Pro plan, full contract (schema 1.2)",
                    "value": {
                      "analytics": {
                        "market_overview": {
                          "average_score": 0.82,
                          "top_score": 0.82,
                          "total_profiles_analyzed": 1
                        },
                        "role_distribution": {
                          "Senior Backend": 1
                        },
                        "seniority_distribution": {
                          "senior": 1
                        },
                        "seniority_levels": [
                          "senior"
                        ],
                        "stack_distribution": {
                          "rust": 1
                        },
                        "strategic_insights": []
                      },
                      "client_info": {
                        "client_name": "Acme Capital",
                        "daily_limit": 100,
                        "org_name": "Acme Capital",
                        "plan": "Pro",
                        "subscription_status": "active",
                        "used_today": 3
                      },
                      "contract": {
                        "capabilities": {
                          "exports": [
                            "csv"
                          ],
                          "org_briefing": false,
                          "show_confidence": true,
                          "show_evidence": true
                        },
                        "limits": {
                          "max_signals": 40,
                          "max_talents": 30,
                          "max_trends": 40
                        },
                        "plan_level": "Pro",
                        "report_type": "Market & Talent Intelligence",
                        "schema_version": "1.2"
                      },
                      "generated_at": "2026-09-03T06:00:11.482913+00:00",
                      "metadata": {
                        "ai_generated": {
                          "applies_to": [
                            "executive_summary.narrative"
                          ],
                          "model": "Anthropic Claude (Sonnet)",
                          "purpose": "Convert structured signals into human-readable narrative; numeric claims fact-checked."
                        },
                        "confidentiality": "B2B Internal / Client Use",
                        "generated_at": "2026-09-03T06:00:11.482913+00:00",
                        "product": "GatiFlow Intelligence",
                        "report_version": "1.2"
                      },
                      "org_id": "3f2a9c14-0b7e-4d21-9a56-8c1d4e7b0f33",
                      "plan": "pro",
                      "schema_version": "1.2",
                      "score": {
                        "overall_confidence": 0.86,
                        "signal_count": 38
                      },
                      "sections": {
                        "executive_summary": {
                          "narrative": "",
                          "overall_confidence": 0.86,
                          "summary": "Full analysis of 38 signals from 9 of 11 sources. Top topics: rust, inference, postgres.",
                          "title": "Market & Talent Intelligence Overview"
                        },
                        "hiring_signals": {
                          "count": 1,
                          "data": [
                            {
                              "category": "hiring_signal",
                              "confidence": 0.77,
                              "detail": "Backend openings up week over week",
                              "evidence": {
                                "company_size": "50-200",
                                "trend": "expanding"
                              },
                              "source": "hiring",
                              "timestamp": "2026-09-03T06:00:11.482913+00:00",
                              "title": "Series B infrastructure hiring"
                            }
                          ],
                          "title": "Hiring & Opportunity Signals"
                        },
                        "market_trends": {
                          "count": 1,
                          "data": [
                            {
                              "category": "market_trend",
                              "confidence": 0.91,
                              "detail": "Strength: high | Mentions: 16",
                              "evidence": {
                                "mentions": 16,
                                "metric": "mentions",
                                "sources": [
                                  "hackernews",
                                  "arxiv"
                                ],
                                "title": "rust"
                              },
                              "source": "hackernews,arxiv",
                              "timestamp": "2026-09-03T06:00:11.482913+00:00",
                              "title": "rust",
                              "url": "https://news.ycombinator.com/item?id=41234567"
                            }
                          ],
                          "title": "Market Intelligence Signals"
                        },
                        "talent_signals": {
                          "count": 1,
                          "data": [
                            {
                              "category": "talent",
                              "confidence": 0.82,
                              "detail": "Senior Rust engineer, 8 public repositories this quarter",
                              "evidence": {
                                "role": "Senior Backend",
                                "seniority": "senior",
                                "stack": [
                                  "rust"
                                ]
                              },
                              "source": "github",
                              "timestamp": "2026-09-03T06:00:11.482913+00:00",
                              "title": "@octodev",
                              "url": "https://github.com/octodev"
                            }
                          ],
                          "title": "Talent Intelligence Signals"
                        }
                      },
                      "trend_analysis": {
                        "analysis_timestamp": "2026-09-03T06:00:11.482913+00:00",
                        "declining": [],
                        "emerging": [],
                        "engine": "v3",
                        "hot_memory": {},
                        "silent_but_rising": [],
                        "snapshot_count": 27,
                        "spikes": [],
                        "status": "ok",
                        "summary": "Fastest growing: rust (+42.9% vs previous period)",
                        "tracking_stats": {
                          "longest_tracked_days": 14,
                          "signals_current": 38,
                          "signals_tracked_7d": 12
                        },
                        "velocity": [
                          {
                            "baseline_metric": 11.2,
                            "category": "market_trend",
                            "change_pct": 42.9,
                            "current_confidence": 0.91,
                            "current_mentions": 16,
                            "current_metric": 16.0,
                            "current_sources": 2,
                            "metric_kind": "mentions",
                            "metric_trend": "rising",
                            "presence": "active",
                            "sources_list": [
                              "arxiv",
                              "hackernews"
                            ],
                            "status": "tracked",
                            "topic": "rust",
                            "tracked_days": 9
                          }
                        ],
                        "weeks_of_data": 2
                      }
                    }
                  },
                  "starter": {
                    "description": "Evidence and confidence are present. Signals are capped at 15 and exports are not available.",
                    "summary": "Starter plan, full contract (schema 1.2)",
                    "value": {
                      "analytics": {
                        "market_overview": {
                          "average_score": 0.82,
                          "top_score": 0.82,
                          "total_profiles_analyzed": 1
                        },
                        "role_distribution": {
                          "Senior Backend": 1
                        },
                        "seniority_distribution": {
                          "senior": 1
                        },
                        "seniority_levels": [
                          "senior"
                        ],
                        "stack_distribution": {
                          "rust": 1
                        },
                        "strategic_insights": []
                      },
                      "client_info": {
                        "client_name": "Acme Capital",
                        "daily_limit": 100,
                        "org_name": "Acme Capital",
                        "plan": "Starter",
                        "subscription_status": "active",
                        "used_today": 3
                      },
                      "contract": {
                        "capabilities": {
                          "exports": [],
                          "org_briefing": false,
                          "show_confidence": true,
                          "show_evidence": true
                        },
                        "limits": {
                          "max_signals": 15,
                          "max_talents": 8,
                          "max_trends": 15
                        },
                        "plan_level": "Starter",
                        "report_type": "Market & Talent Intelligence",
                        "schema_version": "1.2"
                      },
                      "generated_at": "2026-09-03T06:00:11.482913+00:00",
                      "metadata": {
                        "ai_generated": {
                          "applies_to": [
                            "executive_summary.narrative"
                          ],
                          "model": "Anthropic Claude (Sonnet)",
                          "purpose": "Convert structured signals into human-readable narrative; numeric claims fact-checked."
                        },
                        "confidentiality": "B2B Internal / Client Use",
                        "generated_at": "2026-09-03T06:00:11.482913+00:00",
                        "product": "GatiFlow Intelligence",
                        "report_version": "1.2"
                      },
                      "org_id": "3f2a9c14-0b7e-4d21-9a56-8c1d4e7b0f33",
                      "plan": "starter",
                      "schema_version": "1.2",
                      "score": {
                        "overall_confidence": 0.86,
                        "signal_count": 38
                      },
                      "sections": {
                        "executive_summary": {
                          "narrative": "",
                          "overall_confidence": 0.86,
                          "summary": "Full analysis of 38 signals from 9 of 11 sources. Top topics: rust, inference, postgres.",
                          "title": "Market & Talent Intelligence Overview"
                        },
                        "hiring_signals": {
                          "count": 1,
                          "data": [
                            {
                              "category": "hiring_signal",
                              "confidence": 0.77,
                              "detail": "Backend openings up week over week",
                              "evidence": {
                                "company_size": "50-200",
                                "trend": "expanding"
                              },
                              "source": "hiring",
                              "timestamp": "2026-09-03T06:00:11.482913+00:00",
                              "title": "Series B infrastructure hiring"
                            }
                          ],
                          "title": "Hiring & Opportunity Signals"
                        },
                        "market_trends": {
                          "count": 1,
                          "data": [
                            {
                              "category": "market_trend",
                              "confidence": 0.91,
                              "detail": "Strength: high | Mentions: 16",
                              "evidence": {
                                "mentions": 16,
                                "metric": "mentions",
                                "sources": [
                                  "hackernews",
                                  "arxiv"
                                ],
                                "title": "rust"
                              },
                              "source": "hackernews,arxiv",
                              "timestamp": "2026-09-03T06:00:11.482913+00:00",
                              "title": "rust",
                              "url": "https://news.ycombinator.com/item?id=41234567"
                            }
                          ],
                          "title": "Market Intelligence Signals"
                        },
                        "talent_signals": {
                          "count": 1,
                          "data": [
                            {
                              "category": "talent",
                              "confidence": 0.82,
                              "detail": "Senior Rust engineer, 8 public repositories this quarter",
                              "evidence": {
                                "role": "Senior Backend",
                                "seniority": "senior",
                                "stack": [
                                  "rust"
                                ]
                              },
                              "source": "github",
                              "timestamp": "2026-09-03T06:00:11.482913+00:00",
                              "title": "@octodev",
                              "url": "https://github.com/octodev"
                            }
                          ],
                          "title": "Talent Intelligence Signals"
                        }
                      },
                      "trend_analysis": {
                        "analysis_timestamp": "2026-09-03T06:00:11.482913+00:00",
                        "declining": [],
                        "emerging": [],
                        "engine": "v3",
                        "hot_memory": {},
                        "silent_but_rising": [],
                        "snapshot_count": 27,
                        "spikes": [],
                        "status": "ok",
                        "summary": "Fastest growing: rust (+42.9% vs previous period)",
                        "tracking_stats": {
                          "longest_tracked_days": 14,
                          "signals_current": 38,
                          "signals_tracked_7d": 12
                        },
                        "velocity": [
                          {
                            "baseline_metric": 11.2,
                            "category": "market_trend",
                            "change_pct": 42.9,
                            "current_confidence": 0.91,
                            "current_mentions": 16,
                            "current_metric": 16.0,
                            "current_sources": 2,
                            "metric_kind": "mentions",
                            "metric_trend": "rising",
                            "presence": "active",
                            "sources_list": [
                              "arxiv",
                              "hackernews"
                            ],
                            "status": "tracked",
                            "topic": "rust",
                            "tracked_days": 9
                          }
                        ],
                        "weeks_of_data": 2
                      }
                    }
                  }
                },
                "schema": {}
              }
            },
            "description": "Intelligence report for the calling organization."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Generate an intelligence report",
        "tags": [
          "intelligence"
        ]
      }
    },
    "/api/v1/intelligence/report-history": {
      "get": {
        "description": "Lists the report snapshots retained for this organization, newest first. Snapshots are written by the collection cycle, not by report calls, so this list reflects what was actually collected. Each entry carries a snapshot_id in the YYYYMMDDTHHmm format, which is what GET /intelligence/report/at/{snapshot_id} expects.\n\nRetention follows the plan: Starter keeps 7 days, Pro keeps 90 days, Business keeps 365 days. An expired trial retains nothing and receives an empty list.\n\nThis endpoint returns metadata only and does not consume daily quota, but it does count against the plan per-minute rate limit.",
        "operationId": "report_history_list_api_v1_intelligence_report_history_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 50,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "empty": {
                    "description": "Returned for an expired trial, which retains nothing.",
                    "summary": "No retained snapshots",
                    "value": {
                      "count": 0,
                      "plan": "free",
                      "retention_days": 0,
                      "snapshots": []
                    }
                  },
                  "pro": {
                    "summary": "Two snapshots on a Pro key",
                    "value": {
                      "count": 2,
                      "plan": "pro",
                      "retention_days": 90,
                      "snapshots": [
                        {
                          "generated_at": "2026-09-03T06:00:11.482913+00:00",
                          "signal_count": 38,
                          "snapshot_id": "20260903T0600"
                        },
                        {
                          "generated_at": "2026-09-02T06:00:09.117204+00:00",
                          "signal_count": 35,
                          "snapshot_id": "20260902T0600"
                        }
                      ]
                    }
                  }
                },
                "schema": {}
              }
            },
            "description": "Snapshot metadata for this organization, newest first."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "List retained report snapshots",
        "tags": [
          "intelligence"
        ]
      }
    },
    "/api/v1/intelligence/report/at/{snapshot_id}": {
      "get": {
        "description": "Returns a report that was archived by an earlier collection cycle, in the same shape as GET /intelligence/report. Use GET /intelligence/report-history to discover the ids that exist.\n\nsnapshot_id uses the YYYYMMDDTHHmm format, for example 20260509T1225. An id in any other shape returns 400 without a lookup.\n\nAvailability follows the plan retention window: Starter keeps 7 days, Pro keeps 90 days, Business keeps 365 days. A plan with no history receives 403, and an id outside the window returns 404.\n\nReading an archived snapshot does not consume daily quota, but it does count against the plan per-minute rate limit, including requests with an invalid id.",
        "operationId": "report_at_snapshot_api_v1_intelligence_report_at__snapshot_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "snapshot_id",
            "required": true,
            "schema": {
              "title": "Snapshot Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "pro": {
                    "description": "The stored report, in the same shape GET /intelligence/report returns.",
                    "summary": "One archived snapshot",
                    "value": {
                      "analytics": {
                        "market_overview": {
                          "average_score": 0.82,
                          "top_score": 0.82,
                          "total_profiles_analyzed": 1
                        },
                        "role_distribution": {
                          "Senior Backend": 1
                        },
                        "seniority_distribution": {
                          "senior": 1
                        },
                        "seniority_levels": [
                          "senior"
                        ],
                        "stack_distribution": {
                          "rust": 1
                        },
                        "strategic_insights": []
                      },
                      "client_info": {
                        "client_name": "Acme Capital",
                        "daily_limit": 100,
                        "org_name": "Acme Capital",
                        "plan": "Pro",
                        "subscription_status": "active",
                        "used_today": 3
                      },
                      "contract": {
                        "capabilities": {
                          "exports": [
                            "csv"
                          ],
                          "org_briefing": false,
                          "show_confidence": true,
                          "show_evidence": true
                        },
                        "limits": {
                          "max_signals": 40,
                          "max_talents": 30,
                          "max_trends": 40
                        },
                        "plan_level": "Pro",
                        "report_type": "Market & Talent Intelligence",
                        "schema_version": "1.2"
                      },
                      "generated_at": "2026-09-03T06:00:11.482913+00:00",
                      "metadata": {
                        "ai_generated": {
                          "applies_to": [
                            "executive_summary.narrative"
                          ],
                          "model": "Anthropic Claude (Sonnet)",
                          "purpose": "Convert structured signals into human-readable narrative; numeric claims fact-checked."
                        },
                        "confidentiality": "B2B Internal / Client Use",
                        "generated_at": "2026-09-03T06:00:11.482913+00:00",
                        "product": "GatiFlow Intelligence",
                        "report_version": "1.2"
                      },
                      "org_id": "3f2a9c14-0b7e-4d21-9a56-8c1d4e7b0f33",
                      "plan": "pro",
                      "schema_version": "1.2",
                      "score": {
                        "overall_confidence": 0.86,
                        "signal_count": 38
                      },
                      "sections": {
                        "executive_summary": {
                          "narrative": "",
                          "overall_confidence": 0.86,
                          "summary": "Full analysis of 38 signals from 9 of 11 sources. Top topics: rust, inference, postgres.",
                          "title": "Market & Talent Intelligence Overview"
                        },
                        "hiring_signals": {
                          "count": 1,
                          "data": [
                            {
                              "category": "hiring_signal",
                              "confidence": 0.77,
                              "detail": "Backend openings up week over week",
                              "evidence": {
                                "company_size": "50-200",
                                "trend": "expanding"
                              },
                              "source": "hiring",
                              "timestamp": "2026-09-03T06:00:11.482913+00:00",
                              "title": "Series B infrastructure hiring"
                            }
                          ],
                          "title": "Hiring & Opportunity Signals"
                        },
                        "market_trends": {
                          "count": 1,
                          "data": [
                            {
                              "category": "market_trend",
                              "confidence": 0.91,
                              "detail": "Strength: high | Mentions: 16",
                              "evidence": {
                                "mentions": 16,
                                "metric": "mentions",
                                "sources": [
                                  "hackernews",
                                  "arxiv"
                                ],
                                "title": "rust"
                              },
                              "source": "hackernews,arxiv",
                              "timestamp": "2026-09-03T06:00:11.482913+00:00",
                              "title": "rust",
                              "url": "https://news.ycombinator.com/item?id=41234567"
                            }
                          ],
                          "title": "Market Intelligence Signals"
                        },
                        "talent_signals": {
                          "count": 1,
                          "data": [
                            {
                              "category": "talent",
                              "confidence": 0.82,
                              "detail": "Senior Rust engineer, 8 public repositories this quarter",
                              "evidence": {
                                "role": "Senior Backend",
                                "seniority": "senior",
                                "stack": [
                                  "rust"
                                ]
                              },
                              "source": "github",
                              "timestamp": "2026-09-03T06:00:11.482913+00:00",
                              "title": "@octodev",
                              "url": "https://github.com/octodev"
                            }
                          ],
                          "title": "Talent Intelligence Signals"
                        }
                      },
                      "trend_analysis": {
                        "analysis_timestamp": "2026-09-03T06:00:11.482913+00:00",
                        "declining": [],
                        "emerging": [],
                        "engine": "v3",
                        "hot_memory": {},
                        "silent_but_rising": [],
                        "snapshot_count": 27,
                        "spikes": [],
                        "status": "ok",
                        "summary": "Fastest growing: rust (+42.9% vs previous period)",
                        "tracking_stats": {
                          "longest_tracked_days": 14,
                          "signals_current": 38,
                          "signals_tracked_7d": 12
                        },
                        "velocity": [
                          {
                            "baseline_metric": 11.2,
                            "category": "market_trend",
                            "change_pct": 42.9,
                            "current_confidence": 0.91,
                            "current_mentions": 16,
                            "current_metric": 16.0,
                            "current_sources": 2,
                            "metric_kind": "mentions",
                            "metric_trend": "rising",
                            "presence": "active",
                            "sources_list": [
                              "arxiv",
                              "hackernews"
                            ],
                            "status": "tracked",
                            "topic": "rust",
                            "tracked_days": 9
                          }
                        ],
                        "weeks_of_data": 2
                      }
                    }
                  }
                },
                "schema": {}
              }
            },
            "description": "The archived report for the requested snapshot_id."
          },
          "400": {
            "description": "snapshot_id is not in the YYYYMMDDTHHmm format."
          },
          "403": {
            "description": "The plan does not retain history."
          },
          "404": {
            "description": "No snapshot with that id inside the plan retention window."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Retrieve an archived report snapshot",
        "tags": [
          "intelligence"
        ]
      }
    },
    "/api/v1/intelligence/report/export": {
      "get": {
        "description": "Returns the same report as GET /intelligence/report, serialized to a downloadable file instead of JSON. The response body is the file itself, with a Content-Disposition attachment header and a dated filename.\n\nExport formats follow the plan: Starter has none and receives 403, Pro can export CSV, Business can export CSV and PDF.\n\nA successful export consumes one unit of the daily quota, the same as a report call. If the underlying data is older than 24 hours the endpoint returns 503 with a Retry-After header.",
        "operationId": "export_report_api_v1_intelligence_report_export_get",
        "parameters": [
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "default": "csv",
              "pattern": "^(csv|pdf)$",
              "title": "Format",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "text/csv": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The report as a file attachment. Content-Type follows the requested format."
          },
          "403": {
            "description": "The plan does not include the requested export format."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Export the report as a file",
        "tags": [
          "intelligence"
        ]
      }
    },
    "/api/v1/public/deep-dive": {
      "get": {
        "description": "Returns the opening preview of the most recent Deep Dive article, plus its topic, title, word count and publication date. No authentication is required.\n\nThe full text is not served here. It stays behind authentication on the Deep Dive product page and is included with Starter, Pro and Business.\n\nDeep Dive articles are written by a language model from the collected signals, which the response declares. When nothing has been published yet the endpoint returns 200 with status set to no_article rather than an error.\n\nBecause the operation takes no credential there is no key to meter, so the ceiling is per caller address: 60 requests a minute, above which the endpoint returns 429. The article changes once a week, so a caller that polls has nothing to gain from a shorter interval.",
        "operationId": "get_latest_deep_dive_api_v1_public_deep_dive_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "none_yet": {
                    "summary": "Nothing published yet",
                    "value": {
                      "message": "No deep dive available yet. Check back Saturday morning.",
                      "status": "no_article"
                    }
                  },
                  "published": {
                    "summary": "An article is published",
                    "value": {
                      "full_article_available": true,
                      "id": "9d41f0a2-6c58-4c9e-8a3b-27d5e1b40f6a",
                      "preview": "The first two paragraphs of the article, in plain text.",
                      "published_at": "2026-08-30T09:00:00+00:00",
                      "status": "ok",
                      "title": "What Falling Inference Prices Did To The Infrastructure Layer",
                      "topic": "inference cost",
                      "upgrade_message": "Subscribe to Starter, Pro, or Business to read the full article.",
                      "word_count": 1834
                    }
                  }
                },
                "schema": {}
              }
            },
            "description": "Preview of the most recent Deep Dive article."
          },
          "429": {
            "description": "Too many requests from this address. This operation takes no credential, so the ceiling is per caller address: 60 requests a minute."
          }
        },
        "security": [],
        "summary": "Get the latest Deep Dive preview",
        "tags": [
          "public"
        ]
      }
    },
    "/api/v1/public/weekly-report": {
      "get": {
        "description": "Returns the shared Daily Insights report: the curated view of the latest collection cycle that backs the Insights page. Sections carry the same signal shape as the intelligence report, with sources, counts and confidence, and the evidence attached.\n\nThe payload is shaped to the caller plan. Pro and Business receive it whole. Starter receives the same report with per-signal velocity removed and section counts re-applied at the Starter caps. A paid or trialing plan is required; an expired trial receives 402.\n\nPass date as YYYY-MM-DD to read an archived day instead of the current one. An unknown date returns 404 and a malformed one returns 400.",
        "operationId": "weekly_report_api_v1_public_weekly_report_get",
        "parameters": [
          {
            "in": "query",
            "name": "date",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "pro": {
                    "summary": "Current day, Pro key",
                    "value": {
                      "analytics": {
                        "market_overview": {
                          "average_score": 0.82,
                          "top_score": 0.82,
                          "total_profiles_analyzed": 1
                        },
                        "role_distribution": {
                          "Senior Backend": 1
                        },
                        "seniority_distribution": {
                          "senior": 1
                        },
                        "seniority_levels": [
                          "senior"
                        ],
                        "stack_distribution": {
                          "rust": 1
                        },
                        "strategic_insights": []
                      },
                      "cta": {
                        "api_docs": "https://api.gatiflow.io/docs",
                        "message": "Get full reports with evidence, exports, and custom topics via API.",
                        "signup_url": "https://gatiflow.io/register"
                      },
                      "generated_at": "2026-09-03T06:00:11.482913+00:00",
                      "metadata": {
                        "data_sources": "up to 11",
                        "product": "GatiFlow Intelligence",
                        "report_type": "Daily Insights",
                        "update_frequency": "Every 6 hours"
                      },
                      "score": {
                        "overall_confidence": 0.86,
                        "signal_count": 38
                      },
                      "sections": {
                        "executive_summary": {
                          "narrative": "",
                          "overall_confidence": 0.86,
                          "summary": "Full analysis of 38 signals from 9 of 11 sources. Top topics: rust, inference, postgres.",
                          "title": "Market & Talent Intelligence Overview"
                        },
                        "hiring_signals": {
                          "count": 1,
                          "data": [
                            {
                              "category": "hiring_signal",
                              "confidence": 0.77,
                              "detail": "Backend openings up week over week",
                              "evidence": {
                                "company_size": "50-200",
                                "trend": "expanding"
                              },
                              "source": "hiring",
                              "timestamp": "2026-09-03T06:00:11.482913+00:00",
                              "title": "Series B infrastructure hiring"
                            }
                          ],
                          "title": "Hiring & Opportunity Signals"
                        },
                        "market_trends": {
                          "count": 1,
                          "data": [
                            {
                              "category": "market_trend",
                              "confidence": 0.91,
                              "detail": "Strength: high | Mentions: 16",
                              "evidence": {
                                "mentions": 16,
                                "metric": "mentions",
                                "sources": [
                                  "hackernews",
                                  "arxiv"
                                ],
                                "title": "rust"
                              },
                              "source": "hackernews,arxiv",
                              "timestamp": "2026-09-03T06:00:11.482913+00:00",
                              "title": "rust",
                              "url": "https://news.ycombinator.com/item?id=41234567"
                            }
                          ],
                          "title": "Market Intelligence Signals"
                        },
                        "talent_signals": {
                          "count": 1,
                          "data": [
                            {
                              "category": "talent",
                              "confidence": 0.82,
                              "detail": "Senior Rust engineer, 8 public repositories this quarter",
                              "evidence": {
                                "role": "Senior Backend",
                                "seniority": "senior",
                                "stack": [
                                  "rust"
                                ]
                              },
                              "source": "github",
                              "timestamp": "2026-09-03T06:00:11.482913+00:00",
                              "title": "@octodev",
                              "url": "https://github.com/octodev"
                            }
                          ],
                          "title": "Talent Intelligence Signals"
                        }
                      },
                      "subtitle": "The day's intelligence, distilled from the latest collection cycle.",
                      "title": "GatiFlow Daily Insights — Sep 03, 2026",
                      "week_of": "September 03, 2026"
                    }
                  }
                },
                "schema": {}
              }
            },
            "description": "Daily Insights payload, shaped to the caller's plan."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "SessionBearer": []
          }
        ],
        "summary": "Get the Daily Insights payload",
        "tags": [
          "public"
        ]
      }
    },
    "/api/v1/usage": {
      "get": {
        "description": "Returns the request log for the API key used on this call: the endpoint, the HTTP status and the timestamp of each call, newest first, together with the organization name.\n\nThe scope is the key, not the organization. An organization holding several keys sees only the activity of the key that authenticated the request, so rotating a key starts a fresh log rather than continuing the old one.\n\nPass limit to change how many events come back. The default is 100 and the endpoint never returns more than 500, whatever is requested. Reading this log does not consume daily quota.",
        "operationId": "get_my_usage_api_v1_usage_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-API-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "no_calls": {
                    "summary": "A key that has not been used yet",
                    "value": {
                      "org_name": "Acme Capital",
                      "total_returned": 0,
                      "usage": []
                    }
                  },
                  "recent": {
                    "summary": "The last few calls made with this key",
                    "value": {
                      "org_name": "Acme Capital",
                      "total_returned": 3,
                      "usage": [
                        {
                          "endpoint": "/intelligence/report",
                          "status_code": 200,
                          "timestamp": "2026-09-03T06:00:11.482913+00:00"
                        },
                        {
                          "endpoint": "/intelligence/report/export?format=csv",
                          "status_code": 200,
                          "timestamp": "2026-09-03T05:58:02.194771+00:00"
                        },
                        {
                          "endpoint": "/intelligence/report",
                          "status_code": 429,
                          "timestamp": "2026-09-03T05:57:41.008320+00:00"
                        }
                      ]
                    }
                  }
                },
                "schema": {}
              }
            },
            "description": "Recent calls made with the API key used on this request."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "List recent calls made with this API key",
        "tags": [
          "usage"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Production",
      "url": "https://api.gatiflow.io"
    }
  ]
}
