X thread maker API
Paste an article, a newsletter or a long idea and get a ready thread for X, Threads, Bluesky or Mastodon: split at paragraphs and sentences, numbered 1/n if you like, each post within the network's limit.
- Endpoint:
POST https://postboost.co/app/api/tools/x-thread-maker(operationIdsplitThread) - Web tool: postboost.co/tools/x-thread-maker
- Token: optional (limits)
- MCP: tool
split-threadonhttps://postboost.co/mcp/tools
Request
| Field | Type | Default | Description |
|---|---|---|---|
text | string | "" | The long text, up to 10,000 characters. A line with only --- forces a new post. |
network | string: x, threads, bluesky, mastodon | "x" | |
numbering | boolean | false | End each post with " k/n". |
Call it
- curl
- Python
- Node.js
- PHP
- Go
- Ruby
- Java
- C#
- Rust
- CLI
curl -X POST https://postboost.co/app/api/tools/x-thread-maker \
-H 'Content-Type: application/json' \
-d '{"text":"Short one.\n\nShort two.\n---\nSecond post.","numbering":true}'
from postboost import ApiClient, Configuration
from postboost.api.free_tools_api import FreeToolsApi
from postboost.models import FreeToolSplitThreadRequest
with ApiClient(Configuration()) as client:
api = FreeToolsApi(client)
result = api.split_thread(FreeToolSplitThreadRequest.from_dict({"text": "Short one.\n\nShort two.\n---\nSecond post.", "numbering": True}))
print(result.to_dict())
import { FreeToolsApi } from 'postboost';
const api = new FreeToolsApi();
const { body } = await api.splitThread({ text: "Short one.\n\nShort two.\n---\nSecond post.", numbering: true });
console.log(body);
use PostBoostClient\Api\FreeToolsApi;
use PostBoostClient\Model\FreeToolSplitThreadRequest;
$api = new FreeToolsApi(new GuzzleHttp\Client());
$result = $api->splitThread(new FreeToolSplitThreadRequest(['text' => "Short one.\n\nShort two.\n---\nSecond post.", 'numbering' => true]));
echo $result;
import (
"context"
"encoding/json"
"fmt"
postboost "github.com/postboost-co/postboost-go"
)
var request postboost.FreeToolSplitThreadRequest
if err := json.Unmarshal([]byte(`{"text":"Short one.\n\nShort two.\n---\nSecond post.","numbering":true}`), &request); err != nil {
panic(err)
}
client := postboost.NewAPIClient(postboost.NewConfiguration())
result, _, err := client.FreeToolsAPI.SplitThread(context.Background()).FreeToolSplitThreadRequest(request).Execute()
fmt.Println(result, err)
require 'postboost'
api = PostBoost::FreeToolsApi.new
result = api.split_thread(PostBoost::FreeToolSplitThreadRequest.new({ text: "Short one.\n\nShort two.\n---\nSecond post.", numbering: true }))
puts result.to_hash
import com.postboost.ApiClient;
import com.postboost.api.FreeToolsApi;
import com.postboost.model.FreeToolSplitThreadRequest;
import com.postboost.model.FreeToolSplitThreadResponse;
FreeToolsApi api = new FreeToolsApi(new ApiClient());
FreeToolSplitThreadRequest request = FreeToolSplitThreadRequest.fromJson("{\"text\":\"Short one.\\n\\nShort two.\\n---\\nSecond post.\",\"numbering\":true}");
FreeToolSplitThreadResponse result = api.splitThread(request);
System.out.println(result.toJson());
using Newtonsoft.Json;
using PostBoost.Client.Api;
using PostBoost.Client.Client;
using PostBoost.Client.Model;
var api = new FreeToolsApi(new Configuration());
var request = JsonConvert.DeserializeObject<FreeToolSplitThreadRequest>(@"{""text"":""Short one.\n\nShort two.\n---\nSecond post."",""numbering"":true}");
var result = await api.SplitThreadAsync(request);
Console.WriteLine(result.ToJson());
use postboost::apis::configuration::Configuration;
use postboost::apis::free_tools_api;
use postboost::models::FreeToolSplitThreadRequest;
let config = Configuration::new();
let request: FreeToolSplitThreadRequest = serde_json::from_str(r##"{"text":"Short one.\n\nShort two.\n---\nSecond post.","numbering":true}"##)?;
let result = free_tools_api::split_thread(&config, request).await?;
println!("{:?}", result);
echo '{"text":"Short one.\n\nShort two.\n---\nSecond post.","numbering":true}' | ./postboost-cli --content-type application/json splitThread -
With a token, send Authorization: Bearer YOUR_API_TOKEN as a default header (how, per SDK).
Response
{
"limit": 280,
"posts": [
{
"text": "Short one.\n\nShort two. 1/2",
"count": 26
},
{
"text": "Second post. 2/2",
"count": 16
}
]
}
With MCP
Connect https://postboost.co/mcp/tools (setup) and ask, for example: Split long text into a thread with the PostBoost split-thread tool.
Errors
| Status | When |
|---|---|
401 | The Authorization header holds an invalid token. Leave it out to call as a guest. |
413 | The JSON body is larger than 128 KB. |
422 | A field is invalid; the body lists the errors per field. |
429 | A limit is reached; see limits. |