Tesselith
ProductSolutionsAI agentsCompareFree toolsBlogPricing
Log inStart free
  1. Home/
  2. AI agents/
  3. OpenAI API/
  4. Telegram
OpenAI API + Telegram

Schedule Telegram posts with OpenAI API

The OpenAI API is for developers who build their own agent, so this route is for code you own rather than a chat window. Tesselith's MCP server plugs into the Responses API as a hosted tool, and your agent can draft, queue and schedule Telegram posts. Publishing now and deleting always need a confirmation from a person, so build that step into your app.

Start freeFull OpenAI API setup

1. Connect OpenAI API

agent.py
import os
from openai import OpenAI

client = OpenAI()
resp = client.responses.create(
    model="gpt-5",  # any model that supports remote MCP
    input="List my Tesselith channels",
    tools=[{
        "type": "mcp",
        "server_label": "tesselith",
        "server_url": "https://api.tesselith.com/mcp",
        "authorization": os.environ["TESSELITH_API_KEY"],
        "require_approval": "always",
    }],
)
print(resp.output_text)

Then connect Telegram in Tesselith under Channels. How Telegram scheduling works.

2. Ask for a Telegram post

Check the Telegram queue for empty weekend slots.

Used Tesselith · get_queue

Two Telegram slots are free this weekend: Saturday at 10:00 and Sunday at 16:00, in your workspace timezone. The agent lists them for the coordinator and waits for a draft before it adds anything.

What people use OpenAI API for on Telegram

Post fixes to a status channel

A SaaS company builds an internal agent that reads its support tickets each morning. When a bug is marked resolved, the agent drafts a Telegram post for the status channel that says what was fixed and what users should do. The drafts are created in Tesselith, and a support lead approves them in the app. Customers never see the first draft.

Turn a deals spreadsheet into a weekly channel

A bike shop with two hundred products runs a Telegram channel for weekly deals. Its own script reads the discounted rows from the shop's CSV export and passes them to a model through the Responses API. The model writes one short post per deal, with the price and a link, and creates drafts on the channel. The owner reads the batch on Monday and queues the ones they like.

Fill weekend gaps from the queue

A nonprofit with a volunteer team runs a Telegram channel that often goes quiet on weekends. Its agent checks the queue each Friday through Tesselith's tools and finds the empty weekend slots. It drafts a short post for each gap from the month's volunteer newsletter. The coordinator approves the drafts before anything is queued.

Prompts to try in OpenAI API for Telegram

  • “Create a draft for each product in today's deals file, up to ten, each with the price and the product link.”
  • “List the Telegram channels in my workspace and say which ones have nothing queued for the next seven days.”
  • “Upload the image at this public URL and attach it to this morning's Telegram draft.”
  • “Queue the drafts marked approved in the ticket notes, one per free Telegram slot, in the order they were written.”
  • “Show the Telegram posts published last week with their dates, one line each, and nothing else.”

Telegram limits to keep in mind

Telegram messages are limited to 4,096 characters, and captions on photos and videos to 1,024. Tesselith checks drafts against these before they can be scheduled, so OpenAI API gets a clear error instead of a failed post.

Telegram limits
Limit
Message4,096
Media caption1,024
Channel description255
Bio70

Tips for Telegram posts written with OpenAI API

  • Keep the model's instructions short and literal. Say which tool creates drafts and which one needs a human, and the agent makes fewer surprise calls when your feed changes.
  • Pass only the fields the model needs for each post, such as the price, the product name and the link. A smaller input gives shorter Telegram copy and less room for invented details.
  • Check the length of text before it reaches Tesselith. Text messages are capped at 4,096 characters and captions at 1,024, so add a rule to your prompt and a length check in your code.
  • Log the post IDs your agent creates. When a post needs changing later, the update call needs its ID, and a stored list saves a search through the queue.

If something goes wrong

Troubleshooting OpenAI API with Tesselith
Fix
424 or "tool list failed"OpenAI couldn't reach Tesselith or got a 401. Check the key is sent as authorization on every request.
The model calls tools you didn't wantSet allowed_tools to the tools the agent needs.
Responses stall waiting for approvalAnswer the mcp_approval_request items, or use require_approval never for read-only tools.
403: your plan doesn't include API accessMCP is included on Pro, Team and Agency. New workspaces get a 14-day Pro trial; upgrade under Settings → Billing.
401: connection revoked or lost accessSomeone disconnected the assistant in Settings → AI assistants, or your role changed. Connect again and approve the workspace.
The assistant can read posts but can't scheduleYou unticked Schedule and queue on the consent screen. Disconnect and connect again, keeping that permission.
No channels foundThe assistant only sees accounts already connected in Tesselith. Connect them under Channels first.
Post scheduled at the wrong timeTell the assistant your time zone. Tesselith takes ISO 8601 times with an offset, and your workspace time zone is shown in get_queue.
429: rate limitedEach connection can make 120 requests a minute on Pro, 300 on Team and 600 on Agency. Wait for the Retry-After seconds.

Questions

Do I need a Tesselith API key?
Yes. Your agent connects to Tesselith's MCP server with a key from your workspace, so store it in your environment and not in your source code.
Can the agent publish a Telegram post straight away?
It can call publish_now, but that needs confirm set to true, which should only happen after a person agrees. Build that approval step into your app before you ship.
Which OpenAI plan do I need?
The API bills by usage, so you need an API key and credit on your OpenAI account. Tesselith itself needs a Pro, Team or Agency workspace.

OpenAI API with other networks

InstagramFacebook PagesThreadsYouTubeBlueskyMastodon

Other AI agents for Telegram

ClaudeClaude CodeClaude CoworkChatGPTCodexCursorVS Code (GitHub Copilot)WindsurfZedClineGemini CLIHermes AgentOpenClawGoosen8nMistral Le ChatPerplexityManus

Put OpenAI API to work on Telegram

Connect Telegram to Tesselith, connect OpenAI API, and schedule your next post from a conversation.

Start free

Free to start

One calendar for everything you post.

No credit card. Connect your first channel and schedule a post in under two minutes.

Start free
Tesselith

The social scheduler for creators, teams and agencies. One calendar, every network you post to.

Product

  • Composer
  • Calendar
  • Analytics
  • Automation
  • AI assistant
  • Posting queue
  • API & webhooks
  • MCP server
  • All features

AI agents

  • Claude
  • Claude Code
  • ChatGPT
  • Codex
  • Cursor
  • Gemini CLI
  • n8n
  • All AI agents

Solutions

  • Creators
  • Agencies
  • Small business
  • E-commerce
  • All solutions

Compare

  • Scheduler pricing 2026
  • vs Buffer
  • vs Hootsuite
  • Metricool alternatives
  • Planoly alternatives
  • SocialBee alternatives
  • All comparisons
  • All alternatives

Free tools

  • Character counter
  • Best time to post
  • UTM builder
  • Engagement rate
  • All tools

Company

  • About
  • Blog
  • Research
  • Developer docs
  • Pricing
  • Contact
  • Security
  • Status

Legal

  • Privacy
  • Terms
  • Cookies
  • Acceptable Use
  • DPA
  • Refunds

Schedule posts for

  • X (Twitter)
  • Instagram
  • Facebook Pages
  • LinkedIn
  • YouTube
  • TikTok
  • Threads
  • Bluesky
  • Mastodon
  • Pinterest
  • Reddit
  • Discord
  • Telegram
  • Dev.to
  • Hashnode

Popular guides

  • Post to all social media at once
  • Schedule Discord messages
  • Cross-post to Bluesky, Mastodon and Threads
  • Buffer pricing
  • Sprout Social pricing
  • Metricool pricing
  • Sendible pricing
  • Loomly pricing
© 2026 Tesselith. All rights reserved.
PrivacyTermsCookiesSecurityData deletion
Tesselith