---
name: post-to-x
description: Post, schedule, and thread on X (Twitter) through the OpenTweet REST API. Use whenever the user asks to tweet, post to X, schedule a post, or publish a thread.
version: 1.1.0
homepage: https://opentweet.io/skills
---

# Post to X with OpenTweet

Post to the user's connected X account through the OpenTweet REST API.
The base URL is https://opentweet.io. The API key lives in the
OPENTWEET_API_KEY environment variable and starts with ot_. Never print,
log, or write the key anywhere.

## Authentication

Every request needs these headers:

    Authorization: Bearer $OPENTWEET_API_KEY
    Content-Type: application/json

## Before you post

Check the connection and the remaining quota first:

    GET https://opentweet.io/api/v1/me

Confirm subscription.has_access is true and limits.remaining_posts_today
is above zero before publishing or scheduling. Without a plan, only a
single text-only post with publish_now: true is allowed.

## Publish now

    POST https://opentweet.io/api/v1/posts
    {"text": "Tweet text here", "publish_now": true}

A successful response carries status "posted" and a url pointing at the
real X post. Report that url. Never construct one.

## Schedule for later

    POST https://opentweet.io/api/v1/posts
    {"text": "Tweet text here", "scheduled_date": "2026-11-02T09:00:00Z"}

scheduled_date is ISO 8601 in UTC and must be in the future. OpenTweet
publishes it at that time, whether or not the agent is still running.

## Save a draft

    POST https://opentweet.io/api/v1/posts
    {"text": "Tweet text here"}

Omit both publish_now and scheduled_date. The user reviews drafts in the
OpenTweet app.

## Post a thread

    POST https://opentweet.io/api/v1/posts
    {
      "text": "First tweet of the thread",
      "is_thread": true,
      "thread_tweets": ["Second tweet", "Third tweet"],
      "publish_now": true
    }

## Several accounts

    GET https://opentweet.io/api/v1/accounts

Pass x_account_id in the POST body to post from a specific account. When
it is omitted, the primary account is used.

## Rules

- 280 characters per tweet, unless GET /api/v1/accounts shows an
  x_subscription_type other than "None" (X Premium allows long posts).
  Count each tweet inside a thread separately.
- Links cost extra on X. Only include a URL when the user asked for one.
- Never send publish_now and scheduled_date in the same request.
- Show the user the drafted text and get confirmation before publishing,
  unless they explicitly said to post now. Publishing cannot be undone.
- Make the real HTTP call every time. Never invent a response value.
- A 4xx or 5xx status means the operation failed. Say so plainly and
  include the error message. Do not retry blindly.

Full API reference: https://opentweet.io/docs/api
For typed tools instead of HTTP calls, connect the MCP server at
https://mcp.opentweet.io/mcp with the same key.
