From install to first email — typically under 5 minutes
Install the SDK, set your API key, and send your first email.
Last updated November 25, 2026
Three steps to your first send
The code below targets the 1.0 SDKs (bavimail 1.0.0 on npm and PyPI). You send from an inbox, an address on a verified domain; see domains to verify one.
Install the SDK
Install the Bavimail SDK for your language.
npm install bavimailSet your API key
Create an API key from the dashboard and set it as an environment variable.
export BAVIMAIL_API_KEY="ak_your_key_here"API keys start with ak_ . The SDKs send the key in the x-api-key header; see authentication.
Send your first email
Initialize the client, pick the inbox to send from, and send an email. inboxes.list() returns each inbox with its id and full address; on a verified domain with no inbox yet, inboxes.create() makes one.
import { Bavimail } from 'bavimail'
const client = new Bavimail({ apiKey: process.env.BAVIMAIL_API_KEY })
const [inbox] = await client.inboxes.list()
// No inbox yet? await client.inboxes.create({ domainId: 'your-domain-id', name: 'hello' })
const email = await client.emails.send({
inboxId: inbox.id,
toEmails: ['[email protected]'],
subject: 'Hello from Bavimail',
body: '<strong>Your first email</strong>',
})
console.log('Sent:', email.id, email.status)A new email starts as queued. emails.get(id) returns its current status.
Copy for Claude
Drop this into your AI coding assistant.
# Bavimail API — Quickstart
# Docs: https://bavimail.com/docs/quickstart
# SDK: pip install bavimail / npm install bavimail (1.0)
from bavimail import Bavimail
import os
client = Bavimail(api_key=os.environ["BAVIMAIL_API_KEY"])
inbox = client.inboxes.list()[0] # an address on a verified domain
email = client.emails.send(
inbox_id=inbox.id,
to_emails=["[email protected]"],
subject="Hello from Bavimail",
body="<strong>Your first email via Bavimail</strong>",
)
print(f"Sent: {email.id}")
# Auth: API key in the x-api-key header (never Authorization: Bearer)
# Errors: See https://bavimail.com/docs/errorsDocumentation built around the real delivery path
Learn how to verify domains, send email, receive inbound traffic, subscribe to webhooks, and move safely into production with Bavimail.
API key authentication for every request
Create a key in the dashboard, send it in the x-api-key header, and start sending.