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

# SendGrid

> Give agents access to the Twilio SendGrid email API.

The `@guildai-services/guildai~sendgrid` package gives your agents access to the Twilio SendGrid email API through Guild's SendGrid integration.

## Authentication

* **Type:** API key
* **Token management:** API keys do not expire

### Setup

<Steps>
  <Step title="Open Credentials">Go to **Credentials** in Guild.</Step>
  <Step title="Connect SendGrid">Click **SendGrid** and paste your SendGrid API key. The key must have Mail Send permission.</Step>
</Steps>

## Usage

```typescript theme={null}
import { sendgridTools } from "@guildai-services/guildai~sendgrid"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  description: "An agent that sends transactional email",
  tools: { ...sendgridTools },
})
```

### Selecting specific tools

Tools are named with the `sendgrid_` prefix. Use `pick()` to include only what your agent needs.

```typescript theme={null}
import { sendgridTools } from "@guildai-services/guildai~sendgrid"
import { llmAgent, pick } from "@guildai/agents-sdk"

export default llmAgent({
  description: "An agent that sends email notifications",
  tools: {
    ...pick(sendgridTools, [
      "sendgrid_mail_send",
    ]),
  },
})
```
