# AI

Summaries, drafts and sorting, and what runs them.

An SDK signs every request with your key: [Authentication](https://mailset.app/docs/authentication.md). To sign one yourself, see [Calling the API without an SDK](https://mailset.app/docs/authentication/http.md).

## The AI settings object

An org’s AI: what it runs on, a model per feature, and this month.

### Attributes

- `source` (enum): What the org chose to run AI on. `mailset`: Mailset’s key. `own`: the org’s own key. `off`: no AI. One of `mailset`, `own`, `off`.
- `using` (nullable enum): What calls go to right now. Null when nothing does. One of `mailset`, `own`.
- `mailsetAllowed` (boolean): Whether the org’s plan lets it use Mailset’s key.
- `configured` (boolean): Whether Mailset’s own key is there to run AI on.
- `banner` (nullable enum): What to tell people about the org’s AI right now, if anything. One of `no_ai`, `credit_used`, `key_failing`.
- `key` (nullable object): The org’s own key. Null: none saved.
  - `provider` (enum): Whose key it is. Always `anthropic`.
  - `last4` (string): The key’s last four characters. The rest is never shown.
  - `state` (enum): failing: the provider refused it, and the org’s AI is paused until it’s fixed. One of `ok`, `failing`.
  - `failure` (nullable enum): Why the key stopped working: `invalid`, or `no_credit` left on it. Null while it works. One of `invalid`, `no_credit`.
  - `problem` (nullable string): What went wrong and what to do, in words. Null while it works.
  - `addedAt` (number): When the key was saved, in ms since the epoch.
  - `checkedAt` (number): When it was last tried, in ms since the epoch.
  - `limitedUntil` (nullable number): Until when the provider asked to slow down; null when it hasn’t.
- `provider` (enum): Whose models the features pick from. Always `anthropic`.
- `features` (array of objects): Each AI feature, the model it uses and what a month of it costs.
  - `job` (enum): The feature’s id. One of `triage`, `phishing`, `summary`, `replies`, `draft`, `followup`, `search`, `chat`.
  - `slug` (string): The feature as `ai models set` names it.
  - `name` (string): The feature’s name.
  - `about` (string): What the feature does, in a sentence.
  - `soon` (boolean): Held for later: nothing calls it yet.
  - `model` (string): The org’s pick, which runs on its own key.
  - `defaultModel` (string): Mailset’s pick for it.
  - `inUse` (nullable string): What runs right now: the default on Mailset’s key. Null while AI is off.
  - `units` (number): Units behind the estimate, over `days`.
  - `usd` (number): A month of it at the org’s own volume: at Mailset’s price list on Mailset’s key, at the provider’s list prices on the org’s own.
  - `options` (array of objects): The models it can use.
    - `model` (string): The model’s id: what `ai models set --model` takes.
    - `name` (string): The model’s name.
    - `usd` (number): A month of this feature on this model on the org’s own key, at the provider’s list prices.
  - `warning` (nullable string): Set when the model it uses is a costly one for what it does.
- `days` (number): Days of the org’s own volume behind the estimates, at most 30. Zero: none yet.
- `month` (object): This month so far.
  - `credit` (object): The month’s AI credit on Mailset’s key, and what was used of it.
    - `from` (string): The first day of this month, UTC.
    - `usd` (nullable number): Null: no credit limits it.
    - `usedUsd` (number): What calls on Mailset’s key were worth this month, at the price list.
    - `units` (array of objects)
      - `job` (enum): One of `triage`, `phishing`, `summary`, `replies`, `draft`, `followup`, `search`, `chat`.
      - `units` (number)
    - `usedWords` (string): The same in plain words: "about 4,200 sorted emails, 37 drafts".
    - `display` (enum): One of `bar`, `earlier`, `none`.
  - `own` (object): On the org’s own key, at the provider’s list prices. Mailset never bills it.
    - `calls` (number)
    - `usd` (number)

```json
{
  "source": "mailset",
  "using": "mailset",
  "mailsetAllowed": true,
  "configured": true,
  "banner": "no_ai",
  "key": {
    "provider": "anthropic",
    "last4": "text",
    "state": "ok",
    "failure": "invalid",
    "problem": "text",
    "addedAt": 1796048940000,
    "checkedAt": 1796048940000,
    "limitedUntil": 1796048940000
  },
  "provider": "anthropic",
  "features": [
    {
      "job": "triage",
      "slug": "text",
      "name": "Acme API",
      "about": "text",
      "soon": true,
      "model": "text",
      "defaultModel": "text",
      "inUse": "text",
      "units": 1,
      "usd": 1,
      "options": [
        {
          "model": "text",
          "name": "Acme API",
          "usd": 1
        }
      ],
      "warning": "text"
    }
  ],
  "days": 1,
  "month": {
    "credit": {
      "from": "hello@example.com",
      "usd": 1,
      "usedUsd": 1,
      "units": [
        {
          "job": "triage",
          "units": 1
        }
      ],
      "usedWords": "text",
      "display": "bar"
    },
    "own": {
      "calls": 1,
      "usd": 1
    }
  }
}
```

Answered by [ai.source](https://mailset.app/docs/api/ai#ai.source), [ai.key.set](https://mailset.app/docs/api/ai#ai.key.set), [ai.key.remove](https://mailset.app/docs/api/ai#ai.key.remove), [ai.key.check](https://mailset.app/docs/api/ai#ai.key.check), [ai.models](https://mailset.app/docs/api/ai#ai.models), [ai.models.set](https://mailset.app/docs/api/ai#ai.models.set).

## ai.status

Show what runs AI in each of your orgs, anything that stopped it, and this month’s AI credit.

`POST /v1/ai.status`

Any signed-in person, with an API token.

### Parameters

It takes no input: send an empty object.

### Returns

`data` is an object with:

- `configured` (boolean): Whether Mailset’s own key is there to run AI on.
- `limits` (object): What each org may spend a day on Mailset’s key.
  - `calls` (number)
  - `usd` (number)
- `today` (array of objects): Today on Mailset’s key, per org.
  - `org` (string)
  - `calls` (number)
  - `usd` (number)
- `banner` (nullable enum): The most pressing banner among this person’s orgs: a failing key first. One of `no_ai`, `credit_used`, `key_failing`.
- `orgs` (array of objects): Each org you’re in, and what runs its AI.
  - `id` (string): The org’s id.
  - `name` (string): The org’s name.
  - `role` (enum): One of `owner`, `admin`, `member`.
  - `source` (enum): What the org chose to run AI on. `mailset`: Mailset’s key. `own`: the org’s own key. `off`: no AI. One of `mailset`, `own`, `off`.
  - `using` (nullable enum): What calls go to right now; null when nothing does. One of `mailset`, `own`.
  - `mailsetAllowed` (boolean): Mailset’s key is open to this org.
  - `banner` (nullable enum): What to tell people about the org’s AI right now, if anything. One of `no_ai`, `credit_used`, `key_failing`.
  - `key` (nullable object): The org’s own key. Owners and admins only.
    - `provider` (enum): Whose key it is. Always `anthropic`.
    - `last4` (string): The key’s last four characters. The rest is never shown.
    - `state` (enum): failing: the provider refused it, and the org’s AI is paused until it’s fixed. One of `ok`, `failing`.
    - `failure` (nullable enum): Why the key stopped working: `invalid`, or `no_credit` left on it. Null while it works. One of `invalid`, `no_credit`.
    - `problem` (nullable string): What went wrong and what to do, in words. Null while it works.
    - `addedAt` (number): When the key was saved, in ms since the epoch.
    - `checkedAt` (number): When it was last tried, in ms since the epoch.
    - `limitedUntil` (nullable number): Until when the provider asked to slow down; null when it hasn’t.
  - `credit` (nullable object): The month’s AI credit. Owners and admins only.
    - `from` (string): The first day of this month, UTC.
    - `usd` (nullable number): Null: no credit limits it.
    - `usedUsd` (number): What calls on Mailset’s key were worth this month, at the price list.
    - `units` (array of objects)
      - `job` (enum): One of `triage`, `phishing`, `summary`, `replies`, `draft`, `followup`, `search`, `chat`.
      - `units` (number)
    - `usedWords` (string): The same in plain words: "about 4,200 sorted emails, 37 drafts".
    - `display` (enum): One of `bar`, `earlier`, `none`.
  - `own` (nullable object): This month on the org’s own key, at the provider’s list prices. Owners and admins only.
    - `calls` (number)
    - `usd` (number)

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.status();
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.status()
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	answer, err := client.AI.Status(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.status
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->status();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiStatus;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

AiStatus answer = mailset.ai().status();
System.out.println(answer);
```

Rust:

```rust
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.ai().status().await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.status \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai status
```

### Response

```json
{
  "ok": true,
  "data": {
    "configured": true,
    "limits": {
      "calls": 1,
      "usd": 1
    },
    "today": [
      {
        "org": "text",
        "calls": 1,
        "usd": 1
      }
    ],
    "banner": "no_ai",
    "orgs": [
      {
        "id": "out_3f9a1c0e7b2d",
        "name": "Acme API",
        "role": "owner",
        "source": "mailset",
        "using": "mailset",
        "mailsetAllowed": true,
        "banner": "no_ai",
        "key": {
          "provider": "anthropic",
          "last4": "text",
          "state": "ok",
          "failure": "invalid",
          "problem": "text",
          "addedAt": 1796048940000,
          "checkedAt": 1796048940000,
          "limitedUntil": 1796048940000
        },
        "credit": {
          "from": "hello@example.com",
          "usd": 1,
          "usedUsd": 1,
          "units": [
            {
              "job": "triage",
              "units": 1
            }
          ],
          "usedWords": "text",
          "display": "bar"
        },
        "own": {
          "calls": 1,
          "usd": 1
        }
      }
    ]
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-status)

## ai.source

Run the org’s AI on Mailset’s key (mailset), its own key (own), or not at all (off).

`POST /v1/ai.source`

An admin or owner of the org.

### Parameters

- `source` (enum, required): `mailset`: Mailset’s key. `own`: the org’s own key. `off`: no AI. One of `mailset`, `own`, `off`.

Beside `input`:

- `org` (string, optional): The org this is about. Needed when the caller is in more than one.

### Returns

`data` is the [AI settings object](https://mailset.app/docs/api/ai#ai-settings).

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.source({
	source: "own",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.source({"source": "own"})
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AISourceParams{
		Source: mailset.AISourceOwn,
	}
	answer, err := client.AI.Source(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.source(source: 'own')
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->source(['source' => 'own']);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiSettings;
import app.mailset.model.AiSource;
import app.mailset.model.AiSourceParams;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AiSourceParams.builder()
        .source(AiSource.OWN)
        .build();
AiSettings answer = mailset.ai().source(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::{AiSource, AiSourceParams};

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .ai()
    .source(AiSourceParams {
        source: AiSource::Own,
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.source \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"source":"own"},"org":"org_3f9a1c0e7b2d"}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai source own
```

### Response

```json
{
  "ok": true,
  "data": {
    "source": "mailset",
    "using": "mailset",
    "mailsetAllowed": true,
    "configured": true,
    "banner": "no_ai",
    "key": {
      "provider": "anthropic",
      "last4": "text",
      "state": "ok",
      "failure": "invalid",
      "problem": "text",
      "addedAt": 1796048940000,
      "checkedAt": 1796048940000,
      "limitedUntil": 1796048940000
    },
    "provider": "anthropic",
    "features": [
      {
        "job": "triage",
        "slug": "text",
        "name": "Acme API",
        "about": "text",
        "soon": true,
        "model": "text",
        "defaultModel": "text",
        "inUse": "text",
        "units": 1,
        "usd": 1,
        "options": [
          {
            "model": "text",
            "name": "Acme API",
            "usd": 1
          }
        ],
        "warning": "text"
      }
    ],
    "days": 1,
    "month": {
      "credit": {
        "from": "hello@example.com",
        "usd": 1,
        "usedUsd": 1,
        "units": [
          {
            "job": "triage",
            "units": 1
          }
        ],
        "usedWords": "text",
        "display": "bar"
      },
      "own": {
        "calls": 1,
        "usd": 1
      }
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-source)

## ai.key.set

Check and keep the org’s own AI key, and run its AI on it. The CLI reads the key from stdin or a hidden prompt.

`POST /v1/ai.key.set`

An admin or owner of the org. It can stop for a passkey approval.

### Parameters

- `provider` (enum, required): Whose key it is: `anthropic`. Always `anthropic`.
- `key` (string, required): The key itself. The CLI reads it from stdin or a hidden prompt, never from a flag. At most 400 characters.

Beside `input`:

- `org` (string, optional): The org this is about. Needed when the caller is in more than one.
- `approval` (string, optional): An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve.

### Returns

`data` is the [AI settings object](https://mailset.app/docs/api/ai#ai-settings).

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.key.set({
	provider: "anthropic",
	key: "<key>",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.key.set(
    {"provider": "anthropic", "key": "<key>"}
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AIKeySetParams{
		Provider: mailset.AIProviderAnthropic,
		Key:      "<key>",
	}
	answer, err := client.AI.Key.Set(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.key.set(
  provider: 'anthropic',
  key: '<key>'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->key->set([
    'provider' => 'anthropic',
    'key' => '<key>',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiKeySetParams;
import app.mailset.model.AiProvider;
import app.mailset.model.AiSettings;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AiKeySetParams.builder()
        .provider(AiProvider.ANTHROPIC)
        .key("<key>")
        .build();
AiSettings answer = mailset.ai().key().set(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::{AiKeySetParams, AiProvider};

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .ai()
    .key()
    .set(AiKeySetParams {
        provider: AiProvider::Anthropic,
        key: "<key>".into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.key.set \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"provider":"anthropic","key":"<key>"},"org":"org_3f9a1c0e7b2d"}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai key set anthropic
```

### Response

```json
{
  "ok": true,
  "data": {
    "source": "mailset",
    "using": "mailset",
    "mailsetAllowed": true,
    "configured": true,
    "banner": "no_ai",
    "key": {
      "provider": "anthropic",
      "last4": "text",
      "state": "ok",
      "failure": "invalid",
      "problem": "text",
      "addedAt": 1796048940000,
      "checkedAt": 1796048940000,
      "limitedUntil": 1796048940000
    },
    "provider": "anthropic",
    "features": [
      {
        "job": "triage",
        "slug": "text",
        "name": "Acme API",
        "about": "text",
        "soon": true,
        "model": "text",
        "defaultModel": "text",
        "inUse": "text",
        "units": 1,
        "usd": 1,
        "options": [
          {
            "model": "text",
            "name": "Acme API",
            "usd": 1
          }
        ],
        "warning": "text"
      }
    ],
    "days": 1,
    "month": {
      "credit": {
        "from": "hello@example.com",
        "usd": 1,
        "usedUsd": 1,
        "units": [
          {
            "job": "triage",
            "units": 1
          }
        ],
        "usedWords": "text",
        "display": "bar"
      },
      "own": {
        "calls": 1,
        "usd": 1
      }
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-key-set)

## ai.key.remove

Remove the org’s own AI key.

`POST /v1/ai.key.remove`

An admin or owner of the org. It can stop for a passkey approval.

### Parameters

- `provider` (enum, optional): Whose key it is: `anthropic`. Always `anthropic`. Default `anthropic`.

Beside `input`:

- `org` (string, optional): The org this is about. Needed when the caller is in more than one.
- `approval` (string, optional): An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve.

### Returns

`data` is the [AI settings object](https://mailset.app/docs/api/ai#ai-settings).

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.key.remove({
	provider: "anthropic",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.key.remove({"provider": "anthropic"})
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AIKeyRemoveParams{
		Provider: mailset.AIProviderAnthropic,
	}
	answer, err := client.AI.Key.Remove(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.key.remove(provider: 'anthropic')
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->key->remove([
    'provider' => 'anthropic',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiKeyRemoveParams;
import app.mailset.model.AiProvider;
import app.mailset.model.AiSettings;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AiKeyRemoveParams.builder()
        .provider(AiProvider.ANTHROPIC)
        .build();
AiSettings answer = mailset.ai().key().remove(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::{AiKeyRemoveParams, AiProvider};

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .ai()
    .key()
    .remove(AiKeyRemoveParams {
        provider: Some(AiProvider::Anthropic),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.key.remove \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"provider":"anthropic"},"org":"org_3f9a1c0e7b2d"}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai key remove anthropic
```

### Response

```json
{
  "ok": true,
  "data": {
    "source": "mailset",
    "using": "mailset",
    "mailsetAllowed": true,
    "configured": true,
    "banner": "no_ai",
    "key": {
      "provider": "anthropic",
      "last4": "text",
      "state": "ok",
      "failure": "invalid",
      "problem": "text",
      "addedAt": 1796048940000,
      "checkedAt": 1796048940000,
      "limitedUntil": 1796048940000
    },
    "provider": "anthropic",
    "features": [
      {
        "job": "triage",
        "slug": "text",
        "name": "Acme API",
        "about": "text",
        "soon": true,
        "model": "text",
        "defaultModel": "text",
        "inUse": "text",
        "units": 1,
        "usd": 1,
        "options": [
          {
            "model": "text",
            "name": "Acme API",
            "usd": 1
          }
        ],
        "warning": "text"
      }
    ],
    "days": 1,
    "month": {
      "credit": {
        "from": "hello@example.com",
        "usd": 1,
        "usedUsd": 1,
        "units": [
          {
            "job": "triage",
            "units": 1
          }
        ],
        "usedWords": "text",
        "display": "bar"
      },
      "own": {
        "calls": 1,
        "usd": 1
      }
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-key-remove)

## ai.key.check

Try the org’s own AI key again: one that works resumes its AI, one that doesn’t pauses it.

`POST /v1/ai.key.check`

An admin or owner of the org.

### Parameters

- `provider` (enum, optional): Whose key it is: `anthropic`. Always `anthropic`. Default `anthropic`.

Beside `input`:

- `org` (string, optional): The org this is about. Needed when the caller is in more than one.

### Returns

`data` is the [AI settings object](https://mailset.app/docs/api/ai#ai-settings).

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.key.check({
	provider: "anthropic",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.key.check({"provider": "anthropic"})
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AIKeyCheckParams{
		Provider: mailset.AIProviderAnthropic,
	}
	answer, err := client.AI.Key.Check(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.key.check(provider: 'anthropic')
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->key->check([
    'provider' => 'anthropic',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiKeyCheckParams;
import app.mailset.model.AiProvider;
import app.mailset.model.AiSettings;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AiKeyCheckParams.builder()
        .provider(AiProvider.ANTHROPIC)
        .build();
AiSettings answer = mailset.ai().key().check(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::{AiKeyCheckParams, AiProvider};

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .ai()
    .key()
    .check(AiKeyCheckParams {
        provider: Some(AiProvider::Anthropic),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.key.check \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"provider":"anthropic"},"org":"org_3f9a1c0e7b2d"}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai key check anthropic
```

### Response

```json
{
  "ok": true,
  "data": {
    "source": "mailset",
    "using": "mailset",
    "mailsetAllowed": true,
    "configured": true,
    "banner": "no_ai",
    "key": {
      "provider": "anthropic",
      "last4": "text",
      "state": "ok",
      "failure": "invalid",
      "problem": "text",
      "addedAt": 1796048940000,
      "checkedAt": 1796048940000,
      "limitedUntil": 1796048940000
    },
    "provider": "anthropic",
    "features": [
      {
        "job": "triage",
        "slug": "text",
        "name": "Acme API",
        "about": "text",
        "soon": true,
        "model": "text",
        "defaultModel": "text",
        "inUse": "text",
        "units": 1,
        "usd": 1,
        "options": [
          {
            "model": "text",
            "name": "Acme API",
            "usd": 1
          }
        ],
        "warning": "text"
      }
    ],
    "days": 1,
    "month": {
      "credit": {
        "from": "hello@example.com",
        "usd": 1,
        "usedUsd": 1,
        "units": [
          {
            "job": "triage",
            "units": 1
          }
        ],
        "usedWords": "text",
        "display": "bar"
      },
      "own": {
        "calls": 1,
        "usd": 1
      }
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-key-check)

## ai.models

Show the model each AI feature uses, a month of each at your volume, and this month’s credit.

`POST /v1/ai.models`

An admin or owner of the org.

### Parameters

It takes no input: send an empty object.

Beside `input`:

- `org` (string, optional): The org this is about. Needed when the caller is in more than one.

### Returns

`data` is the [AI settings object](https://mailset.app/docs/api/ai#ai-settings).

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.models.get();
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.models.get()
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	answer, err := client.AI.Models.Get(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.models.get
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->models->get();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiSettings;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

AiSettings answer = mailset.ai().models().get();
System.out.println(answer);
```

Rust:

```rust
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.ai().models().get().await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.models \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{},"org":"org_3f9a1c0e7b2d"}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai models
```

### Response

```json
{
  "ok": true,
  "data": {
    "source": "mailset",
    "using": "mailset",
    "mailsetAllowed": true,
    "configured": true,
    "banner": "no_ai",
    "key": {
      "provider": "anthropic",
      "last4": "text",
      "state": "ok",
      "failure": "invalid",
      "problem": "text",
      "addedAt": 1796048940000,
      "checkedAt": 1796048940000,
      "limitedUntil": 1796048940000
    },
    "provider": "anthropic",
    "features": [
      {
        "job": "triage",
        "slug": "text",
        "name": "Acme API",
        "about": "text",
        "soon": true,
        "model": "text",
        "defaultModel": "text",
        "inUse": "text",
        "units": 1,
        "usd": 1,
        "options": [
          {
            "model": "text",
            "name": "Acme API",
            "usd": 1
          }
        ],
        "warning": "text"
      }
    ],
    "days": 1,
    "month": {
      "credit": {
        "from": "hello@example.com",
        "usd": 1,
        "usedUsd": 1,
        "units": [
          {
            "job": "triage",
            "units": 1
          }
        ],
        "usedWords": "text",
        "display": "bar"
      },
      "own": {
        "calls": 1,
        "usd": 1
      }
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-models)

## ai.models.set

Pick the model one AI feature uses on the org’s own key (model default goes back to Mailset’s pick).

`POST /v1/ai.models.set`

An admin or owner of the org.

### Parameters

- `feature` (string, required): The feature: `sorting`, `phishing`, `summaries`, `replies`, `drafts`, `followups`, `ask` or `chat`. At most 40 characters.
- `model` (string, required): The model’s id, from `ai models`, or `default` for Mailset’s pick. At most 100 characters.

Beside `input`:

- `org` (string, optional): The org this is about. Needed when the caller is in more than one.

### Returns

`data` is the [AI settings object](https://mailset.app/docs/api/ai#ai-settings).

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.models.set({
	model: "claude-haiku-5-5",
	feature: "summaries",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.models.set(
    {"model": "claude-haiku-5-5", "feature": "summaries"}
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AIModelsSetParams{
		Model:   "claude-haiku-5-5",
		Feature: "summaries",
	}
	answer, err := client.AI.Models.Set(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.models.set(
  model: 'claude-haiku-5-5',
  feature: 'summaries'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->models->set([
    'model' => 'claude-haiku-5-5',
    'feature' => 'summaries',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiModelsSetParams;
import app.mailset.model.AiSettings;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AiModelsSetParams.builder()
        .model("claude-haiku-5-5")
        .feature("summaries")
        .build();
AiSettings answer = mailset.ai().models().set(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::AiModelsSetParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .ai()
    .models()
    .set(AiModelsSetParams {
        feature: "summaries".into(),
        model: "claude-haiku-5-5".into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.models.set \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"model":"claude-haiku-5-5","feature":"summaries"},"org":"org_3f9a1c0e7b2d"}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai models set summaries --model claude-haiku-5-5
```

### Response

```json
{
  "ok": true,
  "data": {
    "source": "mailset",
    "using": "mailset",
    "mailsetAllowed": true,
    "configured": true,
    "banner": "no_ai",
    "key": {
      "provider": "anthropic",
      "last4": "text",
      "state": "ok",
      "failure": "invalid",
      "problem": "text",
      "addedAt": 1796048940000,
      "checkedAt": 1796048940000,
      "limitedUntil": 1796048940000
    },
    "provider": "anthropic",
    "features": [
      {
        "job": "triage",
        "slug": "text",
        "name": "Acme API",
        "about": "text",
        "soon": true,
        "model": "text",
        "defaultModel": "text",
        "inUse": "text",
        "units": 1,
        "usd": 1,
        "options": [
          {
            "model": "text",
            "name": "Acme API",
            "usd": 1
          }
        ],
        "warning": "text"
      }
    ],
    "days": 1,
    "month": {
      "credit": {
        "from": "hello@example.com",
        "usd": 1,
        "usedUsd": 1,
        "units": [
          {
            "job": "triage",
            "units": 1
          }
        ],
        "usedWords": "text",
        "display": "bar"
      },
      "own": {
        "calls": 1,
        "usd": 1
      }
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-models-set)

## ai.summarize

Summarize a conversation.

`POST /v1/ai.summarize`

Any signed-in person, with an API token.

### Parameters

- `id` (string, required): The conversation’s id.

### Returns

`data` is an object with:

- `text` (nullable string)
- `reason` (nullable enum): One of `off`, `no_ai`, `not_configured`, `credit_used`, `key_failing`, `rate_limited`, `limit`, `failed`.
- `meter` (object, optional)
  - `id` (nullable string): The chat message’s own record; null for every other job.
  - `model` (string)
  - `source` (enum): Whose key paid: an org’s own key is worth nothing to Mailset. One of `mailset`, `own`.
  - `tokens` (object)
    - `input` (number)
    - `output` (number)
    - `cacheRead` (number)
    - `cacheWrite` (number)
  - `usd` (number): At Mailset’s price list on its key; zero on the org’s own.

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.summarize({
	id: "t_5d2c8a1f9e3b47c6a0d1e2f3",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.summarize(
    {"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"}
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AISummarizeParams{
		ID: "t_5d2c8a1f9e3b47c6a0d1e2f3",
	}
	answer, err := client.AI.Summarize(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.summarize(
  id: 't_5d2c8a1f9e3b47c6a0d1e2f3'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->summarize([
    'id' => 't_5d2c8a1f9e3b47c6a0d1e2f3',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiSummarizeParams;
import app.mailset.model.AiSummary;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AiSummarizeParams.builder()
        .id("t_5d2c8a1f9e3b47c6a0d1e2f3")
        .build();
AiSummary answer = mailset.ai().summarize(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::AiSummarizeParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .ai()
    .summarize(AiSummarizeParams {
        id: "t_5d2c8a1f9e3b47c6a0d1e2f3".into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.summarize \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"id":"t_5d2c8a1f9e3b47c6a0d1e2f3"}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai summarize t_5d2c8a1f9e3b47c6a0d1e2f3
```

### Response

```json
{
  "ok": true,
  "data": {
    "text": "text",
    "reason": "off",
    "meter": {
      "id": "out_3f9a1c0e7b2d",
      "model": "text",
      "source": "mailset",
      "tokens": {
        "input": 1,
        "output": 1,
        "cacheRead": 1,
        "cacheWrite": 1
      },
      "usd": 1
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-summarize)

## ai.replies

Suggest short replies to a conversation. Nothing is sent.

`POST /v1/ai.replies`

Any signed-in person, with an API token.

### Parameters

- `id` (string, required): The conversation’s id.

### Returns

`data` is an object with:

- `replies` (array of strings)
- `reason` (nullable enum): One of `off`, `no_ai`, `not_configured`, `credit_used`, `key_failing`, `rate_limited`, `limit`, `failed`.
- `meter` (object, optional)
  - `id` (nullable string): The chat message’s own record; null for every other job.
  - `model` (string)
  - `source` (enum): Whose key paid: an org’s own key is worth nothing to Mailset. One of `mailset`, `own`.
  - `tokens` (object)
    - `input` (number)
    - `output` (number)
    - `cacheRead` (number)
    - `cacheWrite` (number)
  - `usd` (number): At Mailset’s price list on its key; zero on the org’s own.

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.replies({
	id: "t_5d2c8a1f9e3b47c6a0d1e2f3",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.replies(
    {"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"}
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AIRepliesParams{
		ID: "t_5d2c8a1f9e3b47c6a0d1e2f3",
	}
	answer, err := client.AI.Replies(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.replies(
  id: 't_5d2c8a1f9e3b47c6a0d1e2f3'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->replies([
    'id' => 't_5d2c8a1f9e3b47c6a0d1e2f3',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiReplies;
import app.mailset.model.AiRepliesParams;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AiRepliesParams.builder()
        .id("t_5d2c8a1f9e3b47c6a0d1e2f3")
        .build();
AiReplies answer = mailset.ai().replies(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::AiRepliesParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .ai()
    .replies(AiRepliesParams {
        id: "t_5d2c8a1f9e3b47c6a0d1e2f3".into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.replies \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"id":"t_5d2c8a1f9e3b47c6a0d1e2f3"}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai replies t_5d2c8a1f9e3b47c6a0d1e2f3
```

### Response

```json
{
  "ok": true,
  "data": {
    "replies": [
      "text"
    ],
    "reason": "off",
    "meter": {
      "id": "out_3f9a1c0e7b2d",
      "model": "text",
      "source": "mailset",
      "tokens": {
        "input": 1,
        "output": 1,
        "cacheRead": 1,
        "cacheWrite": 1
      },
      "usd": 1
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-replies)

## ai.draft

Write a draft reply to a conversation. Nothing is sent.

`POST /v1/ai.draft`

Any signed-in person, with an API token.

### Parameters

- `id` (string, required): The conversation’s id.
- `instructions` (string, optional): What you want the reply to do, in your own words. At most 2,000 characters.

### Returns

`data` is an object with:

- `text` (nullable string)
- `reason` (nullable enum): One of `off`, `no_ai`, `not_configured`, `credit_used`, `key_failing`, `rate_limited`, `limit`, `failed`.
- `meter` (object, optional)
  - `id` (nullable string): The chat message’s own record; null for every other job.
  - `model` (string)
  - `source` (enum): Whose key paid: an org’s own key is worth nothing to Mailset. One of `mailset`, `own`.
  - `tokens` (object)
    - `input` (number)
    - `output` (number)
    - `cacheRead` (number)
    - `cacheWrite` (number)
  - `usd` (number): At Mailset’s price list on its key; zero on the org’s own.

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.draft({
	instructions: "Say yes, and ask to move it to Thursday",
	id: "t_5d2c8a1f9e3b47c6a0d1e2f3",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.draft(
    {
        "instructions": (
            "Say yes, and ask to move it to Thursday"
        ),
        "id": "t_5d2c8a1f9e3b47c6a0d1e2f3",
    }
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AIDraftParams{
		Instructions: mailset.String("Say yes, and ask to " +
			"move it to Thursday"),
		ID: "t_5d2c8a1f9e3b47c6a0d1e2f3",
	}
	answer, err := client.AI.Draft(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.draft(
  instructions: 'Say yes, and ask to move it to Thursday',
  id: 't_5d2c8a1f9e3b47c6a0d1e2f3'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->draft([
    'instructions' =>
        'Say yes, and ask to move it to Thursday',
    'id' => 't_5d2c8a1f9e3b47c6a0d1e2f3',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiDraft;
import app.mailset.model.AiDraftParams;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AiDraftParams.builder()
        .instructions(
                "Say yes, and ask to move it to Thursday")
        .id("t_5d2c8a1f9e3b47c6a0d1e2f3")
        .build();
AiDraft answer = mailset.ai().draft(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::AiDraftParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .ai()
    .draft(AiDraftParams {
        id: "t_5d2c8a1f9e3b47c6a0d1e2f3".into(),
        instructions: Some(
            "Say yes, and ask to move it to Thursday"
                .into(),
        ),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.draft \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"instructions":"Say yes, and ask to move it to Thursday","id":"t_5d2c8a1f9e3b47c6a0d1e2f3"}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai draft t_5d2c8a1f9e3b47c6a0d1e2f3 --instructions "Say yes, and ask to move it to Thursday"
```

### Response

```json
{
  "ok": true,
  "data": {
    "text": "text",
    "reason": "off",
    "meter": {
      "id": "out_3f9a1c0e7b2d",
      "model": "text",
      "source": "mailset",
      "tokens": {
        "input": 1,
        "output": 1,
        "cacheRead": 1,
        "cacheWrite": 1
      },
      "usd": 1
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-draft)

## ai.triage

Sort a conversation and check it for phishing, now.

`POST /v1/ai.triage`

Any signed-in person, with an API token.

### Parameters

- `id` (string, required): The conversation’s id.

### Returns

`data` is an object with:

- `tab` (enum): One of `primary`, `updates`, `newsletters`, `promotions`.
- `needsReply` (boolean)
- `phishing` (nullable object)
  - `domain` (string): The domain the mail really came from.
  - `imitates` (nullable string): The domain or name it passes itself off as. Null when it imitates nobody known.
  - `failed` (nullable string): The check it failed, such as DMARC. Null when none did.
  - `reason` (enum, optional): What it does that looks like fraud: a `lookalike` domain, a `payment` ask, a request for `credentials`, or a risky `attachment`. One of `lookalike`, `payment`, `credentials`, `attachment`.
- `reason` (nullable enum): One of `off`, `no_ai`, `not_configured`, `credit_used`, `key_failing`, `rate_limited`, `limit`, `failed`.

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.triage({
	id: "t_5d2c8a1f9e3b47c6a0d1e2f3",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.triage(
    {"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"}
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AITriageParams{
		ID: "t_5d2c8a1f9e3b47c6a0d1e2f3",
	}
	answer, err := client.AI.Triage(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.triage(
  id: 't_5d2c8a1f9e3b47c6a0d1e2f3'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->triage([
    'id' => 't_5d2c8a1f9e3b47c6a0d1e2f3',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiTriageParams;
import app.mailset.model.AiVerdict;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AiTriageParams.builder()
        .id("t_5d2c8a1f9e3b47c6a0d1e2f3")
        .build();
AiVerdict answer = mailset.ai().triage(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::AiTriageParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .ai()
    .triage(AiTriageParams {
        id: "t_5d2c8a1f9e3b47c6a0d1e2f3".into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.triage \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"id":"t_5d2c8a1f9e3b47c6a0d1e2f3"}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai triage t_5d2c8a1f9e3b47c6a0d1e2f3
```

### Response

```json
{
  "ok": true,
  "data": {
    "tab": "primary",
    "needsReply": true,
    "phishing": {
      "domain": "example.com",
      "imitates": "text",
      "failed": "text",
      "reason": "lookalike"
    },
    "reason": "off"
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-triage)

## ai.safe

Take a phishing warning off a conversation.

`POST /v1/ai.safe`

Any signed-in person, with an API token.

### Parameters

- `id` (string, required): The conversation’s id.

### Returns

`data` is an object with:

- `safe` (boolean)

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.safe({
	id: "t_5d2c8a1f9e3b47c6a0d1e2f3",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.safe(
    {"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"}
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AISafeParams{
		ID: "t_5d2c8a1f9e3b47c6a0d1e2f3",
	}
	answer, err := client.AI.Safe(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.safe(id: 't_5d2c8a1f9e3b47c6a0d1e2f3')
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->safe([
    'id' => 't_5d2c8a1f9e3b47c6a0d1e2f3',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiSafeParams;
import app.mailset.model.AiSafeResult;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AiSafeParams.builder()
        .id("t_5d2c8a1f9e3b47c6a0d1e2f3")
        .build();
AiSafeResult answer = mailset.ai().safe(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::AiSafeParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .ai()
    .safe(AiSafeParams {
        id: "t_5d2c8a1f9e3b47c6a0d1e2f3".into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.safe \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"id":"t_5d2c8a1f9e3b47c6a0d1e2f3"}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai safe t_5d2c8a1f9e3b47c6a0d1e2f3
```

### Response

```json
{
  "ok": true,
  "data": {
    "safe": true
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-safe)

## ai.search

Turn a question into search operators.

`POST /v1/ai.search`

Any signed-in person, with an API token.

### Parameters

- `question` (string, required): What you’re looking for, in your own words. Up to 500 characters. At most 500 characters.

### Returns

`data` is an object with:

- `query` (nullable string): The question as search operators, or null to search the words as typed.
- `reason` (nullable enum): One of `off`, `no_ai`, `not_configured`, `credit_used`, `key_failing`, `rate_limited`, `limit`, `failed`.
- `meter` (object, optional)
  - `id` (nullable string): The chat message’s own record; null for every other job.
  - `model` (string)
  - `source` (enum): Whose key paid: an org’s own key is worth nothing to Mailset. One of `mailset`, `own`.
  - `tokens` (object)
    - `input` (number)
    - `output` (number)
    - `cacheRead` (number)
    - `cacheWrite` (number)
  - `usd` (number): At Mailset’s price list on its key; zero on the org’s own.

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.search({
	question: "invoices from Stripe since March",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.search(
    {"question": "invoices from Stripe since March"}
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AISearchParams{
		Question: "invoices from Stripe since March",
	}
	answer, err := client.AI.Search(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.search(
  question: 'invoices from Stripe since March'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->search([
    'question' => 'invoices from Stripe since March',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiSearch;
import app.mailset.model.AiSearchParams;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AiSearchParams.builder()
        .question("invoices from Stripe since March")
        .build();
AiSearch answer = mailset.ai().search(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::AiSearchParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .ai()
    .search(AiSearchParams {
        question: "invoices from Stripe since March"
            .into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.search \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"question":"invoices from Stripe since March"}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai search "invoices from Stripe since March"
```

### Response

```json
{
  "ok": true,
  "data": {
    "query": "text",
    "reason": "off",
    "meter": {
      "id": "out_3f9a1c0e7b2d",
      "model": "text",
      "source": "mailset",
      "tokens": {
        "input": 1,
        "output": 1,
        "cacheRead": 1,
        "cacheWrite": 1
      },
      "usd": 1
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-search)

## ai.explain

Say why a conversation is in its tab.

`POST /v1/ai.explain`

Any signed-in person, with an API token.

### Parameters

- `id` (string, required): The conversation’s id.

### Returns

`data` is an object with:

- `tab` (enum): One of `primary`, `updates`, `newsletters`, `promotions`.
- `decidedBy` (string): In words: your choice, headers, cached, sender pattern, shared sender, model.
- `why` (nullable string)

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.explain({
	id: "t_5d2c8a1f9e3b47c6a0d1e2f3",
});
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.explain(
    {"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"}
)
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	params := &mailset.AIExplainParams{
		ID: "t_5d2c8a1f9e3b47c6a0d1e2f3",
	}
	answer, err := client.AI.Explain(ctx, params)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.explain(
  id: 't_5d2c8a1f9e3b47c6a0d1e2f3'
)
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->explain([
    'id' => 't_5d2c8a1f9e3b47c6a0d1e2f3',
]);
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiExplainParams;
import app.mailset.model.TabExplained;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

var params = AiExplainParams.builder()
        .id("t_5d2c8a1f9e3b47c6a0d1e2f3")
        .build();
TabExplained answer = mailset.ai().explain(params);
System.out.println(answer);
```

Rust:

```rust
use mailset::types::AiExplainParams;

// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset
    .ai()
    .explain(AiExplainParams {
        id: "t_5d2c8a1f9e3b47c6a0d1e2f3".into(),
    })
    .await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.explain \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{"id":"t_5d2c8a1f9e3b47c6a0d1e2f3"}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai explain t_5d2c8a1f9e3b47c6a0d1e2f3
```

### Response

```json
{
  "ok": true,
  "data": {
    "tab": "primary",
    "decidedBy": "text",
    "why": "text"
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-explain)

## ai.report

Show what sorted your mail and how much reached a model.

`POST /v1/ai.report`

Any signed-in person, with an API token.

### Parameters

It takes no input: send an empty object.

### Returns

`data` is an object with:

- `byLayer` (array of objects): Conversations in your mailboxes by what placed them.
  - `layer` (string)
  - `threads` (number)
- `threads` (number)
- `reachedModel` (number): Conversations a model actually had to read to place.
- `modelShare` (number)
- `calls` (number): Model calls paid for, and answers reused instead, in your orgs.
- `hits` (number)
- `callsAvoided` (number)
- `usd` (number)

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.ai.report();
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.ai.report()
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	answer, err := client.AI.Report(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.ai.report
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->ai->report();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AiReport;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

AiReport answer = mailset.ai().report();
System.out.println(answer);
```

Rust:

```rust
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.ai().report().await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/ai.report \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset ai report
```

### Response

```json
{
  "ok": true,
  "data": {
    "byLayer": [
      {
        "layer": "text",
        "threads": 1
      }
    ],
    "threads": 1,
    "reachedModel": 1,
    "modelShare": 1,
    "calls": 1,
    "hits": 1,
    "callsAvoided": 1,
    "usd": 1
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/ai#ai-report)

---

© 2026 Intenseloop, Inc. Mailset’s site, docs and guides are copyrighted. You may read them and use their code to build with Mailset. Don’t republish them or use them to build a copy of Mailset. Terms: https://mailset.app/terms#content