
Email Thread Generator API
Spin up a fake email thread from a scenario, a cast of people, and the beats you want it to hit. Handy for mockups, demos, writing prompts, and a laugh.
All API requests require a valid API key passed in the Authorization header as a Bearer token.
10 requests per minute
1 endpoint available
Overview
Send a short brief (the overall context, the people involved and the beats the story should hit) and an
AI model writes a fictional back-and-forth email thread with senders, recipients, subjects, timestamps and
Markdown bodies. To continue a thread, send the emails you already have in existingThread with
new beats; only the new emails come back.
Notes
- Generation only. Threads made through the API are not saved to your account.
- Keys that belong to a Pro subscriber use the same higher-quality model Pro gets on the site. Other keys use the standard model.
- Everything is fictional, and output may include adult content when the brief asks for it. Do not put real people's private details in the brief.
- Punctuation is normalized to plain ASCII (straight quotes, hyphens).
- Limits: context up to 5,000 characters, 2-12 parties (300 characters each), 1-20 beats (1,000 characters each),
2-10 new emails per request, up to 50 emails in
existingThread. - Your brief is sent to a third-party AI model.
- This is an AI endpoint: 10 requests per minute and 200 per day per API key.
Endpoints
https://opentools.ca/api/v1/tools/email-thread-generatorRequest Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| context | string | Required | What is going on overall. 1-5000 characters. |
| parties | string[] | Required | The people in the thread, 2-12 entries, e.g. "Dana Lee - office manager". |
| beats | string[] | Required | What should happen, in order. 1-20 entries. |
| tone | string | Optional | Any tone, up to 100 characters. The site offers "Professional", "Friendly and casual", "Passive-aggressive", "Tense and dramatic", "Corporate buzzword soup" and "Chaotic".Default: Professional |
| messageCount | integer | Optional | How many emails to write, 2-10. The model usually, but not always, returns exactly this many.Default: 6 |
| existingThread | object[] | Optional | Emails written so far, to continue from. Each has from, fromEmail, to, subject, timestamp and body (strings), as returned in thread. Up to 50. |
Response Example
{
"success": true,
"count": 2,
"thread": [
{
"from": "Dana Lee",
"fromEmail": "dana.lee@brightside.com",
"to": "Sam Patel, Jordan Wu",
"subject": "The fridge situation",
"timestamp": "Mon, Jun 23, 9:14 AM",
"body": "Hi both,\n\nSomeone has been eating the labelled yogurts again. **Third week running.** Can we talk about this?\n\nDana"
},
{
"from": "Sam Patel",
"fromEmail": "sam.patel@brightside.com",
"to": "Dana Lee, Jordan Wu",
"subject": "Re: The fridge situation",
"timestamp": "Mon, Jun 23, 9:41 AM",
"body": "Not me. I only eat the unlabelled ones, which I assume are communal.\n\nSam"
}
]
}Error Codes
Code Examples
curl -X POST https://opentools.ca/api/v1/tools/email-thread-generator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"context": "A small office argues about who keeps eating labelled food from the shared fridge",
"parties": ["Dana Lee - office manager", "Sam Patel - developer", "Jordan Wu - designer"],
"beats": ["Dana raises the problem", "Sam denies everything", "Jordan proposes a fridge camera"],
"tone": "Passive-aggressive",
"messageCount": 4
}'Rather use it in your browser? Open the Email Thread Generator