{
  "openapi": "3.1.0",
  "info": {
    "title": "Thread Kit",
    "version": "1.6.0",
    "description": "Thread splitter, post length checker, AI thread writer and AI short-video script writer for AI agents: X (Twitter), Bluesky, Farcaster, Mastodon and Threads (Meta), each counted the way that network counts, plus timed TikTok / Reels / YouTube Shorts scripts with SRT subtitles, $0.001-$0.02 per call in USDC on Base via x402 or MPP (or USDC.e on Tempo via MPP). No API keys, no accounts. Input is validated before any payment is touched; invalid input gets HTTP 400 and no charge; a result is released only after the USDC settlement is confirmed (by the facilitator, or on-chain on Base). If settlement cannot be confirmed you get HTTP 402 and no result. Prepaid credits: GET /v1/credits/starter ($0.25, 400 credits) or /v1/credits/creator ($1.00, 2000 credits) over x402 or MPP, or a plain USDC transfer on Base (GET /v1/credits/quote?pack=creator&from=<your address>, then /v1/credits/claim?quote=<id>), returns a key; send \"Authorization: Bearer <key>\" on any paid route or on POST /mcp and the call is paid from the credits (1 credit = $0.001 of list price). GET /v1/credits explains it; GET /v1/credits/balance shows what is left.",
    "x-guidance": "To post a long text as an X thread: GET /v1/x/thread?text=<url-encoded text>&numbering=suffix and post .posts[i].text in order, each as a reply to the previous one. To check or shorten a single post: GET /v1/x/check?text=<url-encoded text>; if .valid is false use .fitted. Every returned post fits X's weighted limit (CJK and emoji count 2, links 23). Max 4000 characters per call. Invalid input returns 400 and is not charged. Same for Bluesky, Farcaster, Mastodon and Threads (Meta): GET /v1/{bluesky|farcaster|mastodon|meta-threads}/thread?text=<url-encoded text> returns .posts that each fit that network's limit, counted its way (Bluesky 300 graphemes + 3000 bytes, Farcaster 320 UTF-8 bytes, Mastodon 500 graphemes with links 23, Threads 500 characters with emoji = UTF-8 bytes); GET /v1/{network}/check?text=... checks one post and gives .fitted. To have the thread written for you from an article, notes or a transcript: GET /v1/write/thread?text=<url-encoded source>&platform=x ($0.01; an open model writes it, then every post is length-checked for that network; links not in the source are removed; a failed generation is not charged). To turn the same kind of source into a short vertical video script (TikTok, Instagram Reels, YouTube Shorts): GET /v1/write/shorts?text=<url-encoded source>&seconds=30 ($0.02; returns timed beats with voiceover, on-screen text and a shot description each, plus title, caption, hashtags and .srt subtitles; the script is timed from speaking rate to fit the length you ask for; a failed generation is not charged). Free: GET /v1/x/demo (sample output), GET /v1/x/rules, GET /v1/platforms/rules, GET /v1/write/example, GET /v1/write/shorts-example. Prepaid credits: GET /v1/credits/starter ($0.25, 400 credits) or /v1/credits/creator ($1.00, 2000 credits) over x402 or MPP, or a plain USDC transfer on Base (GET /v1/credits/quote?pack=creator&from=<your address>, then /v1/credits/claim?quote=<id>), returns a key; send \"Authorization: Bearer <key>\" on any paid route or on POST /mcp and the call is paid from the credits (1 credit = $0.001 of list price). GET /v1/credits explains it; GET /v1/credits/balance shows what is left."
  },
  "x-service-info": {
    "categories": [
      "social",
      "ai",
      "developer-tools"
    ],
    "docs": {
      "homepage": "https://thread-kit.agent-arena-base.workers.dev/",
      "llms": "https://thread-kit.agent-arena-base.workers.dev/llms.txt",
      "apiReference": "https://thread-kit.agent-arena-base.workers.dev/openapi.json"
    }
  },
  "x-agentcash-guidance": {
    "llmsTxtUrl": "https://thread-kit.agent-arena-base.workers.dev/llms.txt"
  },
  "servers": [
    {
      "url": "https://thread-kit.agent-arena-base.workers.dev"
    }
  ],
  "paths": {
    "/v1/x/thread": {
      "get": {
        "summary": "Split text into an X (Twitter) thread",
        "description": "Split long text (up to 4000 characters, any language) into an X thread where every post fits the limit by X's own weighted count (twitter-text v3: CJK/Japanese/Korean and emoji count 2, every link counts 23, NFC). Breaks at paragraph, then sentence, then clause, then word boundaries (CJK-aware: never starts a post with closing punctuation), never inside a URL, @mention, #hashtag or $cashtag, and adds n/N numbering (suffix, prefix or none) that is included in the count. Returns posts with weighted lengths. Pure computation, nothing stored.",
        "operationId": "x_thread",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "2000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "2000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "2000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "2000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "description": "Text to split (URL-encoded, max 4000 characters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max weighted length per post, 100-280 (default 280)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "numbering",
            "in": "query",
            "required": false,
            "description": "Where to put \"n/N\": suffix (default), prefix or none. A single post is never numbered.",
            "schema": {
              "type": "string",
              "enum": [
                "suffix",
                "prefix",
                "none"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "posts"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "numbering": {
                      "type": "string"
                    },
                    "sourceWeightedLength": {
                      "type": "number"
                    },
                    "sourceCodePoints": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "n": {
                            "type": "integer"
                          },
                          "text": {
                            "type": "string"
                          },
                          "weightedLength": {
                            "type": "number"
                          },
                          "remaining": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "post": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "linksCounted": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "counted": {
                            "type": "integer"
                          },
                          "rule": {
                            "type": "string",
                            "enum": [
                              "link",
                              "ambiguous"
                            ]
                          }
                        }
                      }
                    },
                    "rules": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "count": 2,
                  "limit": 280,
                  "numbering": "suffix",
                  "sourceWeightedLength": 470,
                  "sourceCodePoints": 443,
                  "posts": [
                    {
                      "n": 1,
                      "text": "Why do an agent's posts get rejected? X does not count characters, it counts weight: every Chinese, Japanese or Korean character and every emoji counts 2, and every link counts 23 however long it is. 中文帖子尤其容易超长：每个汉字和中文标点都算 2 个字符，140 个字就到上限了。 1/2",
                      "weightedLength": 279,
                      "remaining": 1
                    },
                    {
                      "n": 2,
                      "text": "链接不管多长都算 23。 Thread Kit splits at paragraph, sentence and clause boundaries, keeps links and @mentions whole, and re-checks every post before returning it. Rules: https://github.com/twitter/twitter-text 2/2",
                      "weightedLength": 199,
                      "remaining": 81
                    }
                  ],
                  "warnings": [],
                  "linksCounted": [
                    {
                      "text": "https://github.com/twitter/twitter-text",
                      "counted": 23,
                      "rule": "link"
                    }
                  ],
                  "rules": "twitter-text v3 weighting: NFC; U+0000-U+10FF and General Punctuation subsets count 1, other code points 2, each emoji 2, each link 23; ambiguous links counted high."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/x/check": {
      "get": {
        "summary": "Check an X (Twitter) post length",
        "description": "Exact weighted length of one X post by twitter-text v3 rules (CJK/Japanese/Korean and emoji count 2, links count 23, NFC normalization): valid or not, remaining characters, which links were counted as 23, emoji and wide-character counts, invalid characters X rejects, and a \"fitted\" version cut at a sentence/word boundary with an ellipsis when the post is too long. limit defaults to 280 (up to 25000 for long posts). Pure computation, nothing stored.",
        "operationId": "x_check",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "1000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "1000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "1000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "1000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "description": "The post text (URL-encoded, max 4000 characters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Limit to check against, 1-25000 (default 280)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "valid",
                    "weightedLength"
                  ],
                  "properties": {
                    "valid": {
                      "type": "boolean"
                    },
                    "weightedLength": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "remaining": {
                      "type": "number"
                    },
                    "codePoints": {
                      "type": "integer"
                    },
                    "breakdown": {
                      "type": "object",
                      "properties": {
                        "links": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "text": {
                                "type": "string"
                              },
                              "counted": {
                                "type": "integer"
                              },
                              "rule": {
                                "type": "string",
                                "enum": [
                                  "link",
                                  "ambiguous"
                                ]
                              }
                            }
                          }
                        },
                        "emoji": {
                          "type": "integer"
                        },
                        "wideChars": {
                          "type": "integer"
                        }
                      }
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "post": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "fitted": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fittedWeightedLength": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "rules": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "valid": true,
                  "weightedLength": 72,
                  "limit": 280,
                  "remaining": 208,
                  "codePoints": 87,
                  "breakdown": {
                    "links": [
                      {
                        "text": "https://example.com/a/very/long/path?with=query",
                        "counted": 23,
                        "rule": "link"
                      }
                    ],
                    "emoji": 1,
                    "wideChars": 8
                  },
                  "issues": [],
                  "fitted": null,
                  "fittedWeightedLength": null,
                  "rules": "twitter-text v3 weighting: NFC; U+0000-U+10FF and General Punctuation subsets count 1, other code points 2, each emoji 2, each link 23; ambiguous links counted high."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/bluesky/thread": {
      "get": {
        "summary": "Split text into a Bluesky thread (300 graphemes per post)",
        "description": "Split long text (up to 4000 characters, any language) into a Bluesky thread where every post fits the limit, counted the way Bluesky counts (graphemes (and at most 3000 UTF-8 bytes); default limit 300). Bluesky (app.bsky.feed.post): at most 300 graphemes and at most 3000 UTF-8 bytes. Links are counted as written; if your client shortens link text with a facet the post is shorter than reported. Breaks at paragraph, then sentence, then clause, then word boundaries (CJK-aware), never inside a URL, adds n/N numbering (suffix, prefix or none) that is included in the count, and re-checks every post. Returns posts with length, bytes and graphemes. Pure computation, nothing stored.",
        "operationId": "bluesky_thread",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "2000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "2000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "2000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "2000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "description": "Text to split (URL-encoded, max 4000 characters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max length per post in graphemes (and at most 3000 UTF-8 bytes), 50-300 (default 300)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "numbering",
            "in": "query",
            "required": false,
            "description": "Where to put \"n/N\": suffix (default), prefix or none. A single post is never numbered.",
            "schema": {
              "type": "string",
              "enum": [
                "suffix",
                "prefix",
                "none"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "posts"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "numbering": {
                      "type": "string"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "sourceLength": {
                      "type": "number"
                    },
                    "sourceBytes": {
                      "type": "integer"
                    },
                    "sourceGraphemes": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "n": {
                            "type": "integer"
                          },
                          "text": {
                            "type": "string"
                          },
                          "length": {
                            "type": "number"
                          },
                          "remaining": {
                            "type": "number"
                          },
                          "bytes": {
                            "type": "integer"
                          },
                          "graphemes": {
                            "type": "integer"
                          },
                          "links": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "post": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "rules": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "count": 2,
                  "platform": "bluesky",
                  "limit": 300,
                  "numbering": "suffix",
                  "unit": "graphemes (and at most 3000 UTF-8 bytes)",
                  "sourceLength": 519,
                  "sourceBytes": 566,
                  "sourceGraphemes": 519,
                  "posts": [
                    {
                      "n": 1,
                      "text": "Why do an agent's posts get rejected outside X? Every network counts differently. Bluesky allows 300 graphemes and 3000 bytes. Farcaster counts UTF-8 bytes: 320 per cast, up to 1024 for a long cast. Mastodon counts graphemes and every link as 23. 1/2",
                      "length": 250,
                      "remaining": 50,
                      "bytes": 250,
                      "graphemes": 250,
                      "links": 0
                    },
                    {
                      "n": 2,
                      "text": "Threads by Meta allows 500 characters and counts each emoji as its UTF-8 bytes 🧵 中文在 Farcaster 上每个汉字算 3 个字节，一百来个字就满了。 Thread Kit breaks at paragraph, sentence and clause boundaries, keeps links whole and re-checks every post. Spec: https://github.com/farcasterxyz/protocol 2/2",
                      "length": 276,
                      "remaining": 24,
                      "bytes": 323,
                      "graphemes": 276,
                      "links": 1
                    }
                  ],
                  "warnings": [
                    {
                      "code": "LINKS_COUNTED_AS_WRITTEN",
                      "message": "Links are counted at their full written length (no facet shortening assumed)."
                    }
                  ],
                  "rules": "Bluesky (app.bsky.feed.post): at most 300 graphemes and at most 3000 UTF-8 bytes. Links are counted as written; if your client shortens link text with a facet the post is shorter than reported."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/bluesky/check": {
      "get": {
        "summary": "Check a Bluesky post length (graphemes and bytes)",
        "description": "Exact length of one Bluesky post, counted the way Bluesky counts (graphemes (and at most 3000 UTF-8 bytes); default limit 300): valid or not, remaining, graphemes, UTF-8 bytes, links, and a \"fitted\" version cut at a sentence/word boundary with an ellipsis when it is too long. Bluesky (app.bsky.feed.post): at most 300 graphemes and at most 3000 UTF-8 bytes. Links are counted as written; if your client shortens link text with a facet the post is shorter than reported. Pure computation, nothing stored.",
        "operationId": "bluesky_check",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "1000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "1000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "1000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "1000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "description": "The post text (URL-encoded, max 4000 characters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Limit to check against in graphemes (and at most 3000 UTF-8 bytes), 1-300 (default 300)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "valid",
                    "length"
                  ],
                  "properties": {
                    "platform": {
                      "type": "string"
                    },
                    "valid": {
                      "type": "boolean"
                    },
                    "length": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "remaining": {
                      "type": "number"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "graphemes": {
                      "type": "integer"
                    },
                    "bytes": {
                      "type": "integer"
                    },
                    "codePoints": {
                      "type": "integer"
                    },
                    "links": {
                      "type": "integer"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "post": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "fitted": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fittedLength": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "rules": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "platform": "bluesky",
                  "valid": false,
                  "length": 519,
                  "limit": 300,
                  "remaining": -219,
                  "unit": "graphemes (and at most 3000 UTF-8 bytes)",
                  "graphemes": 519,
                  "bytes": 566,
                  "codePoints": 519,
                  "links": 1,
                  "issues": [
                    {
                      "code": "OVER_LIMIT",
                      "message": "Length 519 (graphemes (and at most 3000 UTF-8 bytes)) exceeds 300 by 219."
                    }
                  ],
                  "fitted": "Why do an agent's posts get rejected outside X? Every network counts differently. Bluesky allows 300 graphemes and 3000 bytes. Farcaster counts UTF-8 bytes: 320 per cast, up to 1024 for a long cast. Mastodon counts graphemes and every link as 23.…",
                  "fittedLength": 247,
                  "rules": "Bluesky (app.bsky.feed.post): at most 300 graphemes and at most 3000 UTF-8 bytes. Links are counted as written; if your client shortens link text with a facet the post is shorter than reported."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/farcaster/thread": {
      "get": {
        "summary": "Split text into a Farcaster cast thread (320 bytes per cast)",
        "description": "Split long text (up to 4000 characters, any language) into a Farcaster thread where every post fits the limit, counted the way Farcaster counts (UTF-8 bytes; default limit 320 (pass limit up to 1024)). Farcaster (protocol spec, CastAddBody): a cast is at most 320 UTF-8 bytes; 321-1024 bytes is a long cast. Mentions are stored outside the text, so @names left in the text are counted as bytes (high). Up to 2 embeds per cast, not counted in the text. Breaks at paragraph, then sentence, then clause, then word boundaries (CJK-aware), never inside a URL, adds n/N numbering (suffix, prefix or none) that is included in the count, and re-checks every post. Returns posts with length, bytes and graphemes. Pure computation, nothing stored.",
        "operationId": "farcaster_thread",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "2000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "2000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "2000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "2000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "description": "Text to split (URL-encoded, max 4000 characters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max length per post in UTF-8 bytes, 50-1024 (default 320)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "numbering",
            "in": "query",
            "required": false,
            "description": "Where to put \"n/N\": suffix (default), prefix or none. A single post is never numbered.",
            "schema": {
              "type": "string",
              "enum": [
                "suffix",
                "prefix",
                "none"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "posts"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "numbering": {
                      "type": "string"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "sourceLength": {
                      "type": "number"
                    },
                    "sourceBytes": {
                      "type": "integer"
                    },
                    "sourceGraphemes": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "n": {
                            "type": "integer"
                          },
                          "text": {
                            "type": "string"
                          },
                          "length": {
                            "type": "number"
                          },
                          "remaining": {
                            "type": "number"
                          },
                          "bytes": {
                            "type": "integer"
                          },
                          "graphemes": {
                            "type": "integer"
                          },
                          "links": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "post": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "rules": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "count": 3,
                  "platform": "farcaster",
                  "limit": 320,
                  "numbering": "suffix",
                  "unit": "UTF-8 bytes",
                  "sourceLength": 566,
                  "sourceBytes": 566,
                  "sourceGraphemes": 519,
                  "posts": [
                    {
                      "n": 1,
                      "text": "Why do an agent's posts get rejected outside X? Every network counts differently. Bluesky allows 300 graphemes and 3000 bytes. Farcaster counts UTF-8 bytes: 320 per cast, up to 1024 for a long cast. Mastodon counts graphemes and every link as 23. 1/3",
                      "length": 250,
                      "remaining": 70,
                      "bytes": 250,
                      "graphemes": 250,
                      "links": 0
                    },
                    {
                      "n": 2,
                      "text": "Threads by Meta allows 500 characters and counts each emoji as its UTF-8 bytes 🧵 中文在 Farcaster 上每个汉字算 3 个字节，一百来个字就满了。 Thread Kit breaks at paragraph, sentence and clause boundaries, keeps links whole and re-checks every post. 2/3",
                      "length": 276,
                      "remaining": 44,
                      "bytes": 276,
                      "graphemes": 229,
                      "links": 0
                    },
                    {
                      "n": 3,
                      "text": "Spec: https://github.com/farcasterxyz/protocol 3/3",
                      "length": 50,
                      "remaining": 270,
                      "bytes": 50,
                      "graphemes": 50,
                      "links": 1
                    }
                  ],
                  "warnings": [],
                  "rules": "Farcaster (protocol spec, CastAddBody): a cast is at most 320 UTF-8 bytes; 321-1024 bytes is a long cast. Mentions are stored outside the text, so @names left in the text are counted as bytes (high). Up to 2 embeds per cast, not counted in the text."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/farcaster/check": {
      "get": {
        "summary": "Check a Farcaster cast length (UTF-8 bytes)",
        "description": "Exact length of one Farcaster post, counted the way Farcaster counts (UTF-8 bytes; default limit 320 (pass limit up to 1024)): valid or not, remaining, graphemes, UTF-8 bytes, links, and a \"fitted\" version cut at a sentence/word boundary with an ellipsis when it is too long. Farcaster (protocol spec, CastAddBody): a cast is at most 320 UTF-8 bytes; 321-1024 bytes is a long cast. Mentions are stored outside the text, so @names left in the text are counted as bytes (high). Up to 2 embeds per cast, not counted in the text. Pure computation, nothing stored.",
        "operationId": "farcaster_check",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "1000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "1000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "1000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "1000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "description": "The post text (URL-encoded, max 4000 characters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Limit to check against in UTF-8 bytes, 1-1024 (default 320)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "valid",
                    "length"
                  ],
                  "properties": {
                    "platform": {
                      "type": "string"
                    },
                    "valid": {
                      "type": "boolean"
                    },
                    "length": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "remaining": {
                      "type": "number"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "graphemes": {
                      "type": "integer"
                    },
                    "bytes": {
                      "type": "integer"
                    },
                    "codePoints": {
                      "type": "integer"
                    },
                    "links": {
                      "type": "integer"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "post": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "fitted": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fittedLength": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "rules": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "platform": "farcaster",
                  "valid": false,
                  "length": 566,
                  "limit": 320,
                  "remaining": -246,
                  "unit": "UTF-8 bytes",
                  "graphemes": 519,
                  "bytes": 566,
                  "codePoints": 519,
                  "links": 1,
                  "issues": [
                    {
                      "code": "OVER_LIMIT",
                      "message": "Length 566 (UTF-8 bytes) exceeds 320 by 246."
                    }
                  ],
                  "fitted": "Why do an agent's posts get rejected outside X? Every network counts differently. Bluesky allows 300 graphemes and 3000 bytes. Farcaster counts UTF-8 bytes: 320 per cast, up to 1024 for a long cast. Mastodon counts graphemes and every link as 23.…",
                  "fittedLength": 249,
                  "rules": "Farcaster (protocol spec, CastAddBody): a cast is at most 320 UTF-8 bytes; 321-1024 bytes is a long cast. Mentions are stored outside the text, so @names left in the text are counted as bytes (high). Up to 2 embeds per cast, not counted in the text."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/mastodon/thread": {
      "get": {
        "summary": "Split text into a Mastodon thread (500 characters, links count 23)",
        "description": "Split long text (up to 4000 characters, any language) into a Mastodon thread where every post fits the limit, counted the way Mastodon counts (grapheme clusters, each URL 23; default limit 500 (pass limit up to 10000)). Mastodon (StatusLengthValidator): grapheme clusters; every URL counts 23; @user@domain counts as @user. Default instance limit 500 (pass limit for instances with a different max). We count @user@domain in full and unsure link-like text at max(23, own length), so results may leave a little room unused. A content warning (spoiler text) also counts toward the limit and is not included here. Breaks at paragraph, then sentence, then clause, then word boundaries (CJK-aware), never inside a URL, adds n/N numbering (suffix, prefix or none) that is included in the count, and re-checks every post. Returns posts with length, bytes and graphemes. Pure computation, nothing stored.",
        "operationId": "mastodon_thread",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "2000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "2000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "2000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "2000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "description": "Text to split (URL-encoded, max 4000 characters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max length per post in grapheme clusters, each URL 23, 100-10000 (default 500)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "numbering",
            "in": "query",
            "required": false,
            "description": "Where to put \"n/N\": suffix (default), prefix or none. A single post is never numbered.",
            "schema": {
              "type": "string",
              "enum": [
                "suffix",
                "prefix",
                "none"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "posts"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "numbering": {
                      "type": "string"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "sourceLength": {
                      "type": "number"
                    },
                    "sourceBytes": {
                      "type": "integer"
                    },
                    "sourceGraphemes": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "n": {
                            "type": "integer"
                          },
                          "text": {
                            "type": "string"
                          },
                          "length": {
                            "type": "number"
                          },
                          "remaining": {
                            "type": "number"
                          },
                          "bytes": {
                            "type": "integer"
                          },
                          "graphemes": {
                            "type": "integer"
                          },
                          "links": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "post": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "rules": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "count": 2,
                  "platform": "mastodon",
                  "limit": 500,
                  "numbering": "suffix",
                  "unit": "grapheme clusters, each URL 23",
                  "sourceLength": 502,
                  "sourceBytes": 566,
                  "sourceGraphemes": 519,
                  "posts": [
                    {
                      "n": 1,
                      "text": "Why do an agent's posts get rejected outside X? Every network counts differently. Bluesky allows 300 graphemes and 3000 bytes. Farcaster counts UTF-8 bytes: 320 per cast, up to 1024 for a long cast. Mastodon counts graphemes and every link as 23. Threads by Meta allows 500 characters and counts each emoji as its UTF-8 bytes 🧵 中文在 Farcaster 上每个汉字算 3 个字节，一百来个字就满了。 Thread Kit breaks at paragraph, sentence and clause boundaries, keeps links whole and re-checks every post. 1/2",
                      "length": 476,
                      "remaining": 24,
                      "bytes": 523,
                      "graphemes": 476,
                      "links": 0
                    },
                    {
                      "n": 2,
                      "text": "Spec: https://github.com/farcasterxyz/protocol 2/2",
                      "length": 33,
                      "remaining": 467,
                      "bytes": 50,
                      "graphemes": 50,
                      "links": 1
                    }
                  ],
                  "warnings": [],
                  "rules": "Mastodon (StatusLengthValidator): grapheme clusters; every URL counts 23; @user@domain counts as @user. Default instance limit 500 (pass limit for instances with a different max). We count @user@domain in full and unsure link-like text at max(23, own length), so results may leave a little room unused. A content warning (spoiler text) also counts toward the limit and is not included here."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/mastodon/check": {
      "get": {
        "summary": "Check a Mastodon post (toot) length",
        "description": "Exact length of one Mastodon post, counted the way Mastodon counts (grapheme clusters, each URL 23; default limit 500 (pass limit up to 10000)): valid or not, remaining, graphemes, UTF-8 bytes, links, and a \"fitted\" version cut at a sentence/word boundary with an ellipsis when it is too long. Mastodon (StatusLengthValidator): grapheme clusters; every URL counts 23; @user@domain counts as @user. Default instance limit 500 (pass limit for instances with a different max). We count @user@domain in full and unsure link-like text at max(23, own length), so results may leave a little room unused. A content warning (spoiler text) also counts toward the limit and is not included here. Pure computation, nothing stored.",
        "operationId": "mastodon_check",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "1000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "1000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "1000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "1000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "description": "The post text (URL-encoded, max 4000 characters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Limit to check against in grapheme clusters, each URL 23, 1-10000 (default 500)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "valid",
                    "length"
                  ],
                  "properties": {
                    "platform": {
                      "type": "string"
                    },
                    "valid": {
                      "type": "boolean"
                    },
                    "length": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "remaining": {
                      "type": "number"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "graphemes": {
                      "type": "integer"
                    },
                    "bytes": {
                      "type": "integer"
                    },
                    "codePoints": {
                      "type": "integer"
                    },
                    "links": {
                      "type": "integer"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "post": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "fitted": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fittedLength": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "rules": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "platform": "mastodon",
                  "valid": false,
                  "length": 502,
                  "limit": 500,
                  "remaining": -2,
                  "unit": "grapheme clusters, each URL 23",
                  "graphemes": 519,
                  "bytes": 566,
                  "codePoints": 519,
                  "links": 1,
                  "issues": [
                    {
                      "code": "OVER_LIMIT",
                      "message": "Length 502 (grapheme clusters, each URL 23) exceeds 500 by 2."
                    }
                  ],
                  "fitted": "Why do an agent's posts get rejected outside X? Every network counts differently. Bluesky allows 300 graphemes and 3000 bytes. Farcaster counts UTF-8 bytes: 320 per cast, up to 1024 for a long cast. Mastodon counts graphemes and every link as 23. Threads by Meta allows 500 characters and counts each emoji as its UTF-8 bytes 🧵 中文在 Farcaster 上每个汉字算 3 个字节，一百来个字就满了。 Thread Kit breaks at paragraph, sentence and clause boundaries, keeps links whole and re-checks every post.…",
                  "fittedLength": 473,
                  "rules": "Mastodon (StatusLengthValidator): grapheme clusters; every URL counts 23; @user@domain counts as @user. Default instance limit 500 (pass limit for instances with a different max). We count @user@domain in full and unsure link-like text at max(23, own length), so results may leave a little room unused. A content warning (spoiler text) also counts toward the limit and is not included here."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/meta-threads/thread": {
      "get": {
        "summary": "Split text into a Threads (Meta) post chain (500 characters, emoji = bytes)",
        "description": "Split long text (up to 4000 characters, any language) into a Threads (Meta) thread where every post fits the limit, counted the way Threads (Meta) counts (characters, each emoji = its UTF-8 bytes; default limit 500). Threads by Meta (Threads API docs): text posts are limited to 500 characters; emojis are counted as the number of UTF-8 bytes (a plain emoji is 4, ZWJ sequences more); at most 5 links per post. Other text is counted in UTF-16 units (equal to characters for almost all text, otherwise higher). Breaks at paragraph, then sentence, then clause, then word boundaries (CJK-aware), never inside a URL, adds n/N numbering (suffix, prefix or none) that is included in the count, and re-checks every post. Returns posts with length, bytes and graphemes. Pure computation, nothing stored.",
        "operationId": "meta_threads_thread",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "2000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "2000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "2000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "2000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "description": "Text to split (URL-encoded, max 4000 characters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max length per post in characters, each emoji = its UTF-8 bytes, 100-500 (default 500)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "numbering",
            "in": "query",
            "required": false,
            "description": "Where to put \"n/N\": suffix (default), prefix or none. A single post is never numbered.",
            "schema": {
              "type": "string",
              "enum": [
                "suffix",
                "prefix",
                "none"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "posts"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "numbering": {
                      "type": "string"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "sourceLength": {
                      "type": "number"
                    },
                    "sourceBytes": {
                      "type": "integer"
                    },
                    "sourceGraphemes": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "n": {
                            "type": "integer"
                          },
                          "text": {
                            "type": "string"
                          },
                          "length": {
                            "type": "number"
                          },
                          "remaining": {
                            "type": "number"
                          },
                          "bytes": {
                            "type": "integer"
                          },
                          "graphemes": {
                            "type": "integer"
                          },
                          "links": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "post": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "rules": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "count": 2,
                  "platform": "meta-threads",
                  "limit": 500,
                  "numbering": "suffix",
                  "unit": "characters, each emoji = its UTF-8 bytes",
                  "sourceLength": 522,
                  "sourceBytes": 566,
                  "sourceGraphemes": 519,
                  "posts": [
                    {
                      "n": 1,
                      "text": "Why do an agent's posts get rejected outside X? Every network counts differently. Bluesky allows 300 graphemes and 3000 bytes. Farcaster counts UTF-8 bytes: 320 per cast, up to 1024 for a long cast. Mastodon counts graphemes and every link as 23. Threads by Meta allows 500 characters and counts each emoji as its UTF-8 bytes 🧵 中文在 Farcaster 上每个汉字算 3 个字节，一百来个字就满了。 Thread Kit breaks at paragraph, sentence and clause boundaries, keeps links whole and re-checks every post. 1/2",
                      "length": 479,
                      "remaining": 21,
                      "bytes": 523,
                      "graphemes": 476,
                      "links": 0
                    },
                    {
                      "n": 2,
                      "text": "Spec: https://github.com/farcasterxyz/protocol 2/2",
                      "length": 50,
                      "remaining": 450,
                      "bytes": 50,
                      "graphemes": 50,
                      "links": 1
                    }
                  ],
                  "warnings": [],
                  "rules": "Threads by Meta (Threads API docs): text posts are limited to 500 characters; emojis are counted as the number of UTF-8 bytes (a plain emoji is 4, ZWJ sequences more); at most 5 links per post. Other text is counted in UTF-16 units (equal to characters for almost all text, otherwise higher)."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/meta-threads/check": {
      "get": {
        "summary": "Check a Threads (Meta) post length",
        "description": "Exact length of one Threads (Meta) post, counted the way Threads (Meta) counts (characters, each emoji = its UTF-8 bytes; default limit 500): valid or not, remaining, graphemes, UTF-8 bytes, links, and a \"fitted\" version cut at a sentence/word boundary with an ellipsis when it is too long. Threads by Meta (Threads API docs): text posts are limited to 500 characters; emojis are counted as the number of UTF-8 bytes (a plain emoji is 4, ZWJ sequences more); at most 5 links per post. Other text is counted in UTF-16 units (equal to characters for almost all text, otherwise higher). Pure computation, nothing stored.",
        "operationId": "meta_threads_check",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "1000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "1000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "1000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "1000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "description": "The post text (URL-encoded, max 4000 characters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Limit to check against in characters, each emoji = its UTF-8 bytes, 1-500 (default 500)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "valid",
                    "length"
                  ],
                  "properties": {
                    "platform": {
                      "type": "string"
                    },
                    "valid": {
                      "type": "boolean"
                    },
                    "length": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "remaining": {
                      "type": "number"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "graphemes": {
                      "type": "integer"
                    },
                    "bytes": {
                      "type": "integer"
                    },
                    "codePoints": {
                      "type": "integer"
                    },
                    "links": {
                      "type": "integer"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "post": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "fitted": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fittedLength": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "rules": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "platform": "meta-threads",
                  "valid": false,
                  "length": 522,
                  "limit": 500,
                  "remaining": -22,
                  "unit": "characters, each emoji = its UTF-8 bytes",
                  "graphemes": 519,
                  "bytes": 566,
                  "codePoints": 519,
                  "links": 1,
                  "issues": [
                    {
                      "code": "OVER_LIMIT",
                      "message": "Length 522 (characters, each emoji = its UTF-8 bytes) exceeds 500 by 22."
                    }
                  ],
                  "fitted": "Why do an agent's posts get rejected outside X? Every network counts differently. Bluesky allows 300 graphemes and 3000 bytes. Farcaster counts UTF-8 bytes: 320 per cast, up to 1024 for a long cast. Mastodon counts graphemes and every link as 23. Threads by Meta allows 500 characters and counts each emoji as its UTF-8 bytes 🧵 中文在 Farcaster 上每个汉字算 3 个字节，一百来个字就满了。 Thread Kit breaks at paragraph, sentence and clause boundaries, keeps links whole and re-checks every post.…",
                  "fittedLength": 476,
                  "rules": "Threads by Meta (Threads API docs): text posts are limited to 500 characters; emojis are counted as the number of UTF-8 bytes (a plain emoji is 4, ZWJ sequences more); at most 5 links per post. Other text is counted in UTF-16 units (equal to characters for almost all text, otherwise higher)."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/write/thread": {
      "get": {
        "summary": "Write a thread from an article or notes (AI) for X (Twitter), Bluesky, Farcaster, Mastodon or Threads",
        "description": "Turn an article, blog post, notes, changelog or transcript (100-3000 characters, any language) into a ready-to-post thread: a hook first, one point per post, a wrap-up last. An open model on Cloudflare Workers AI writes it, then Thread Kit re-measures every post the way the target network counts (X weighted: CJK and emoji 2, links 23; Bluesky graphemes and bytes; Farcaster UTF-8 bytes; Mastodon; Threads by Meta) and re-splits anything too long, so every post fits. Links that are not in your source are removed and numbers that are not in it are flagged. Options: platform, posts (3-12, default auto), tone, output lang, numbering. Model failure or timeout returns 5xx and is not charged.",
        "operationId": "write_twitter_thread_from_article",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "10000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "10000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "10000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "10000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "description": "Source to turn into a thread: article, notes or transcript (URL-encoded, 100-3000 characters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Target network: x (default), bluesky, farcaster, mastodon or meta-threads",
            "schema": {
              "type": "string",
              "enum": [
                "x",
                "bluesky",
                "farcaster",
                "mastodon",
                "meta-threads"
              ]
            }
          },
          {
            "name": "posts",
            "in": "query",
            "required": false,
            "description": "Number of posts, 3-12; omit to let the writer choose from the source length",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tone",
            "in": "query",
            "required": false,
            "description": "clear (default), punchy, casual or formal",
            "schema": {
              "type": "string",
              "enum": [
                "clear",
                "punchy",
                "casual",
                "formal"
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Output language: auto = same as the source (default), or en, zh, zh-TW, ja, ko, es, fr, de, pt, ru, id, vi, tr, it",
            "schema": {
              "type": "string",
              "enum": [
                "auto",
                "en",
                "zh",
                "zh-TW",
                "ja",
                "ko",
                "es",
                "fr",
                "de",
                "pt",
                "ru",
                "id",
                "vi",
                "tr",
                "it"
              ]
            }
          },
          {
            "name": "numbering",
            "in": "query",
            "required": false,
            "description": "Where to put \"n/N\": suffix (default), prefix or none. Counted in each post's length.",
            "schema": {
              "type": "string",
              "enum": [
                "suffix",
                "prefix",
                "none"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "posts"
                  ],
                  "properties": {
                    "platform": {
                      "type": "string"
                    },
                    "network": {
                      "type": "string"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "numbering": {
                      "type": "string"
                    },
                    "tone": {
                      "type": "string"
                    },
                    "lang": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "n": {
                            "type": "integer"
                          },
                          "text": {
                            "type": "string"
                          },
                          "length": {
                            "type": "number"
                          },
                          "remaining": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "post": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "model": {
                      "type": "string"
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "codePoints": {
                          "type": "integer"
                        },
                        "example": {
                          "type": "boolean"
                        }
                      }
                    },
                    "cached": {
                      "type": "boolean"
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "platform": "x",
                  "network": "X (Twitter)",
                  "limit": 280,
                  "unit": "weighted characters (CJK and emoji 2, links 23)",
                  "numbering": "suffix",
                  "tone": "clear",
                  "lang": "auto",
                  "count": 4,
                  "posts": [
                    {
                      "n": 1,
                      "text": "Why do AI agents' posts get rejected? Every network measures length differently, and most agents count characters the wrong way. 1/4",
                      "length": 132,
                      "remaining": 148
                    },
                    {
                      "n": 2,
                      "text": "On X, 280 is a weighted count: each Chinese, Japanese or Korean character and each emoji counts 2, and every link counts 23. A Chinese post is full at about 140 characters. 2/4",
                      "length": 176,
                      "remaining": 104
                    },
                    {
                      "n": 3,
                      "text": "Bluesky: 300 graphemes and 3000 bytes. Farcaster: 320 UTF-8 bytes, 3 per Chinese character. Mastodon: links count 23, default 500. Threads (Meta): 500, but an emoji counts as its bytes. 3/4",
                      "length": 189,
                      "remaining": 91
                    },
                    {
                      "n": 4,
                      "text": "The fix: count the way each network counts, split at sentence boundaries, keep links whole, and check every post before publishing. Rules: https://github.com/twitter/twitter-text 4/4",
                      "length": 166,
                      "remaining": 114
                    }
                  ],
                  "warnings": [],
                  "model": "example (hand-written to show the shape; paid calls are written by an open model on Cloudflare Workers AI)",
                  "source": {
                    "codePoints": 806,
                    "example": true
                  },
                  "cached": false,
                  "note": "Written by an open model on Cloudflare Workers AI from your source text, then length-checked by Thread Kit for the target network. Links not in the source were removed; numbers not in the source are listed in warnings. Read it before posting."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/write/shorts": {
      "get": {
        "summary": "Write a short-video script (AI): timed 15-60 s script for TikTok, Instagram Reels or YouTube Shorts, with SRT subtitles",
        "description": "Turn an article, blog post, notes or product description (100-3000 characters, any language) into a vertical-video script that fits the length you ask for (15, 30, 45 or 60 seconds): a hook first, then beats, each with voiceover, on-screen text and a shot description (usable as a stock-footage search or a text-to-video prompt), plus a title, a caption, up to 5 hashtags and ready-made SRT subtitles. An open model on Cloudflare Workers AI writes it; Thread Kit then times every beat from speaking rate (about 2.5 English words or 4 Chinese characters per second), drops or trims beats until the script fits (+10%), keeps on-screen text within 42 width units (CJK and emoji 2) and the title within YouTube's 100 characters, removes links that are not in your source and flags numbers that are not in it. No video or voice is generated. Model failure or timeout returns 5xx and is not charged.",
        "operationId": "write_short_video_script_from_article",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.02"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "20000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "20000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "20000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "20000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "description": "Source to turn into a script: article, notes or product description (URL-encoded, 100-3000 characters)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "seconds",
            "in": "query",
            "required": false,
            "description": "Target length in seconds: 15, 30 (default), 45 or 60",
            "schema": {
              "type": "integer",
              "enum": [
                15,
                30,
                45,
                60
              ]
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "tiktok (default), reels (Instagram Reels) or shorts (YouTube Shorts)",
            "schema": {
              "type": "string",
              "enum": [
                "tiktok",
                "reels",
                "shorts"
              ]
            }
          },
          {
            "name": "tone",
            "in": "query",
            "required": false,
            "description": "clear (default), punchy, casual or formal",
            "schema": {
              "type": "string",
              "enum": [
                "clear",
                "punchy",
                "casual",
                "formal"
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Language of voiceover, on-screen text, title and caption: auto = same as the source (default), or en, zh, zh-TW, ja, ko, es, fr, de, pt, ru, id, vi, tr, it. Shot descriptions are in English.",
            "schema": {
              "type": "string",
              "enum": [
                "auto",
                "en",
                "zh",
                "zh-TW",
                "ja",
                "ko",
                "es",
                "fr",
                "de",
                "pt",
                "ru",
                "id",
                "vi",
                "tr",
                "it"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "beats",
                    "srt"
                  ],
                  "properties": {
                    "platform": {
                      "type": "string"
                    },
                    "network": {
                      "type": "string"
                    },
                    "seconds": {
                      "type": "integer"
                    },
                    "tone": {
                      "type": "string"
                    },
                    "lang": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "hook": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string"
                        },
                        "seconds": {
                          "type": "number"
                        }
                      }
                    },
                    "totalSeconds": {
                      "type": "number"
                    },
                    "beatCount": {
                      "type": "integer"
                    },
                    "beats": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "n": {
                            "type": "integer"
                          },
                          "start": {
                            "type": "number"
                          },
                          "end": {
                            "type": "number"
                          },
                          "seconds": {
                            "type": "number"
                          },
                          "voiceover": {
                            "type": "string"
                          },
                          "onScreen": {
                            "type": "string"
                          },
                          "visual": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "caption": {
                      "type": "string"
                    },
                    "hashtags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "srt": {
                      "type": "string"
                    },
                    "pace": {
                      "type": "object",
                      "properties": {
                        "wordsPerSecond": {
                          "type": "number"
                        },
                        "hanPerSecond": {
                          "type": "number"
                        },
                        "kanaPerSecond": {
                          "type": "number"
                        },
                        "hangulPerSecond": {
                          "type": "number"
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "post": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "model": {
                      "type": "string"
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "codePoints": {
                          "type": "integer"
                        },
                        "example": {
                          "type": "boolean"
                        }
                      }
                    },
                    "cached": {
                      "type": "boolean"
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "platform": "tiktok",
                  "network": "TikTok",
                  "seconds": 30,
                  "tone": "clear",
                  "lang": "auto",
                  "title": "Why AI agents' posts get rejected",
                  "hook": {
                    "text": "Why do AI agents' posts get rejected?",
                    "seconds": 3.1
                  },
                  "totalSeconds": 26.7,
                  "beatCount": 5,
                  "beats": [
                    {
                      "n": 1,
                      "start": 0,
                      "end": 3.1,
                      "seconds": 3.1,
                      "voiceover": "Why do AI agents' posts get rejected?",
                      "onScreen": "Why posts get rejected",
                      "visual": "Close-up of a phone screen showing a social post with a red error under it"
                    },
                    {
                      "n": 2,
                      "start": 3.1,
                      "end": 8.2,
                      "seconds": 5.1,
                      "voiceover": "Every network measures length differently, and most agents count the wrong way.",
                      "onScreen": "Every network counts differently",
                      "visual": "Split screen of several app compose boxes, each with its own character counter"
                    },
                    {
                      "n": 3,
                      "start": 8.2,
                      "end": 15.7,
                      "seconds": 7.5,
                      "voiceover": "On X, each Chinese, Japanese or Korean character and each emoji counts 2, and every link counts 23.",
                      "onScreen": "X: CJK + emoji = 2, link = 23",
                      "visual": "A character counter jumping by two as emoji are typed"
                    },
                    {
                      "n": 4,
                      "start": 15.7,
                      "end": 20.8,
                      "seconds": 5.1,
                      "voiceover": "Farcaster counts bytes: 320 per cast, and a Chinese character takes 3.",
                      "onScreen": "Farcaster: 320 bytes",
                      "visual": "Small blocks stacking up next to a short Chinese sentence"
                    },
                    {
                      "n": 5,
                      "start": 20.8,
                      "end": 26.7,
                      "seconds": 5.9,
                      "voiceover": "The fix: count the way each network counts, and check every post before publishing.",
                      "onScreen": "Count their way. Check first.",
                      "visual": "Green check marks appearing beside a list of posts"
                    }
                  ],
                  "caption": "Why AI agents' posts get rejected, and the fix: count length the way each network counts.",
                  "hashtags": [
                    "#AIagents",
                    "#SocialMedia",
                    "#ContentCreation"
                  ],
                  "srt": "1\n00:00:00,000 --> 00:00:02,800\nWhy do AI agents' posts get rejected?\n\n2\n00:00:03,100 --> 00:00:05,100\nEvery network measures length differently,\n\n3\n00:00:05,100 --> 00:00:07,900\nand most agents count the wrong way.\n\n4\n00:00:08,200 --> 00:00:10,600\nOn X, each Chinese, Japanese or\n\n5\n00:00:10,600 --> 00:00:12,600\nKorean character and each emoji\n\n6\n00:00:12,600 --> 00:00:15,400\ncounts 2, and every link counts 23.\n\n7\n00:00:15,700 --> 00:00:18,100\nFarcaster counts bytes: 320 per cast,\n\n8\n00:00:18,100 --> 00:00:20,500\nand a Chinese character takes 3.\n\n9\n00:00:20,800 --> 00:00:23,200\nThe fix: count the way each\n\n10\n00:00:23,200 --> 00:00:24,800\nnetwork counts, and check\n\n11\n00:00:24,800 --> 00:00:26,400\nevery post before publishing.\n",
                  "pace": {
                    "wordsPerSecond": 2.5,
                    "hanPerSecond": 4,
                    "kanaPerSecond": 6,
                    "hangulPerSecond": 5
                  },
                  "warnings": [],
                  "model": "example (hand-written to show the shape; paid calls are written by an open model on Cloudflare Workers AI)",
                  "source": {
                    "codePoints": 806,
                    "example": true
                  },
                  "cached": false,
                  "note": "Written by an open model on Cloudflare Workers AI from your source text, then timed and checked by Thread Kit. Durations are estimates from speaking rate (about 2.5 English words or 4 Chinese characters per second); on-screen text, title, caption and hashtags are kept short. Links not in the source were removed; numbers not in the source are listed in warnings. No video, voice or music is generated. Review before publishing."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/credits/starter": {
      "get": {
        "summary": "Prepaid Thread Kit credits: starter pack (400 credits = $0.40 of calls)",
        "description": "Buy a starter pack of 400 prepaid credits for Thread Kit (1 credit = $0.001 of list price, so you pay $0.25 for $0.40 of calls). Returns a new secret key (tkc_...). Send it as \"Authorization: Bearer <key>\" on any paid Thread Kit route or on the MCP server (POST /mcp) and the call is paid from the credits instead of a per-call payment, which lets MCP clients that cannot sign x402 payments use the paid tools. Cost per call in credits: x/thread 2, x/check 1, bluesky/thread 2, bluesky/check 1, farcaster/thread 2, farcaster/check 1, mastodon/thread 2, mastodon/check 1, meta-threads/thread 2, meta-threads/check 1, write/thread 10, write/shorts 20. Failed calls are not deducted. No parameters. Experimental service run by an AI agent; unused credits are not refundable.",
        "operationId": "buy_thread_kit_credits_starter",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.25"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "250000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "250000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "250000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "250000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "key",
                    "credits"
                  ],
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "credits": {
                      "type": "integer"
                    },
                    "pack": {
                      "type": "string"
                    },
                    "creditUsd": {
                      "type": "number"
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "http": {
                          "type": "string"
                        },
                        "mcp": {
                          "type": "string"
                        },
                        "balance": {
                          "type": "string"
                        },
                        "keep": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "key": "tkc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                  "credits": 400,
                  "pack": "starter",
                  "creditUsd": 0.001,
                  "usage": {
                    "http": "Send the key on any paid route instead of paying: Authorization: Bearer <key> (or X-Credits-Key). The response carries X-Credits-Remaining.",
                    "mcp": "MCP clients: put \"headers\": { \"Authorization\": \"Bearer <key>\" } in the server config for /mcp; paid tools then run without per-call payments.",
                    "balance": "GET /v1/credits/balance with the same header.",
                    "keep": "Keep the key secret: anyone holding it can spend its credits."
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/credits/creator": {
      "get": {
        "summary": "Prepaid Thread Kit credits: creator pack (2000 credits = $2.00 of calls)",
        "description": "Buy a creator pack of 2000 prepaid credits for Thread Kit (1 credit = $0.001 of list price, so you pay $1.00 for $2.00 of calls). Returns a new secret key (tkc_...). Send it as \"Authorization: Bearer <key>\" on any paid Thread Kit route or on the MCP server (POST /mcp) and the call is paid from the credits instead of a per-call payment, which lets MCP clients that cannot sign x402 payments use the paid tools. Cost per call in credits: x/thread 2, x/check 1, bluesky/thread 2, bluesky/check 1, farcaster/thread 2, farcaster/check 1, mastodon/thread 2, mastodon/check 1, meta-threads/thread 2, meta-threads/check 1, write/thread 10, write/shorts 20. Failed calls are not deducted. No parameters. Experimental service run by an AI agent; unused credits are not refundable.",
        "operationId": "buy_thread_kit_credits_creator",
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "1"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C"
              }
            },
            {
              "mpp": {
                "method": "evm",
                "intent": "charge",
                "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "amount": "1000000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 8453
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50",
                "amount": "1000000",
                "recipient": "0x2776341969286B6eC02c001883fC5D1a7a37cf2C",
                "chainId": 4217
              }
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "1000000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "USDC on Base mainnet (chainId 8453), EIP-3009 authorization, settled by an x402 facilitator"
            },
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "1000000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50",
              "description": "USDC.e on Tempo mainnet (chainId 4217), pull mode"
            }
          ]
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "key",
                    "credits"
                  ],
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "credits": {
                      "type": "integer"
                    },
                    "pack": {
                      "type": "string"
                    },
                    "creditUsd": {
                      "type": "number"
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "http": {
                          "type": "string"
                        },
                        "mcp": {
                          "type": "string"
                        },
                        "balance": {
                          "type": "string"
                        },
                        "keep": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "key": "tkc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                  "credits": 2000,
                  "pack": "creator",
                  "creditUsd": 0.001,
                  "usage": {
                    "http": "Send the key on any paid route instead of paying: Authorization: Bearer <key> (or X-Credits-Key). The response carries X-Credits-Remaining.",
                    "mcp": "MCP clients: put \"headers\": { \"Authorization\": \"Bearer <key>\" } in the server config for /mcp; paid tools then run without per-call payments.",
                    "balance": "GET /v1/credits/balance with the same header.",
                    "keep": "Keep the key secret: anyone holding it can spend its credits."
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment Required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method evm = USDC on Base; method tempo = USDC.e on Tempo, pull mode)."
          }
        }
      }
    },
    "/v1/x/rules": {
      "get": {
        "summary": "Counting rules and limits (free)",
        "description": "Free",
        "operationId": "x_rules",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/x/demo": {
      "get": {
        "summary": "Sample output of /v1/x/thread on a fixed text (free)",
        "description": "Free",
        "operationId": "x_demo",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/write/example": {
      "get": {
        "summary": "Example input and output of /v1/write/thread (free, hand-written, no model call)",
        "description": "Free",
        "operationId": "write_example",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/write/shorts-example": {
      "get": {
        "summary": "Example input and output of /v1/write/shorts (free, hand-written, no model call)",
        "description": "Free",
        "operationId": "write_shorts_example",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/platforms/rules": {
      "get": {
        "summary": "How each network counts post length: X, Bluesky, Farcaster, Mastodon, Threads (free)",
        "description": "Free",
        "operationId": "platforms_rules",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/credits": {
      "get": {
        "summary": "Prepaid credits: packs, cost per call, how to buy (x402, MPP or a plain USDC transfer on Base) and how to use a key (free)",
        "description": "Free",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "operationId": "credits_info"
      }
    },
    "/v1/credits/quote": {
      "get": {
        "summary": "Quote for buying a credits pack with a plain USDC transfer on Base: exact amount, receiving address, claim link (free)",
        "description": "Free",
        "security": [],
        "parameters": [
          {
            "name": "pack",
            "in": "query",
            "required": false,
            "description": "starter or creator (default creator)",
            "schema": {
              "type": "string",
              "enum": [
                "starter",
                "creator"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "The Base address you will send the USDC from (only a transfer from it can claim the quote)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "operationId": "credits_transfer_quote"
      }
    },
    "/v1/credits/claim": {
      "get": {
        "summary": "Claim a credits key after the USDC transfer: checks the Transfer log on Base (free)",
        "description": "Free",
        "security": [],
        "parameters": [
          {
            "name": "quote",
            "in": "query",
            "required": true,
            "description": "The quote id from /v1/credits/quote",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "No matching transfer yet"
          },
          "410": {
            "description": "Window closed or quote expired"
          }
        },
        "operationId": "credits_transfer_claim"
      }
    },
    "/v1/credits/balance": {
      "get": {
        "summary": "Credits left on a key (send it as Authorization: Bearer tkc_...) (free)",
        "description": "Free",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing or unknown key"
          }
        },
        "operationId": "credits_balance"
      }
    }
  }
}