# Writing Styles

> Turn up to 9 example tweets into a reusable voice for presets and instant generation.

Source: https://xbeast.io/docs/styles

A writing style is a small set of example tweets that the generator imitates. It does not describe the voice in the abstract; it shows the model real posts so the output sounds like them. Attach a style to a preset or to an instant generation with `style_id`.

> **A style can hold at most 9 examples**
>
> Custom examples and tweet-bank entries share the same limit. Creating, editing and deleting a style costs no credits.

## What a style contains

- A title.
- Custom examples stored in `examples`, each one a piece of tweet text you provide.
- Optional tweet-bank entries stored in `tweet_bank_ids`. These are rows from the shared [Tweet Bank](https://xbeast.io/docs/tweet-bank.md).
- The combined custom and bank examples may not exceed 9. Remove an example before adding another when the style is full.

## Add examples

| Source | How to add it | Needs an X account |
| --- | --- | --- |
| Custom text | Paste tweet text with add_example, or replace the whole custom set with replace_custom_tweets. | No |
| X post URL | Pass a public post URL with add_from_url. XBeast fetches the post and stores it as a bank example. | Yes |
| A handle | Pass a handle with generate_from_handle. XBeast loads its recent top tweets and prefers a thread, a long post and a short post. | Yes |
| Tweet bank entries | Pass existing tweet-bank ids with replace_tweet_bank_ids. | No |

Importing an X post URL or a handle calls the X API, so the workspace needs a connected X account. The import itself is free. Adding tweet-bank ids does not call X because the posts are already stored in the bank.

## Style changes

The API accepts one change per request. These are the actions on `PATCH /api/v1/styles/:id`:

| Action | What it does |
| --- | --- |
| title | Rename the style. |
| add_example | Add one custom tweet as { text }. |
| add_from_url | Import one public X post URL as an example. |
| generate_from_handle | Replace the tweet-bank examples with recent top tweets from a handle. |
| replace_custom_tweets | Replace all custom examples with an array of texts. |
| replace_tweet_bank_ids | Replace the tweet-bank examples with an array of ids. |
| remove_example_id | Remove one example by bank id, index or example text. |

## Use a style

- In a preset, set `style_id`. Every scheduled run of that preset uses the style. See [Presets](https://xbeast.io/docs/presets.md).
- In instant generation, pass `style_id` with the prompt and format. Owned styles and community styles both work. See [Generation modes](https://xbeast.io/docs/generation-modes.md).
- Using a style does not add credits. You still pay the normal generation cost for the post.

## Community styles

Community styles are shared across XBeast and are read-only. You can use one in a preset or generation, but you cannot edit or delete it. To customize the voice, create your own style and add the examples you want.

## Manage styles

In the app, open the style picker from the preset editor, the Drafts generator or https://xbeast.io/generate and choose **Manage Styles**. The public API exposes the same operations: create a style, update it, add an example through `POST /api/v1/styles/:id/examples`, remove one, or delete the style. The full request list is in the [Styles API reference](https://xbeast.io/docs/api-styles.md).

## Deleting a style

Deleting a style removes its examples immediately. Presets that pointed at it keep their other fields but lose the style, so pick another style or clear `style_id` before the next run.

## Related

- [Presets: use style_id in a preset](https://xbeast.io/docs/presets.md)
- [Generation modes: use style_id in an instant generation](https://xbeast.io/docs/generation-modes.md)
- [Tweet Bank: where imported examples come from](https://xbeast.io/docs/tweet-bank.md)
- [Styles API reference](https://xbeast.io/docs/api-styles.md)

[Go to Presets](https://xbeast.io/presets)

[Open the Drafts generator](https://xbeast.io/drafts)
