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

Schedule Instagram posts with OpenAI API

The OpenAI API is for developers building their own agent, so Tesselith is one tool in your code rather than an app you chat with. The Responses API can call Tesselith's MCP server directly, so your agent can draft and queue Instagram posts as part of a bigger flow. You bring the model, the prompts and the checks.

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

2. Ask for a Instagram post

Check the queue for the Instagram channel and return the next free slot.

Used Tesselith · suggest_best_time

The next free Instagram slot is Thursday at 19:00 in the workspace time zone. Nothing was scheduled, and the suggestion also lists your best hours.

What people use OpenAI API for on Instagram

A content tool for a print shop

A print shop builds a small internal tool that takes each new product photo and writes an Instagram caption. The tool calls the Responses API with Tesselith's MCP server attached, so the model can create a draft on the shop's account. Staff see every draft in Tesselith before the queue is touched, and the tool never publishes on its own.

A newsletter to social pipeline

A newsletter company runs a nightly job that reads each new issue and writes three Instagram posts. The job sends the issue text and the Tesselith tools to the Responses API, and the model creates the drafts. A human editor approves the batch the next morning, and only approved posts get a queue slot.

A support agent that drafts how-to posts

A software company keeps getting the same setup question in support tickets. Its internal agent uses the Responses API with the Tesselith tools to turn a resolved ticket into a short how-to post. The agent tags each draft for the support lead, who decides whether it goes out and when.

Prompts to try in OpenAI API for Instagram

  • “Draft an Instagram carousel caption from this release note, under 125 characters before the more cut-off, and create it as a draft.”
  • “Read this blog post and create three Instagram drafts, each with a different first line and a caption under 125 characters before the cut.”
  • “Check the queue for this channel and return the next three free slots in ISO 8601 with the workspace offset.”
  • “Create a single-image draft using the public image URL below, with a caption that names the product and its colour options.”
  • “Summarize this week's drafts for the Instagram channel and list the ones still missing a photo.”

Instagram limits to keep in mind

Instagram captions can be up to 2,200 characters, but only about the first 125 show before the 'more' cut-off. Bios are limited to 150 characters. Tesselith checks drafts against these before they can be scheduled, so OpenAI API gets a clear error instead of a failed post.

Instagram limits
Limit
Caption2,200
Visible before 'more'~125
Hashtags per post30
Bio150
Username30
Comment2,200

Tips for Instagram posts written with OpenAI API

  • Put the character limit in the system prompt. Instagram shows only about 125 characters before the more cut-off, so a model left alone will often write long captions that bury the point.
  • Ask for JSON with separate fields. Keep the caption, the hashtags and the media URL in different keys, so your code can check each one. A single block of text makes validation harder and mistakes harder to spot.
  • Cap the hashtags in code as well as in the prompt. Instagram allows 30 per post, but a model will sometimes go over. Count them after the call and trim the extras before the draft is created.
  • Keep a human approval step. Your code can create drafts freely, but publish_now and delete_post need an explicit confirm flag, and your app should ask a person before setting it. Build the approval queue around that.

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 for this?
Yes. Create one under Settings → Developers, tick only the scopes your agent needs, and store it in a secret store. Keys are shown once.
Does OpenAI host the Tesselith server for me?
OpenAI calls Tesselith's hosted MCP server for you, so there's nothing for you to run or host on your side.
Which Instagram formats can the API schedule?
Single images, carousels and Reels, the same as the web composer. Media is attached from a public URL, so the file has to be reachable online first.

OpenAI API with other networks

Facebook PagesThreadsYouTubeBlueskyMastodonTelegram

Other AI agents for Instagram

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

Put OpenAI API to work on Instagram

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