# Publish to X

> Create your X developer app, connect it, and publish within the limits of X.

Source: https://stuarty.com/docs/publish/x/

Stuarty publishes to X through a developer app that you create and own (ADR-0035): no Stuarty account stands between you and X, and the secret stays in your vault.

## Set up the developer app

X charges for use of its API, by the post, and Stuarty shows the price before it asks you to approve.

1. Open the X developer console, and create a project and an app.
2. Set the type of the app to a **web app** (a confidential client).
3. Add `<your Stuarty address>/social/callback` as a callback address. The Connections page of Stuarty shows the exact value.
4. Copy the client id and the client secret.
5. Buy credits in the console: the API is pay per use.
6. In Stuarty, open **Connections**, choose **Connect**, pick X, and paste the client id and the client secret. The secret goes into the vault.
7. Sign in and accept the permissions.

The price of a post, and of a post with a link, is in the section The price of a post under Limits, with its source and date. X changes its prices: you can correct the price on the Connections page, and a change edits the estimate of the next approval, never one you have already seen.

A post to X has no thumbnail in Stuarty: a thumbnail on a post to X is refused rather than dropped. The video is sent in chunks from your machine.

## Permissions and hosts

The sign-in asks for these permissions and no others:

- `tweet.read`
- `tweet.write`
- `users.read`
- `media.write`
- `offline.access`

The only hosts Stuarty contacts for X: `api.x.com`. They are contacted only after you create the connection.

The official guide is [here](https://docs.x.com/x-api/getting-started/pricing) (read on 2026-11-20).

## Limits

These are the limits Stuarty checks a post to X against before anything is sent (`publish:validate`). A post that breaks one is refused with the limit named, and nothing leaves your machine.

| Limit | Value |
| --- | --- |
| Title | at most 1000 characters |
| Description | at most 4000 bytes |
| Tags | at most 1000 characters in all |
| Video file | at most 8 GB |
| Video formats | mp4 |
| Video codecs | h264 |
| Audio codecs | aac |
| Shortest video | 0.5 s |
| Longest video | 20 min |
| Frame rate | any to 60 fps |
| Export size of the preset | 720 x 1280 |
| Thumbnail | not sent |
| Visibility | public |

### Where the numbers come from

- [X: the page for the post](https://docs.x.com/x-api/media/quickstart/best-practices.md), read on 2026-11-20.
- [The page for the video](https://docs.x.com/x-api/media/quickstart/best-practices.md), read on 2026-11-19: H.264 High, 4:2:0, AAC-LC, at most 60 fps, aspect 1:3 to 3:1, 5,000 kbit/s video and 128 kbit/s audio; its 1280x1024 limit contradicts the sizes it recommends and is not enforced.
- [The page for the video](https://docs.x.com/x-api/media/quickstart/media-upload-chunked), read on 2026-11-19: a post video lasts up to 20 minutes and 8 GB by default.

### The price of a post

X charges for use of its API: 0.015 USD for a post and 0.2 USD for a post with a link, on 2026-11-20 ([source](https://docs.x.com/x-api/getting-started/pricing)). The approval of a post shows the price Stuarty has; you can correct it on the Connections page when X changes it.

X publishes only after you approve the post.
