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

Schedule Mastodon posts with OpenAI API

The OpenAI API is for developers who build their own agent, so a Mastodon post here is a feature in your product rather than a chat you have by hand. You pass Tesselith's MCP server to the Responses API as a hosted tool, and your code decides when the model drafts or queues a post. Because the model calls tools without you in the loop, keep allowed_tools tight and never let a publish run unconfirmed.

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 Mastodon in Tesselith under Channels. How Mastodon scheduling works.

2. Ask for a Mastodon post

Draft a Mastodon post for the new ceramic mug, under 450 characters, ending with the shop link.

Used Tesselith · create_draft

Created a Mastodon draft for the mug, 312 characters, ending with the product link. The draft is in Tesselith and waits for a person to approve it. Nothing was queued.

What people use OpenAI API for on Mastodon

Drafting a post for each newsletter issue

A developer runs a small newsletter service. When an issue is published, a webhook calls their code, which sends the issue text and its link to the Responses API with Tesselith's MCP server attached. The model creates a draft, and the writer approves it in Tesselith before anything is queued. The code never calls a publish tool.

A press release to three posts for a university

A marketing team at a university builds an internal form where staff paste a press release. The app asks the model for three Mastodon posts aimed at three audiences, and the model uses list_channels to pick the right account for each. Each post comes back as a draft in Tesselith, and the communications lead chooses which ones to schedule.

Turning a new-arrivals spreadsheet into drafts

An online shop keeps a spreadsheet of new arrivals. A nightly job reads the rows added that day and asks the model for a Mastodon post for each product, under 500 characters, with the product link at the end. The job creates drafts only, so a person reviews the batch each morning before any of it is scheduled.

Prompts to try in OpenAI API for Mastodon

  • “Write a Mastodon post for this product, under 450 characters, ending with the product link.”
  • “Draft a three-post thread from this press release, each post under 500 characters.”
  • “Create a draft on the account for the spring campaign channel, and don't queue it.”
  • “Summarize the Mastodon queue for next week, then tell me which days have no posts.”
  • “Attach the product photo from this public URL to the draft before you return it.”

Mastodon limits to keep in mind

Mastodon posts are limited to 500 characters on most servers, though some servers allow more. Every link counts as 23 characters. Tesselith checks drafts against these before they can be scheduled, so OpenAI API gets a clear error instead of a failed post.

Mastodon limits
Limit
Post (default)500 (server-dependent)
Any linkCounts as 23
Bio500
Images per postUp to 4

Tips for Mastodon posts written with OpenAI API

  • Restrict allowed_tools to what the job needs. A drafting job needs create_draft and list_channels, not publish_now. An open tool list lets the model reach actions your code never meant to expose.
  • Keep the confirmation step for publish and delete in your own flow too. Tesselith asks for confirmation on both, so pass that step through to a person instead of auto-confirming it in code.
  • Put the platform's limit in the prompt. Mastodon allows 500 characters on most servers, and every link counts as 23. Without that number, a model tends to write long drafts you then have to trim.
  • Keep the Tesselith key on your server, not in client code. The key gives the model access to your workspace, so load it from an environment variable such as TESSELITH_API_KEY.

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 to host an MCP server?
No. OpenAI calls Tesselith's MCP server for you, so your code only sends the server URL and your key.
Can the model publish a post straight from my code?
Only if your code allows publish_now. Tesselith still needs confirm: true on that call, so your code has to put a person in that step first.
Why does the model only see some of the Tesselith tools?
Because allowed_tools limits what the model can call. Check the tool names against the MCP tool list before you debug the rest of the request.

OpenAI API with other networks

InstagramFacebook PagesThreadsYouTubeBlueskyTelegram

Other AI agents for Mastodon

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

Put OpenAI API to work on Mastodon

Connect Mastodon 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