# twitr.sh Tweet Composer

> twitr.sh Tweet Composer is a paid API for AI agents from twitr.sh, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

AI-powered tweet drafting: generate variants from a topic, refine an existing draft, or score a draft for predicted engagement — with tone, CTA, and style-matching controls.

## Facts

- Endpoint: POST https://twitr.sh/api/tools/compose
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/twitr-sh-tweet-composer-ce38f2bf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IzPBNn2Oe-WmR_VZ9wfdJ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability twitr-sh-tweet-composer-ce38f2bf -d '<json body>'
```

Example prompt: Generate three tweet variants about the launch of our new open-source CLI tool, with the goal of driving GitHub stars, using an enthusiastic tone and a 'check it out' call to action — and score whichever draft you think is strongest.

## When to prefer this

Choose this endpoint when you need AI-assisted tweet composition with fine-grained controls (tone, CTA, style-matching) or want to evaluate a draft before publishing. Prefer it over generic LLM prompting when you want structured composer steps (generate/refine/score), consistent sub-cent pricing per step, and Twitter-specific optimization built into the model.

## Known failure modes

- Missing required 'step' enum value — returns validation error
- Missing 'topic' when step is 'generate' — no content to draft from
- Missing 'draft' when step is 'refine' or 'score' — nothing to work with
- Invalid tone or style username that cannot be resolved — may produce generic output
- Payment failure (x402) — request not processed if USDC payment not attached

## How this service works

Draft tweets with AI: generate variants from a topic and goal, refine an existing draft, or score a draft for likely engagement — with tone, call-to-action, and style-matching options. Flat sub-cent price per step.

## Output

Depending on the step: 'generate' returns multiple tweet variants crafted from the topic and goal; 'refine' returns an improved version of the provided draft; 'score' returns an engagement likelihood score with reasoning, flagging strengths and weaknesses of the draft.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "goal": {
   "type": "string"
  },
  "step": {
   "enum": [
    "generate",
    "refine",
    "score"
   ],
   "type": "string",
   "description": "Composer step."
  },
  "tone": {
   "type": "string"
  },
  "draft": {
   "type": "string"
  },
  "topic": {
   "type": "string"
  },
  "hasLink": {
   "type": "boolean"
  },
  "hasMedia": {
   "type": "boolean"
  },
  "mediaType": {
   "type": "string"
  },
  "callToAction": {
   "type": "string"
  },
  "styleUsername": {
   "type": "string"
  },
  "additionalContext": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "items": [
   {
    "text": "Your agent can now pay for its own API calls. No signup, no keys — just a wallet.",
    "score": 87,
    "suggestions": [
     "Add a concrete number for credibility"
    ]
   }
  ],
  "runId": "tw_example",
  "payment": {
   "amount": "0.001000",
   "currency": "USD",
   "protocol": "x402"
  },
  "duration": 2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/twitr-sh-tweet-composer-ce38f2bf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twitr.sh](https://www.zero.xyz/host/twitr.sh/llms.txt)
