Skip to main content

Resend Python SDK

Code style: black Build codecov License: MIT PyPI PyPI - Python Version


Installation

To install Resend Python SDK, simply execute the following command in a terminal:

pip install resend

Setup

First, you need to get an API key, which is available in the Resend Dashboard.

import resend
import os

resend.api_key = "re_yourkey"

Example

You can get an overview about all parameters in the Send Email API reference.

import os
import resend

resend.api_key = "re_yourkey"

params: resend.Emails.SendParams = {
    "from": "onboarding@resend.dev",
    "to": ["delivered@resend.dev"],
    "subject": "hi",
    "html": "<strong>hello, world!</strong>",
    "reply_to": "to@gmail.com",
    "bcc": "bcc@resend.dev",
    "cc": ["cc@resend.dev"],
    "tags": [
        {"name": "tag1", "value": "tagvalue1"},
        {"name": "tag2", "value": "tagvalue2"},
    ],
}

email: resend.Emails.SendResponse = resend.Emails.send(params)
print(email)

Async Support

The SDK supports async operations via httpx. Install the async extra:

pip install resend[async]

Once installed, async methods (suffixed with _async) work automatically — no extra setup needed:

import asyncio
import resend

resend.api_key = "re_yourkey"

async def main():
    params: resend.Emails.SendParams = {
        "from": "onboarding@resend.dev",
        "to": ["delivered@resend.dev"],
        "subject": "hi",
        "html": "<strong>hello, world!</strong>",
    }

    email: resend.Emails.SendResponse = await resend.Emails.send_async(params)
    print(email)

if __name__ == "__main__":
    asyncio.run(main())

Custom async client

To use a custom async HTTP client or configure options like timeouts, set resend.default_async_http_client:

import resend

resend.api_key = "re_yourkey"
resend.default_async_http_client = resend.HTTPXClient(timeout=60)

Metadata

Release files for resend 2.34.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for resend 2.34.0
File Size Uploaded Provenance Actions
resend-2.34.0.tar.gz 52.0 kB Without provenance Details for resend-2.34.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for resend 2.34.0
File Interpreter ABI Platform Actions
resend-2.34.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for resend-2.34.0-py2.py3-none-any.whl

Total release size: 133.8 kB

Release files / resend-2.34.0.tar.gz

Download URL resend-2.34.0.tar.gz
Size 52.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0d9cfc73594702f4242f8a539d4a50dc17c6db9476fd0d71f48d13e24e463f47
BLAKE2b-256 checksum
How to use checksums
ce6cbc56f0ee688afaed75470008d4d8b077e6b0098dcedc9bede47b7c2b7889
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / resend-2.34.0-py2.py3-none-any.whl

Download URL resend-2.34.0-py2.py3-none-any.whl
Size 81.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2f1db326dfdebb1a6369c3bd85d45455b54edcc505d2b5382f19d4f733d9e2e0
BLAKE2b-256 checksum
How to use checksums
5b05a0d296e1146b6638c0fb7027fb8ac03738d5969b45b2a7ba4136036a0380
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Security for resend 2.34.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.34.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page