Skip to main content
Resend Docs

Search documentation

Type to search this documentation.

On this pageOverview

Create an API key

API Keys are secret tokens used to authenticate your requests. They are unique to your account and must be kept confidential.

You must create at least one API key to use the Resend platform through code (e.g., SDKs, API, command-line interface (CLI), or AI tools).

You can create API keys in four ways:

To create a new API Key from the Resend Dashboard:

  1. In your Resend Dashboard, navigate to the API keys page.

  2. Click the Create API Key button.

  3. Provide a name for your API Key.

    Choose a name (maximum 50 characters) to identify your key.

  4. Select a permission for your API key.

    Choose "Sending access" to grant access to only sending emails unless your key needs full access to Resend’s API to create, delete, get, and update any resource.

    This API key permission can be updated at any time in the Dashboard.

  5. (Optional) Restrict sending to a specific domain

    If you selected "Sending access", you can further choose the domain you want to restrict access to.

Add API Key modal in the Resend Dashboard

Authenticate your requests by adding your Resend API key to your project as an environment variable.

You can check the quickstart guides or AI builder guides for specific examples of passing your API key to your project.

  1. Create and store an environment variable

    Store your API key as an environment variable in your project. This is commonly done inside a special file or configuration panel and will depend on your language, framework, or development platform.

    For example, Node.js projects commonly store both public and secret variables in a .env file at the root of your project:

    .env
    RESEND_API_KEY=re_xxxxxxxxx
  2. Pass the environment variable to your code

    Your project environment variables are not automatically available to Resend. You must explicitly pass your API key value to your Resend code.

    For example, whenever you create a new Resend instance in a Node.js project, you must pass the environment variable on process.env:

    app.ts
    const resend = new Resend(process.env.RESEND_API_KEY);
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu