Email Thread Generator

Email Thread Generator API

Utilities

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.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

10 requests per minute

Endpoints

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

POST
https://opentools.ca/api/v1/tools/email-thread-generator
Generate a fictional email thread, or continue one

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
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
OptionalAny 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
OptionalHow many emails to write, 2-10. The model usually, but not always, returns exactly this many.Default: 6
existingThread
object[]
OptionalEmails 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

400
Invalid JSON or invalid parameters (see details)
401
Missing or invalid API key
403
API key inactive or expired, or request IP not allowed
429
Rate limit exceeded (10 per minute or 200 per day)
500
Internal server error, or the AI model returned no usable thread (retry)

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
  }'

Ready to get started?

Create an API key to start using the Email Thread Generator API.

Rather use it in your browser? Open the Email Thread Generator