How to post to a Telegram channel from OpenAI Codex

To post to a Telegram channel or group from Codex, run codex mcp add postwire --url https://postwire.io/api/mcp and codex mcp login postwire, create a bot in @BotFather and make it an admin of the channel, then paste the bot's token once on the connect page Codex gives you and tap Find my channel. After that, "post the v3.1 release notes to my Telegram channel" makes Codex write the message with generate_posts, show it to you, and send it with post_to_social or queue it with schedule_post, up to 365 days ahead, through Telegram's official Bot API; the answer carries the message's t.me link. You write no bot code and host nothing. The free plan includes Telegram: 1 business, 10 posts a month, 5 AI drafts a day, 2 networks per post, no card.

The bot posts under your channel's name and only in the chats where you made it an admin. A scheduled message goes out from PostWire's servers with Codex closed, and Codex never holds the bot token: it stays on PostWire's connect page.

Updated . Written from PostWire's own code; vendor prices read on Nov 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 Telegram is connected: Read CHANGELOG.md and write a Telegram post for my channel about what shipped in v3.1, with the release link on the last line. Show it to me, then schedule it for Thursday at 10am my time.

  1. Add PostWire to Codex

    In your terminal run codex mcp add postwire --url https://postwire.io/api/mcp, then codex mcp login postwire. The browser opens PostWire's sign-in, which asks for your email and a 6-digit code and creates a free PostWire account if you have none: no password and no card. codex mcp list, or /mcp inside Codex, shows postwire with its tools. The entry lands in ~/.codex/config.toml, which the Codex CLI, the IDE extension and the ChatGPT desktop app share, so one setup posts to Telegram from any of them.

  2. On a server or in CI, sign in another way

    codex mcp login postwire --no-browser gives you a sign-in link to open on any device. In CI, give Codex your key instead: copy it in the dashboard under API & MCP, set POSTWIRE_API_KEY, and put the variable's name in ~/.codex/config.toml, never the key itself:

    [mcp_servers.postwire]
    url = "https://postwire.io/api/mcp"
    bearer_token_env_var = "POSTWIRE_API_KEY"
  3. Create a bot and make it an admin

    In Telegram, message @BotFather, send /newbot, pick a name and copy the token it gives you. Then open your channel → Administrators → Add admin, search for the bot and add it, so it is allowed to post. For a group, add the bot and send any message in the group.

  4. Connect Telegram and find your channel

    Ask "connect my Telegram channel". Codex calls create_connect_link and prints a one-hour link; open it, choose Telegram and paste the Bot token. Tap Find my channel and PostWire lists the channels and groups that bot was added to: tap yours, and you never have to look up a chat id. You can also type @yourchannel. Before saving, PostWire asks Telegram whether the bot can reach that chat, so a bot that is not an admin yet is caught on that page, with the fix.

  5. Ask for the message

    "Write the release post for my Telegram channel." generate_posts returns a draft and publishes nothing: clear and direct, light formatting, emojis allowed, links welcome and no hashtags, under 4,000 characters. Ask for changes in plain words ("shorter", "lead with the breaking change", "make the link the last line"). Ask for the Discord or LinkedIn version in the same sentence and each comes back written for its own network.

  6. Add a photo or a video, if you want one

    Telegram fetches the file from a link, so a screenshot or a clip on your disk goes through an upload page: Codex asks for one (create_upload_link, valid 24 hours, up to 100 MB on the free plan and 1 GB on paid plans), you pick the file there, and get_uploaded_file hands Codex its link. The message text becomes the caption under it.

  7. Post now, or schedule it

    Say "post it" and Codex calls post_to_social. Say "schedule it for Thursday at 10am" and it calls schedule_post, up to 365 days ahead, or with run_at: "next_slot" for your next free posting hour. This is the call:

    {
      "name": "schedule_post",
      "arguments": {
        "platforms": ["telegram"],
        "per_platform": { "telegram": {
          "text": "v3.1 is out 🚀\n\nInvoices now export to CSV in one click, and the API returns line items.\n\nRelease notes: https://example.com/changelog/v3-1"
        } },
        "run_at": "2026-12-03T10:00:00-05:00"
      }
    }
  8. Open the message

    The answer lists Telegram with the message's link: https://t.me/yourchannel/123 for a public channel, https://t.me/c/…/123 for a private one (it opens for members). get_post_status returns the same link later.

From a release script, codex exec "post the notes for the latest tag from CHANGELOG.md to my Telegram channel" runs the same request without the interactive screen. "What's scheduled on Telegram?" calls list_scheduled_posts and "cancel Thursday's post" calls cancel_scheduled_post. Prefer to set it up by hand? Open the dashboard, connect Telegram under Accounts and copy your key under API & MCP.

Ways to post to Telegram from Codex, side by side

How each service plugs into Codex and reaches Telegram, and what it costs to start, read on its own pages on Nov 30, 2026.

ServiceHow it plugs into CodexHow it reaches TelegramFree to startCheapest paid plan
PostWirecodex mcp add postwire --url https://postwire.io/api/mcpYour @BotFather bot; Find my channel picks the chat, checked with Telegram before it is savedFree 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
Postizcodex mcp add postiz --url mcp.postiz.com/mcp-oauth-dynamic, or the Postiz skillA bot that is an administrator of the channel or group7-day free trial$29/mo — 5 channels
Upload-PostIts MCP server mcp.upload-post.com/mcp; no Codex setup listed"You connect your channel to Upload-Post once"Free plan of 10 uploads a month, no card$24/mo ($16 billed yearly)

Checked on Nov 30, 2026 (2026-11-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

  • The message is written for Telegram: generate_posts writes it clear and direct with the link kept, and writes the Discord, LinkedIn or X version from the same idea in the same request.
  • A free plan with no time limit: 10 posts a month, no card, MCP included. Postiz starts with a 7-day trial.
  • The cheapest paid plan here: $19 a month for 3 businesses, $15.20 billed yearly. Upload-Post $24 ($16 yearly), Postiz $29.
  • No chat id to look up: Find my channel lists the channels and groups your bot was added to from its token, and the chosen one is checked with Telegram before it is saved.
  • The message link comes back: the answer carries the post's t.me link, for public and private channels.
  • No key to copy to start: codex mcp login postwire signs you in with your email and a 6-digit code, and creates the free account too. A key is there for CI.
Sources, all read on Nov 30, 2026:
  • Postiz — Post to Telegram from Codex (the same skill or MCP server; "The Postiz bot must be an administrator of the channel or group it posts to"): postiz.com/codex/telegram
  • Postiz pricing ("Postiz has a 7-day free trial on every plan, and paid plans start at $29 per month"; Standard $29 a month, 5 channels; $23 a month on annual billing): postiz.com/pricing
  • Upload-Post — Telegram MCP server ("You connect your channel to Upload-Post once and the MCP tools post through that connection"; "It works with any Upload-Post plan, including the free tier"): www.upload-post.com/mcp/telegram/
  • Upload-Post llms-full.txt (Free: 10 uploads a month, no credit card required, "platforms without TikTok"; Basic $24 a month, $16 billed yearly, 5 profiles): www.upload-post.com/llms-full.txt
  • OpenAI — Codex MCP docs (~/.codex/config.toml shared by the ChatGPT desktop app, the Codex CLI and the IDE extension; codex mcp login <server-name>, with --no-browser for a terminal without a local browser; bearer_token_env_var; /mcp in the TUI): developers.openai.com/codex/mcp
  • Telegram Bot API (sendMessage text "1-4096 characters after entities parsing"; captions 0-1024 characters): core.telegram.org/bots/api
  • Telegram Bots FAQ ("In a single chat, avoid sending more than one message per second"; in a group, no more than 20 messages per minute): core.telegram.org/bots/faq

Telegram's rules, and what PostWire does with them

Read on Telegram's own pages and in PostWire's Telegram integration on Nov 30, 2026:

What Telegram allowsWhat PostWire does
Who can postA bot posts in a channel only as an adminConnects your own @BotFather bot, and checks with Telegram that it can reach the chat before saving
Finding the chatEvery chat has an id; public channels also have an @nameFind my channel lists the chats the bot is in from its token alone
Text1 to 4,096 characters a messagegenerate_posts keeps Telegram drafts under 4,000
Photo or videoA caption of up to 1,024 charactersOne photo or one video per message, with the text as caption
SpeedAbout one message a second in a chat, and 20 a minute in a group3 seconds between posts to the same channel or group; a "retry after" is waited out, and a long one is queued and sent after it

Sources: Telegram Bot API and Telegram Bots FAQ, read Nov 30, 2026. Every Telegram tool: Telegram MCP server; every client's setup: PostWire's MCP server.

Why post to Telegram from Codex

  • Release notes written from the release: Codex reads the changelog, the merged pull requests or the tag's diff and writes the channel post with the version and the breaking changes right.
  • One announcement, every community: "post it to Telegram and Discord" sends each its own version. On the free plan one post reaches 2 networks; paid plans (from $19 a month) send it to every network you connected, LinkedIn, Bluesky and X included.
  • The same message from a script: once the wording is right, Codex can put it in your release job as one REST call, POST /api/post with {"platforms": ["telegram"], "text": "…"} and your key.
  • A burst does not lose posts: posts to one channel are spaced 3 seconds apart, and what Telegram asks to wait for is sent after the wait.
  • 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.

What Starter ($19 a month) adds for a Telegram channel

A post every weekday is about 22 a month, past the free plan's 10 and its 3 waiting posts. Starter is $19 a month, or $15.20 a month billed yearly:

  • An unlimited queue and 1,000 posts a month: schedule a month of channel posts at once.
  • 25 recurring posts (create_recurring_post): a Monday digest or a Friday reminder, set once.
  • 3 businesses, each with its own Telegram channel and its own networks.
  • Every network in each post, and files of up to 1 GB.

What it does not do

PostWire posts and schedules messages in the channel or group you connected. It does not read your chats, answer people, send direct messages, manage members or post to your personal account: it acts only as the bot you created. It does not send albums of several photos in one message, polls or stories, and it does not edit or delete a message after it is sent.

Questions people ask

Can Codex post to a Telegram channel?

Yes, with an MCP server. Codex has no Telegram access of its own; with PostWire added (codex mcp add postwire --url https://postwire.io/api/mcp, then codex mcp login postwire) and a Telegram bot connected once, it writes the message and posts or schedules it in your channel when you ask.

Do I need to write or host a Telegram bot?

No code and no hosting. Send /newbot to @BotFather, copy the token, add the bot to your channel as an admin and paste the token on the connect page. PostWire does the sending.

Where do I find my Telegram channel's chat id?

You don't need it. After you paste the bot token, Find my channel lists the channels and groups the bot was added to, and you tap yours. For a public channel you can also type @yourchannel.

Can Codex schedule Telegram messages?

Yes. It calls schedule_post with a time up to 365 days ahead, or "next_slot" for your next free posting hour, and PostWire sends it at that time with Codex closed. The free plan keeps 3 posts waiting at once; paid plans have no such limit.

Can Codex post to a private channel or a group?

Yes. The bot has to be an admin of the private channel, or a member of the group. Links to posts in a private channel open for its members.

How long can a Telegram post be?

Up to 4,096 characters of text, Telegram's limit. With a photo or a video the text becomes its caption, and Telegram takes captions of up to 1,024 characters.

How much does it cost?

The free plan includes Telegram 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, with no limit on the queue and 25 recurring posts; Pro is $29 for 10. Nothing is charged from Codex.