x-api

x-api is a skill for Codex from mturac/everything-openai-codex. It costs 48 tokens per session (1,617 once invoked), scanned A, a copy of x-api, MIT.

A guide for using the X API, the programming interface for reading and publishing content on X, formerly Twitter.

In plain words
What is it for?
It helps post tweets and threads, read timelines and mentions, search content, access user data, and track analytics and engagement.
Why use it?
It explains the authentication and platform limits needed to build reliable X integrations or bots.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: installed under .agents/ (shared by several agents); mentions Codex.

Good fit It helps post tweets and threads, read timelines and mentions, search content, access user data, and track analytics and engagement.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mturac/everything-openai-codex/x-api
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mturac/everything-openai-codex --skill x-api
Clone the repo
git clone --depth 1 https://github.com/mturac/everything-openai-codex

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for x-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/mturac/everything-openai-codex/x-api/github.svg)](https://agentmods.dev/skills/mturac/everything-openai-codex/x-api)
Your own site
<a href="https://agentmods.dev/skills/mturac/everything-openai-codex/x-api"><img src="https://agentmods.dev/badge/skills/mturac/everything-openai-codex/x-api/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for x-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/mturac/everything-openai-codex/x-api"><img src="https://agentmods.dev/badge/skills/mturac/everything-openai-codex/x-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,617 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.01617
Opus 5.5 $0.00019 $0.00647
Sonnet 5.5 $0.00010 $0.00323
Haiku 4.5 $0.00005 $0.00162

Measured 1mo ago against content hash 66b983f1374c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

x-api scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

resp = requests.get(
Origin

This is a copy

100% identical to x-api — 11 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/x-api/SKILL.md · 230 lines

How it starts

The opening of the file, as written. The whole thing — 230 lines — stays where its author put it; the contents beside it link to each section on GitHub.

X API

Programmatic interaction with X (Twitter) for posting, reading, searching, and analytics.

When to Activate

  • User wants to post tweets or threads programmatically
  • Reading timeline, mentions, or user data from X
  • Searching X for content, trends, or conversations
  • Building X integrations or bots
  • Analytics and engagement tracking
  • User says "post to X", "tweet", "X API", or "Twitter API"

Authentication

OAuth 2.0 Bearer Token (App-Only)

Best for: read-heavy operations, search, public data.

# Environment setup
export X_BEARER_TOKEN="your-bearer-token"
import os
import requests

bearer = os.environ["X_BEARER_TOKEN"]
headers = {"Authorization": f"Bearer {bearer}"}

# Search recent tweets
resp = requests.get(
    "https://api.x.com/2/tweets/search/recent",
    headers=headers,
    params={"query": "openai codex", "max_results": 10}
)
tweets = resp.json()

OAuth 1.0a (User Context)

Required for: posting tweets, managing account, DMs, and any write flow.

# Environment setup — source before use
export X_CONSUMER_KEY="your-consumer-key"
export X_CONSUMER_SECRET="your-consumer-secret"
export X_ACCESS_TOKEN="your-access-token"
export X_ACCESS_TOKEN_SECRET="your-access-token-secret"

Legacy aliases such as X_API_KEY, X_API_SECRET, and X_ACCESS_SECRET may exist in older setups. Prefer the X_CONSUMER_* and X_ACCESS_TOKEN_SECRET names when documenting or wiring new flows.

import os
from requests_oauthlib import OAuth1Session

oauth = OAuth1Session(
    os.environ["X_CONSUMER_KEY"],
    client_secret=os.environ["X_CONSUMER_SECRET"],
    resource_owner_key=os.environ["X_ACCESS_TOKEN"],
    resource_owner_secret=os.environ["X_ACCESS_TOKEN_SECRET"],
)

Core Operations

Post a Tweet

resp = oauth.post(
    "https://api.x.com/2/tweets",
    json={"text": "Hello from OpenAI Codex"}
)
resp.raise_for_status()
tweet_id = resp.json()["data"]["id"]

Post a Thread

def post_thread(oauth, tweets: list[str]) -> list[str]:
    ids = []
    reply_to = None
    for text in tweets:
        payload = {"text": text}
        if reply_to:
            payload["reply"] = {"in_reply_to_tweet_id": reply_to}
        resp = oauth.post("https://api.x.com/2/tweets", json=payload)
        tweet_id = resp.json()["data"]["id"]
        ids.append(tweet_id)
        reply_to = tweet_id
    return ids

Read the full file on GitHub · 230 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 230 lines · 48 tokens per session scan A 66b983f1374c

Subscribe to this mod's changes

x-api is a skill published in the GitHub repository mturac/everything-openai-codex (86 stars, last pushed 1mo ago), licensed MIT. It adds 48 tokens to every session and 1,617 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to x-api, differing in 11 lines, and is treated as a copy.

Related

Other skills, from other repositories

conversion-review

Review a landing page or form to find why visitors do not sign up or buy: unclear message, friction, missing proof, weak call to action. Looks at the real page on desktop and phone and ranks the fixes.

androoAGI/starnet · 47 tokens

update

Safe cc10x upgrade through the Claude Code plugin CLI. Lists every installed scope, refreshes the marketplace, updates each scope, and optionally carries local patches over to the new install. Use this skill when: updating cc10x, upgrading, pulling latest cc10x, syncing plugin, refreshing cache, or checking for new…

romiluz13/cc10x · 108 tokens

debug

Interactive debugging workflow with hypothesis-driven probe loop. Use when: unknown bugs, script errors, silent failures, troubleshooting. Not for: known bugs (use bug-fix), GitHub issue analysis (use issue-analyze), code understanding (use code-explore). Output: debug report with probe journal + root cause + fix.

sd0xdev/sd0x-harness · 67 tokens

verify

Verification loop — lint -> typecheck -> unit -> integration -> e2e.

sd0xdev/sd0x-harness · 17 tokens

simplify

Wrap-up refactoring — simplify code, eliminate duplication, preserve behavior.

sd0xdev/sd0x-harness · 16 tokens

oak-runtime-verification

Use after tests and validation pass and before the final review, whenever a change could show up at runtime - a screen, a command, an endpoint, a job or a data store - to prove the change works in the running system, including its failure path, with repeatable steps and minimal evidence.

jcarlosrodicio/opencode-agent-orchestration-kit · 65 tokens