{"openapi":"3.1.0","info":{"title":"AnyPost API","version":"1.0.0","summary":"Social post to Markdown, plus Instagram last stories from a profile.","description":"Convert a public social post URL to LLM-ready Markdown. An Instagram profile, @handle, story tray, highlight, or live story id is LAST STORIES — GET /api/analyze/story, or GET /api/convert / domain-swap /instagram/{user} (same handler). ASK THE CUSTOMER what kind of images they need (e.g. planes, terminal, people, text on screen) — one short question. Then GET last stories and describe only that kind of image. No apk_ → POST /api/agent/start {\"plan\":\"pro\"}, send checkoutUrl or pay after confirm, then last stories. A profile is LAST STORIES."},"servers":[{"url":"https://anypost.md"}],"paths":{"/api/analyze/story":{"get":{"operationId":"analyzeInstagramLastStories","summary":"Analyze Instagram last stories from a profile or story URL","description":"Last stories from instagram.com/{username}/, @handle, /stories/{user}/, /stories/{user}/{id}, or /stories/highlights/{id}. ASK THE CUSTOMER what kind of images they need (e.g. planes, terminal, people, text on screen) — one short question. Then GET last stories and describe only that kind of image. Guest 402 is plan_upgrade_required with LAST STORIES + POST /api/agent/start {\"plan\":\"pro\"} + checkoutUrl / pay after confirm. This is the operation ChatGPT should call for a profile. GET /api/convert on the same URL runs this handler.","parameters":[{"name":"url","in":"query","required":true,"description":"Public Instagram profile, @handle, story tray, highlight, or live story URL (www / slash / igsh / igsi variants ok).","schema":{"type":"string","format":"uri"},"examples":{"profile":{"value":"https://www.instagram.com/bengurionairport_tlv/"},"handle":{"value":"@bengurionairport_tlv"},"highlight":{"value":"https://www.instagram.com/stories/highlights/17895695668004550/"}}},{"name":"prompt","in":"query","required":false,"description":"Optional question after the customer says what kind of images they need (max 500 chars). Alias: ask.","schema":{"type":"string","maxLength":500}},{"name":"apikey","in":"query","required":false,"description":"apk_ key. Prefer Authorization: Bearer.","schema":{"type":"string"}}],"responses":{"200":{"description":"Story analysis markdown, summary, whatHappens, media[]."},"402":{"description":"LAST STORIES. A profile, @handle, story tray, highlight, or live story requires a Pro, Scale, or Agency plan and an API key. Ask the customer what kind of images they need (e.g. planes, terminal, people, text on screen) — one short question — then analyze those last stories. A profile URL is enough. Agents without a key: POST /api/agent/start {\"plan\":\"pro\"}, send checkoutUrl or pay after confirm, then poll GET /api/agent/session?token=."}},"security":[{"apkKey":[]},{}]}},"/api/convert":{"get":{"operationId":"convertSocialPostOrLastStories","summary":"Convert a social post — or last stories when the URL is an Instagram profile","description":"Instagram profile / @handle / tray / highlight / live story runs the same last-stories handler as GET /api/analyze/story (same 200 payload, same 402). ASK THE CUSTOMER what kind of images they need (e.g. planes, terminal, people, text on screen) — one short question. Then GET last stories and describe only that kind of image. A profile is LAST STORIES. A profile URL is enough.","parameters":[{"name":"url","in":"query","required":true,"description":"Social post URL, or an Instagram profile / last-stories URL.","schema":{"type":"string"},"examples":{"profile":{"value":"https://www.instagram.com/bengurionairport_tlv/"},"post":{"value":"https://www.instagram.com/p/DEQqfjbO8vM/"}}}],"responses":{"200":{"description":"Convert JSON, or story-analysis JSON when the URL is last stories."},"402":{"description":"LAST STORIES. A profile, @handle, story tray, highlight, or live story requires a Pro, Scale, or Agency plan and an API key. Ask the customer what kind of images they need (e.g. planes, terminal, people, text on screen) — one short question — then analyze those last stories. A profile URL is enough. Agents without a key: POST /api/agent/start {\"plan\":\"pro\"}, send checkoutUrl or pay after confirm, then poll GET /api/agent/session?token=."}},"security":[{"apkKey":[]},{}]}},"/api/analyze/video":{"get":{"operationId":"analyzeInstagramReelOrTikTok","summary":"Analyze an Instagram /p/ or /reel/ or TikTok video","description":"Not for profiles. Profiles use GET /api/analyze/story (LAST STORIES) or GET /api/convert — same last-stories handler. Use this path only when the URL already contains /p/ or /reel/.","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","format":"uri"}}],"responses":{"200":{"description":"Video analysis JSON."}},"security":[{"apkKey":[]}]}},"/api/agent/start":{"post":{"operationId":"startAgentCheckout","summary":"Register from chat — Pro checkout for last stories","description":"Unauthenticated. Body {\"plan\":\"pro\"} returns checkoutUrl and pollToken. Send checkoutUrl or pay after explicit confirm. Never print the full apk_ key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["starter","pro","scale","agency"],"default":"pro"}}},"example":{"plan":"pro"}}}},"responses":{"200":{"description":"checkoutUrl + pollToken. Do not print secrets."}}}},"/api/agent/session":{"get":{"operationId":"pollAgentCheckoutSession","summary":"Poll Register-from-chat until paid","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"status pending|paid. apiKey only on the first paid poll — never print the full key."}}}}},"components":{"securitySchemes":{"apkKey":{"type":"http","scheme":"bearer","bearerFormat":"apk_","description":"Pro+ apk_ API key. Never print the full key."}}}}