How to post to Instagram from OpenAI Codex
codex mcp add postwire --url https://postwire.io/api/mcp and codex mcp login postwire, connect your Instagram Business or Creator account once, and ask "post ./launch/demo.mp4 to Instagram as a Reel with a caption from CHANGELOG.md". Codex writes the caption with generate_posts, shows it to you, and publishes with post_to_social or queues with schedule_post: one photo is a feed post, one video is a Reel, and 2 to 10 photos and videos are a carousel. PostWire posts through Meta's official Instagram API with its own approved app, so you need no Meta developer app, and Log in with Instagram works without a Facebook Page. The free plan includes Instagram: 1 business, 10 posts a month, 5 AI drafts a day, 2 networks per post, no card.The entry lands in ~/.codex/config.toml, which the Codex CLI, the IDE extension and the ChatGPT desktop app share, so one setup covers all three. PNG screenshots and AI-generated images work as they are: PostWire converts them to the JPEG Instagram's API takes.
Updated . Written from PostWire's own code; vendor prices read on Oct 30, 2026. Live networks: TikTok, Instagram, YouTube, LinkedIn (personal profiles), Facebook Pages, Bluesky, Mastodon, Telegram, Discord, and X on paid plans.
Set it up and post, step by step
Prompt to copy once Instagram is connected: Upload ./launch/slide-1.png, slide-2.png and demo.mp4, write an Instagram caption for the v2.4 launch from CHANGELOG.md, show it to me, and schedule the carousel for Tuesday at 6pm.
- Add PostWire to Codex
In your terminal run
codex mcp add postwire --url https://postwire.io/api/mcp, thencodex mcp login postwire. The browser opens PostWire's sign-in, which asks for your email and a 6-digit code and also creates a free PostWire account if you have none: no password and no card.codex mcp list, or/mcpinside Codex, shows postwire with its tools. - Or use an API key, for a box without a browser
On a remote machine or in CI the sign-in cannot finish, so give Codex your key instead: copy it in the dashboard under API & MCP, set
POSTWIRE_API_KEY, and put the entry in~/.codex/config.tomlwith the variable's name, never the key itself:[mcp_servers.postwire] url = "https://postwire.io/api/mcp" bearer_token_env_var = "POSTWIRE_API_KEY" - Connect Instagram
Ask "connect my Instagram". Codex calls
create_connect_linkand prints a one-hour link; open it and choose Log in with Instagram (no Facebook Page needed) or connect through a Facebook Page you manage. Instagram's API publishes only from Business or Creator accounts — switching a personal account is free, in the Instagram app's settings. PostWire never sees your password. - Give the post a photo or a video
Instagram refuses text-only posts, and it fetches media from a link, so a file on your disk goes through an upload page: Codex asks for one (
create_upload_link), you pick the file there, andget_uploaded_filehands Codex its link (up to 100 MB on the free plan and 1 GB on paid plans). A public https link works too, asphoto_urlorvideo_url, or a list inmediafor a carousel. - Ask for the caption
"Write the Instagram caption for the launch."
generate_postsreturns a draft and publishes nothing: the hook in the first line, a short caption, at most 5 hashtags at the end, within Instagram's 2,200 characters. Ask for the TikTok or LinkedIn version in the same sentence and each comes back written for its own network. - Post now, or schedule it
Say "post it" and Codex calls
post_to_social. Say "schedule it for Tuesday at 6pm" and it callsschedule_post, up to 365 days ahead, or withrun_at: "next_slot"for your next free posting hour. Two or more items inmediamake a carousel; Instagram crops every slide to the first one's shape. This is the call:{ "name": "schedule_post", "arguments": { "platforms": ["instagram"], "per_platform": { "instagram": { "text": "v2.4 is here 🚀 Dark mode, 2x faster sync, 14 fixes. Swipe for the demo 👉 #buildinpublic #saas" } }, "media": [ { "url": "https://postwire.io/m/…/slide-1.png", "type": "image" }, { "url": "https://postwire.io/m/…/slide-2.png", "type": "image" }, { "url": "https://postwire.io/m/…/demo.mp4", "type": "video" } ], "run_at": "2026-11-03T18:00:00-05:00" } } - Check that it went out
Instagram processes a video before it can be published. If that takes longer than the call can wait, the result says
processingand PostWire publishes it on its own a few minutes later;get_post_statusorlist_scheduled_postsshows when it is live.
Stories and trial reels are set through the REST API today, which Codex can call from the terminal with your key: POST /api/post with "options": {"instagram": {"post_type": "story"}} for a Story (Instagram's API takes no caption on Stories), or {"trial_reel": true} to show a Reel first to people who don't follow you. "What's scheduled on Instagram?" calls list_scheduled_posts. Prefer to set it up by hand first? Open the dashboard, connect the account under Accounts and copy your key under API & MCP.
Ways to post to Instagram from Codex, side by side
How each service plugs into Codex and reaches Instagram, and what it costs to start, read on its own Codex, MCP and pricing pages on Oct 30, 2026.
| Service | How it plugs into Codex | What it posts to Instagram | Instagram on the free start | Cheapest paid plan |
|---|---|---|---|---|
| PostWire | codex mcp add … --url https://postwire.io/api/mcp, OAuth or an API key | Photos, Reels, carousels of 2-10 mixed items; Stories and trial reels through REST | Yes — free plan: 1 business, 10 posts a month, 5 AI drafts a day, 2 networks per post, no card | $19/mo — 3 businesses, every network in each post |
| Postiz | codex mcp add postiz --url mcp.postiz.com/mcp-oauth-dynamic, or the Postiz skill | Feed posts and Stories, trial reels, collaborators | 7-day free trial | $29/mo — 5 channels |
| Upload-Post | Its hosted MCP server mcp.upload-post.com/mcp; its list of supported clients does not name Codex | Reels, photos, carousels of up to 10, Stories | Free plan of 10 uploads a month | $24/mo — 5 profiles |
Checked on Oct 30, 2026 (2026-10-30) on each vendor's own pricing or docs page, linked in the first column and below. Monthly billing in USD unless noted. "Not listed" means we could not find it on their page, not that it is missing.
Where PostWire is ahead
- A free plan with no time limit: 10 posts a month, no card. Postiz starts with a 7-day trial.
- The cheapest paid plan here: $19 a month for 3 businesses. Upload-Post $24, Postiz $29.
- The caption is written for Instagram:
generate_postswrites a hook-first caption with at most 5 hashtags and, from the same launch, the TikTok caption and the YouTube title in one call. - PNG straight from a screenshot or an image model works: PostWire converts it to the JPEG Instagram requires.
- A slow video does not fail the post: when Instagram is still processing a Reel, PostWire publishes it on its own once it is ready.
- A person approves what Codex queued: on paid plans, approval rules hold the post until you approve it from an emailed link.
- Postiz — Post to Instagram from Codex (codex mcp add postiz --url https://mcp.postiz.com/mcp-oauth-dynamic and codex mcp login postiz, or npx skills add gitroomhq/postiz-agent with POSTIZ_API_KEY; feed posts, Stories, trial reels, collaborators): postiz.com/codex/instagram
- Postiz pricing ("Start with a 7-day free trial"; Standard $29 a month, 5 channels): postiz.com/pricing
- Upload-Post — Instagram MCP server (Reels, photos, carousels of up to 10 items, Stories): www.upload-post.com/mcp/instagram/
- Upload-Post llms-full.txt (Free 10 uploads a month, "no credit card required"; free-plan platforms "Instagram, LinkedIn, YouTube, Facebook, X, Threads, Pinterest, Reddit, Bluesky"; Basic $24 a month, 5 profiles; hosted MCP https://mcp.upload-post.com/mcp, API key or OAuth; Discord "via channel webhook"; its list of supported MCP clients): www.upload-post.com/llms-full.txt
- OpenAI — Codex MCP docs (~/.codex/config.toml, [mcp_servers.<name>] with url and bearer_token_env_var, codex mcp add … --url, codex mcp login, codex mcp list, /mcp): developers.openai.com/codex/mcp
Why post to Instagram from Codex
- The files are already in the repo: the demo video your build rendered, the screenshots in
./launch, the release notes. Codex uploads them, writes the caption from what shipped and posts the carousel, without moving files to your phone. - One launch, every network: "post the demo to Instagram and TikTok" sends one request with a caption written for each. On the free plan one post reaches 2 networks; paid plans (from $19 a month) add YouTube Shorts, LinkedIn and the rest in the same request.
- The same post from a script: once you know what you want, Codex can write it into your build as one REST call,
POST /api/postwith{"platforms": ["instagram"], "video_url": "…", "text": "…"}and your key. - A person can have the last word: on paid plans, a brand's approval rules hold what Codex queues until you approve it from an emailed link.
Source: PostWire's MCP server, Instagram integration and plans, and OpenAI's Codex MCP docs, read Oct 30, 2026.
Instagram's rules Codex works within
- Business or Creator accounts: personal accounts cannot publish through Instagram's API.
- Every post needs a photo or a video: one photo is a feed post, one video a Reel, 2 to 10 items (photos, videos or a mix) a carousel.
- JPEG only, for Meta: PostWire converts PNG, WebP and other still images to JPEG when it publishes, so screenshots and AI-generated images work as they are.
- Captions up to 2,200 characters; Stories carry no caption through the API.
- Videos are processed first: Instagram needs a moment before a Reel can go live, and PostWire finishes the publish on its own when it is ready.
More on the API itself: Does Instagram have an API?
What it does not do
PostWire publishes, schedules and reports how your own posts did (get_post_performance ranks your Instagram posts from the likes and comments Instagram reports). It does not read or answer comments or DMs, it does not post a first comment on Instagram, and it does not tag people, products or a location. Stories and trial reels are a REST option today, not a field of the MCP tools.
Questions people ask
Can Codex post to Instagram?
Yes, with an MCP server. Codex has no Instagram access of its own; with PostWire added (codex mcp add postwire --url https://postwire.io/api/mcp, then codex mcp login postwire) and your Business or Creator account connected once, it writes the caption and publishes or schedules photos, Reels and carousels when you ask.
Do I need a Facebook Page or a Meta developer app?
No developer app: you connect to PostWire's approved Meta app. No Facebook Page either if you choose Log in with Instagram; the account must be a Business or Creator account.
Where does Codex keep the PostWire config?
In ~/.codex/config.toml, as a [mcp_servers.postwire] table with url = "https://postwire.io/api/mcp". The Codex CLI, the IDE extension and the ChatGPT desktop app read the same file. A project can have its own .codex/config.toml instead.
How does Codex get a video from my disk to Instagram?
Instagram fetches media from a link, so Codex asks for an upload page with create_upload_link; you pick the file there and Codex gets its link for the post. A file that is already online goes as its public https link.
Can Codex post a Reel or a carousel?
Yes. One video is a Reel, and 2 to 10 photos and videos in media are a carousel; Instagram crops every slide to the first one's shape. Stories and trial reels are set through the REST API (options.instagram.post_type "story", or trial_reel true).
Can Codex schedule Instagram posts?
Yes. It calls schedule_post with a time up to 365 days ahead, or "next_slot" for your next free posting hour, and PostWire publishes it at that time with Codex closed. The free plan keeps 3 posts waiting at once; paid plans have no such limit.
How much does it cost?
The free plan includes Instagram and the MCP server: 1 business, 10 posts a month, 5 AI drafts a day, 2 networks per post, no card. Starter is $19 a month for 3 businesses and Pro $29 for 10, with every network in each post; paid plans have a 14-day refund.
Try it on one business, free.
The free plan is 1 business, 10 posts a month, 5 AI drafts a day (about 20 a month) and 2 networks per post — every network connects free, no card, no time limit. Paid plans start at $19 a month and have a 14-day refund; Pro can be tried free for 7 days and Agency for 14, with a card at checkout and nothing charged that day.