> ## Documentation Index
> Fetch the complete documentation index at: https://runcrate.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Email Writer API

> Generate professional emails from bullet points using the Runcrate API. Tone control, multi-language support, and batch generation.

export const RuncrateStyles = () => {
  if (typeof document !== 'undefined' && !document.getElementById('runcrate-overrides')) {
    const s = document.createElement('style');
    s.id = 'runcrate-overrides';
    s.textContent = `
      /* Match Runcrate's rounding scale (--radius: 0.75rem) */
      .rounded-sm { border-radius: 0.5rem !important; }   /* 8px */
      .rounded-md { border-radius: 0.625rem !important; } /* 10px */
      .rounded-lg { border-radius: 0.75rem !important; }  /* 12px */
      .rounded-l-sm { border-top-left-radius: 0.5rem !important; border-bottom-left-radius: 0.5rem !important; }
      .rounded-r-sm { border-top-right-radius: 0.5rem !important; border-bottom-right-radius: 0.5rem !important; }
      .rounded-l-md { border-top-left-radius: 0.625rem !important; border-bottom-left-radius: 0.625rem !important; }
      .rounded-r-md { border-top-right-radius: 0.625rem !important; border-bottom-right-radius: 0.625rem !important; }
      .rounded-l-lg { border-top-left-radius: 0.75rem !important; border-bottom-left-radius: 0.75rem !important; }
      .rounded-r-lg { border-top-right-radius: 0.75rem !important; border-bottom-right-radius: 0.75rem !important; }

      /* Cards: never pure white in light mode */
      .card { background-color: #fcfcfc !important; border-radius: 0.75rem !important; }
      html.dark .card { background-color: #141414 !important; }

      /* Docs hero box */
      .rc-hero { background-color: #fcfcfc; border: 1px solid #e0e0e0; }
      html.dark .rc-hero { background-color: #141414; border-color: #242424; }
      html.dark .rc-hero h1 { color: #f5f5f5; }

      /* Runcrate scrollbar — thin, transparent track, hide-until-hover thumb */
      ::-webkit-scrollbar { width: 6px; height: 6px; background-color: transparent; }
      ::-webkit-scrollbar-track { background-color: transparent; }
      ::-webkit-scrollbar-thumb { background-color: rgba(155, 155, 155, 0.5); border-radius: 10px; transition: opacity 0.3s ease; opacity: 0; }
      ::-webkit-scrollbar-thumb:hover { background-color: rgba(155, 155, 155, 0.7); }
      *:hover::-webkit-scrollbar-thumb,
      *:focus::-webkit-scrollbar-thumb,
      *:active::-webkit-scrollbar-thumb { opacity: 1; }
      * { scrollbar-width: thin; scrollbar-color: rgba(155, 155, 155, 0.5) transparent; }
    `;
    document.head.appendChild(s);
  }
  return null;
};

<RuncrateStyles />

Turn rough bullet points into polished professional emails. Control tone, adjust formality, generate in multiple languages.

***

## Basic email generation

<CodeGroup>
  ```python Python theme={"theme":"github-dark"}
  from runcrate import Runcrate

  client = Runcrate(api_key="rc_live_YOUR_API_KEY")
  response = client.models.chat_completion(
      model="deepseek-ai/DeepSeek-V3",
      messages=[
          {"role": "system", "content": "Write professional emails from bullet points. Output only the email."},
          {"role": "user", "content": "Write a formal email:\n- Thanks for Tuesday meeting\n- Interested in partnership proposal\n- Need to review pricing with finance\n- Schedule follow-up next week?\n- Recipient: Sarah Chen, VP Partnerships, Acme Corp"}
      ],
  )
  print(response.choices[0].message.content)
  ```

  ```typescript TypeScript theme={"theme":"github-dark"}
  import Runcrate from '@runcrate/sdk';

  const rc = new Runcrate({ apiKey: 'rc_live_YOUR_API_KEY' });
  const response = await rc.models.chatCompletion({
    model: 'deepseek-ai/DeepSeek-V3',
    messages: [
      { role: 'system', content: 'Write professional emails from bullet points. Output only the email.' },
      { role: 'user', content: 'Formal email:\n- Thanks for Tuesday meeting\n- Interested in partnership\n- Review pricing with finance\n- Follow-up next week?' },
    ],
  });
  console.log(response.choices[0].message.content);
  ```
</CodeGroup>

***

## Tone control

```python theme={"theme":"github-dark"}
from runcrate import Runcrate
client = Runcrate(api_key="rc_live_YOUR_API_KEY")

tones = {
    "formal": "Formal business emails. Professional language, proper salutations.",
    "friendly": "Warm, friendly emails. Conversational but professional.",
    "direct": "Concise, direct emails. No filler.",
    "apologetic": "Sincere apology emails. Acknowledge issue, take responsibility.",
}

response = client.models.chat_completion(
    model="deepseek-ai/DeepSeek-V3",
    messages=[
        {"role": "system", "content": tones["direct"] + " Output only the email."},
        {"role": "user", "content": "Write an email:\n- Deadline moving Friday → next Wednesday\n- Waiting on vendor API credentials\n- No impact on launch date\n- Team should continue other tasks"}
    ],
)
print(response.choices[0].message.content)
```

***

## Multi-language

```python theme={"theme":"github-dark"}
points = "- Confirming signed contract\n- Onboarding begins Monday\n- Send requirements by Friday"
for lang in ["English", "Japanese", "German", "Spanish"]:
    response = client.models.chat_completion(
        model="deepseek-ai/DeepSeek-V3",
        messages=[
            {"role": "system", "content": f"Write professional emails in {lang}. Output only the email."},
            {"role": "user", "content": f"Formal email from these points:\n{points}"}
        ],
    )
    print(f"\n--- {lang} ---\n{response.choices[0].message.content}")
```

***

## Next.js API route

```typescript theme={"theme":"github-dark"}
// app/api/write-email/route.ts
import { runcrate } from '@runcrate/ai';
import { generateText } from 'ai';

const TONES: Record<string, string> = {
  formal: 'Formal business emails.', friendly: 'Warm, friendly emails.', direct: 'Concise. No filler.',
};

export async function POST(req: Request) {
  const { bulletPoints, tone = 'formal', language = 'English' } = await req.json();
  const { text } = await generateText({
    model: runcrate('deepseek-ai/DeepSeek-V3'),
    messages: [
      { role: 'system', content: `${TONES[tone] || TONES.formal} Write in ${language}. Output only the email.` },
      { role: 'user', content: `Write an email:\n${bulletPoints}` },
    ],
  });
  return Response.json({ email: text });
}
```

***

## Tips

* **Bullet points over paragraphs.** Clear bullets give better results than prose input.
* **One tone per system prompt.** Change the system prompt to switch tones.
* **CJK languages.** Consider Qwen3 models for more natural CJK output.
