X API (Twitter Post) Skill for Openclaw

An official API-driven skill for posting content to X (Twitter) using OAuth 1.0a for maximum reliability and bot detection bypass.

lobstergeneralintelligence
v0.1.0
Jan 29, 2026
45
7.8k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install x-api

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install x-api using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is X API (Twitter Post) Skill?

The x-api skill provides a secure and robust method for AI agents to publish content directly to X (Twitter). By utilizing the official X API v2 and OAuth 1.0a authentication, this skill avoids the common pitfalls of cookie-based automation, such as account flagging and bot detection. It is designed for developers who need a dependable way to broadcast updates, share insights, or integrate social media into their automated workflows.

As part of the wider ecosystem of Openclaw Skills, this tool prioritizes technical stability and compliance with platform terms of service. It serves as the primary write-mechanism for X, complementing other tools that focus on reading or monitoring timelines. Whether you are building an automated notification bot or an AI persona, this skill provides the necessary bridge to the X platform.

X API (Twitter Post) Skill Use Cases

  • Automating social media updates for software releases or project milestones.
  • Publishing AI-generated summaries and technical insights to a professional audience.
  • Integrating social sharing into CI/CD pipelines or development logs.
  • Replacing unreliable scraping methods with stable, official API calls to prevent account locks.

How X API (Twitter Post) Skill Works

  1. The skill authenticates using a set of four credentials: API Key, API Secret, Access Token, and Access Token Secret.
  2. It interfaces with the twitter-api-v2 library to establish a secure connection to X's servers.
  3. The user or agent provides a text string via the x-post command.
  4. The skill processes the request, handles multi-line formatting, and submits the post.
  5. Upon success, the official URL of the newly created tweet is returned to the agent.

X API (Twitter Post) Skill Setup

1. Developer Portal Configuration

Visit the X Developer Portal and create a Project. Ensure your App permissions are explicitly set to Read and Write.

2. Dependency Installation

Install the required library globally:

npm install -g twitter-api-v2

3. Credential Setup

You can configure credentials via environment variables or a JSON config file located at ~/.clawdbot/secrets/x-api.json:

{
  "consumerKey": "your-api-key",
  "consumerSecret": "your-api-secret",
  "accessToken": "your-access-token",
  "accessTokenSecret": "your-access-token-secret"
}

X API (Twitter Post) Skill Data Schema & Taxonomy

The skill manages configuration data through a structured JSON schema or environment mapping. Below is the metadata taxonomy for the credentials required by this Openclaw Skills component:

Property Description Source
consumerKey The API Key from X Developer Portal config/env
consumerSecret The API Secret Key from X Developer Portal config/env
accessToken The account-specific Access Token config/env
accessTokenSecret The account-specific Access Token Secret config/env

X API (Twitter Post) Skill Advanced Features

  • Multi-line support for complex formatting and long-form posting.
  • Precise error reporting for credit depletion (402) and unauthorized tokens (401).
  • Seamless integration with the bird CLI for full-spectrum read/write social automation.
  • High-reliability posting that bypasses common bot detection algorithms affecting non-API tools.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*