Skip to main content

Resend Python SDK

Code style: black Build 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)

By default, HTTPXClient opens a new connection for every request. To reuse connections, pass your own httpx.AsyncClient. You own its lifecycle, so close it when you're done:

import httpx
import resend

async with httpx.AsyncClient(timeout=60) as client:
    resend.default_async_http_client = resend.HTTPXClient(client=client)
    ...

Legacy configurations that assign an AsyncHTTPClient to resend.default_http_client are also supported. Async requests select a client in this order:

  1. A replacement client assigned to resend.default_async_http_client.
  2. An AsyncHTTPClient assigned to resend.default_http_client.
  3. The automatic HTTPXClient, if httpx is installed.

Setting resend.default_async_http_client = None still permits the legacy fallback. Prefer the dedicated async setting for new code, so the sync client remains available for synchronous calls.

Metadata

Release files for resend 2.55.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.55.0
File Size Uploaded Provenance Actions
resend-2.55.0.tar.gz 88.3 kB With provenance Details for resend-2.55.0.tar.gz

Built distribution (wheel)

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

Total release size: 217.3 kB

Release files / resend-2.55.0.tar.gz

Download URL resend-2.55.0.tar.gz
Size 88.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2d28d1e66bec8b8e1a72546600d7f6695bfebcde300807381e1056e31c133fb8
BLAKE2b-256 checksum
How to use checksums
3a378a26aa1e2b006b4b55b4ddbe630d0f357880378319584d3cdcfc7b312ad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / resend-2.55.0-py3-none-any.whl

Download URL resend-2.55.0-py3-none-any.whl
Size 129.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
355584d00cac9b9ffba279f7625a90f2baffd41a60ed2582eada5ff5e1bea53c
BLAKE2b-256 checksum
How to use checksums
bc45b5cf5d54d4274a34ef95c37be0740463cd29961a674cba729baa9d12e1a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for resend 2.55.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for resend-2.55.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

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.55.0 This release

2 release files Full 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