AI
Summaries, drafts and sorting, and what runs them.
An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.
On this page
The AI settings object
An org’s AI: what it runs on, a model per feature, and this month.
Attributes
What the org chose to run AI on.
mailset: Mailset’s key.own: the org’s own key.off: no AI.One of
mailsetownoffWhat calls go to right now. Null when nothing does.
One of
mailsetownWhether the org’s plan lets it use Mailset’s key.
Whether Mailset’s own key is there to run AI on.
What to tell people about the org’s AI right now, if anything.
One of
no_aicredit_usedkey_failingThe org’s own key. Null: none saved.
Show child attributesHide child attributes
Whose key it is.
Always
anthropicThe key’s last four characters. The rest is never shown.
failing: the provider refused it, and the org’s AI is paused until it’s fixed.
One of
okfailingWhy the key stopped working:
invalid, orno_creditleft on it. Null while it works.One of
invalidno_creditWhat went wrong and what to do, in words. Null while it works.
When the key was saved, in ms since the epoch.
When it was last tried, in ms since the epoch.
Until when the provider asked to slow down; null when it hasn’t.
Whose models the features pick from.
Always
anthropicEach AI feature, the model it uses and what a month of it costs.
Show child attributesHide child attributes
The feature’s id.
One of
triagephishingsummaryrepliesdraftfollowupsearchchatThe feature as
ai models setnames it.The feature’s name.
What the feature does, in a sentence.
Held for later: nothing calls it yet.
The org’s pick, which runs on its own key.
Mailset’s pick for it.
What runs right now: the default on Mailset’s key. Null while AI is off.
Units behind the estimate, over
days.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.
The models it can use.
Set when the model it uses is a costly one for what it does.
Days of the org’s own volume behind the estimates, at most 30. Zero: none yet.
This month so far.
Show child attributesHide child attributes
The month’s AI credit on Mailset’s key, and what was used of it.
Show child attributesHide child attributes
The first day of this month, UTC.
Null: no credit limits it.
What calls on Mailset’s key were worth this month, at the price list.
The same in plain words: "about 4,200 sorted emails, 37 drafts".
One of
barearliernone
On the org’s own key, at the provider’s list prices. Mailset never bills it.
Answered by
ai.sourceai.key.setai.key.removeai.key.checkai.modelsai.models.set
{
"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": [
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
Parameters
It takes no input: send an empty object.
Returns
data is an object with:
Whether Mailset’s own key is there to run AI on.
What each org may spend a day on Mailset’s key.
Today on Mailset’s key, per org.
The most pressing banner among this person’s orgs: a failing key first.
One of
no_aicredit_usedkey_failingEach org you’re in, and what runs its AI.
Show child attributesHide child attributes
The org’s id.
The org’s name.
One of
owneradminmemberWhat the org chose to run AI on.
mailset: Mailset’s key.own: the org’s own key.off: no AI.One of
mailsetownoffWhat calls go to right now; null when nothing does.
One of
mailsetownMailset’s key is open to this org.
What to tell people about the org’s AI right now, if anything.
One of
no_aicredit_usedkey_failingThe org’s own key. Owners and admins only.
Show child attributesHide child attributes
Whose key it is.
Always
anthropicThe key’s last four characters. The rest is never shown.
failing: the provider refused it, and the org’s AI is paused until it’s fixed.
One of
okfailingWhy the key stopped working:
invalid, orno_creditleft on it. Null while it works.One of
invalidno_creditWhat went wrong and what to do, in words. Null while it works.
When the key was saved, in ms since the epoch.
When it was last tried, in ms since the epoch.
Until when the provider asked to slow down; null when it hasn’t.
The month’s AI credit. Owners and admins only.
Show child attributesHide child attributes
The first day of this month, UTC.
Null: no credit limits it.
What calls on Mailset’s key were worth this month, at the price list.
The same in plain words: "about 4,200 sorted emails, 37 drafts".
One of
barearliernone
This month on the org’s own key, at the provider’s list prices. Owners and admins only.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.ai.status();
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.status()
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.ai.status
p answer
<?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;
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);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset.ai().status().await?;
println!("{answer:?}");
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 shows how.
mailset ai status
{
"ok": true,
"data": {
"configured": true,
"limits": {
"calls": 1,
"usd": 1
},
"today": [
{
"org": "text",
"calls": 1,
"usd": 1
}
],
"banner": "no_ai",
"orgs": [
{
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
Parameters
mailset: Mailset’s key.own: the org’s own key.off: no AI.One of
mailsetownoff
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is the AI settings object.
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);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.source({"source": "own"})
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.ai.source(source: 'own')
p answer
<?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;
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);
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 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 shows how.
mailset ai source own
{
"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
},
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
Parameters
Whose key it is:
anthropic.Always
anthropicThe key itself. The CLI reads it from stdin or a hidden prompt, never from a flag.
At most 400 characters.
Beside input
The org this is about. Needed when the caller is in more than one.
An approval’s id, once someone approved it with their passkey. Without one, the answer is
step_up_requiredand names what to approve.
Returns
data is the AI settings object.
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);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.key.set(
{"provider": "anthropic", "key": "<key>"}
)
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.ai.key.set(
provider: 'anthropic',
key: '<key>'
)
p answer
<?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;
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);
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 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 shows how.
mailset ai key set anthropic
{
"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
},
ai.key.remove
Remove the org’s own AI key.
POST/v1/ai.key.remove
Parameters
Whose key it is:
anthropic.Always
anthropicDefault
anthropic.
Beside input
The org this is about. Needed when the caller is in more than one.
An approval’s id, once someone approved it with their passkey. Without one, the answer is
step_up_requiredand names what to approve.
Returns
data is the AI settings object.
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);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.key.remove({"provider": "anthropic"})
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.ai.key.remove(provider: 'anthropic')
p answer
<?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;
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);
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 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 shows how.
mailset ai key remove anthropic
{
"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
},
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
Parameters
Whose key it is:
anthropic.Always
anthropicDefault
anthropic.
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is the AI settings object.
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);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.key.check({"provider": "anthropic"})
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.ai.key.check(provider: 'anthropic')
p answer
<?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;
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);
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 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 shows how.
mailset ai key check anthropic
{
"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
},
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
Parameters
It takes no input: send an empty object.
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is the AI settings object.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.ai.models.get();
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.models.get()
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.ai.models.get
p answer
<?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;
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);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset.ai().models().get().await?;
println!("{answer:?}");
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 shows how.
mailset ai models
{
"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
},
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
Parameters
The feature:
sorting,phishing,summaries,replies,drafts,followups,askorchat.At most 40 characters.
The model’s id, from
ai models, ordefaultfor Mailset’s pick.At most 100 characters.
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is the AI settings object.
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);
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)
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)
}
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
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;
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);
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 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 shows how.
mailset ai models set summaries --model claude-haiku-5-5
{
"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
},
ai.summarize
Summarize a conversation.
POST/v1/ai.summarize
Parameters
The conversation’s id.
Returns
data is an object with:
One of
offno_ainot_configuredcredit_usedkey_failingrate_limitedlimitfailedShow child attributesHide child attributes
The chat message’s own record; null for every other job.
Whose key paid: an org’s own key is worth nothing to Mailset.
One of
mailsetownAt Mailset’s price list on its key; zero on the org’s own.
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);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.summarize(
{"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"}
)
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.ai.summarize(
id: 't_5d2c8a1f9e3b47c6a0d1e2f3'
)
p answer
<?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;
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);
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 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 shows how.
mailset ai summarize t_5d2c8a1f9e3b47c6a0d1e2f3
{
"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
}
}
}
ai.replies
Suggest short replies to a conversation. Nothing is sent.
POST/v1/ai.replies
Parameters
The conversation’s id.
Returns
data is an object with:
One of
offno_ainot_configuredcredit_usedkey_failingrate_limitedlimitfailedShow child attributesHide child attributes
The chat message’s own record; null for every other job.
Whose key paid: an org’s own key is worth nothing to Mailset.
One of
mailsetownAt Mailset’s price list on its key; zero on the org’s own.
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);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.replies(
{"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"}
)
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.ai.replies(
id: 't_5d2c8a1f9e3b47c6a0d1e2f3'
)
p answer
<?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;
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);
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 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 shows how.
mailset ai replies t_5d2c8a1f9e3b47c6a0d1e2f3
{
"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
}
}
}
ai.draft
Write a draft reply to a conversation. Nothing is sent.
POST/v1/ai.draft
Parameters
The conversation’s id.
What you want the reply to do, in your own words.
At most 2,000 characters.
Returns
data is an object with:
One of
offno_ainot_configuredcredit_usedkey_failingrate_limitedlimitfailedShow child attributesHide child attributes
The chat message’s own record; null for every other job.
Whose key paid: an org’s own key is worth nothing to Mailset.
One of
mailsetownAt Mailset’s price list on its key; zero on the org’s own.
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);
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)
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{
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
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;
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);
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 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 shows how.
mailset ai draft t_5d2c8a1f9e3b47c6a0d1e2f3 --instructions "Say yes, and ask to move it to Thursday"
{
"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
}
}
}
ai.triage
Sort a conversation and check it for phishing, now.
POST/v1/ai.triage
Parameters
The conversation’s id.
Returns
data is an object with:
One of
primaryupdatesnewsletterspromotionsShow child attributesHide child attributes
The domain the mail really came from.
The domain or name it passes itself off as. Null when it imitates nobody known.
The check it failed, such as DMARC. Null when none did.
What it does that looks like fraud: a
lookalikedomain, apaymentask, a request forcredentials, or a riskyattachment.One of
lookalikepaymentcredentialsattachment
One of
offno_ainot_configuredcredit_usedkey_failingrate_limitedlimitfailed
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);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.triage(
{"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"}
)
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.ai.triage(
id: 't_5d2c8a1f9e3b47c6a0d1e2f3'
)
p answer
<?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;
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);
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 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 shows how.
mailset ai triage t_5d2c8a1f9e3b47c6a0d1e2f3
{
"ok": true,
"data": {
"tab": "primary",
"needsReply": true,
"phishing": {
"domain": "example.com",
"imitates": "text",
"failed": "text",
"reason": "lookalike"
},
"reason": "off"
}
}
ai.safe
Take a phishing warning off a conversation.
POST/v1/ai.safe
Parameters
The conversation’s id.
Returns
data is an object with:
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);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.safe(
{"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"}
)
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.ai.safe(id: 't_5d2c8a1f9e3b47c6a0d1e2f3')
p answer
<?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;
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);
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 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 shows how.
mailset ai safe t_5d2c8a1f9e3b47c6a0d1e2f3
{
"ok": true,
"data": {
"safe": true
}
}
ai.search
Turn a question into search operators.
POST/v1/ai.search
Parameters
What you’re looking for, in your own words. Up to 500 characters.
At most 500 characters.
Returns
data is an object with:
The question as search operators, or null to search the words as typed.
One of
offno_ainot_configuredcredit_usedkey_failingrate_limitedlimitfailedShow child attributesHide child attributes
The chat message’s own record; null for every other job.
Whose key paid: an org’s own key is worth nothing to Mailset.
One of
mailsetownAt Mailset’s price list on its key; zero on the org’s own.
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);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.search(
{"question": "invoices from Stripe since March"}
)
print(answer)
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)
}
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
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;
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);
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 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 shows how.
mailset ai search "invoices from Stripe since March"
{
"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
}
}
}
ai.explain
Say why a conversation is in its tab.
POST/v1/ai.explain
Parameters
The conversation’s id.
Returns
data is an object with:
One of
primaryupdatesnewsletterspromotionsIn words: your choice, headers, cached, sender pattern, shared sender, model.
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);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.explain(
{"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"}
)
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.ai.explain(
id: 't_5d2c8a1f9e3b47c6a0d1e2f3'
)
p answer
<?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;
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);
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 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 shows how.
mailset ai explain t_5d2c8a1f9e3b47c6a0d1e2f3
{
"ok": true,
"data": {
"tab": "primary",
"decidedBy": "text",
"why": "text"
}
}
ai.report
Show what sorted your mail and how much reached a model.
POST/v1/ai.report
Parameters
It takes no input: send an empty object.
Returns
data is an object with:
Conversations in your mailboxes by what placed them.
Conversations a model actually had to read to place.
Model calls paid for, and answers reused instead, in your orgs.
import { Mailset } from 'mailset';
// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();
const answer = await mailset.ai.report();
console.log(answer);
from mailset import Mailset
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()
answer = mailset.ai.report()
print(answer)
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)
}
require 'mailset'
# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new
answer = mailset.ai.report
p answer
<?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;
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);
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;
let answer = mailset.ai().report().await?;
println!("{answer:?}");
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 shows how.
mailset ai report
{
"ok": true,
"data": {
"byLayer": [
{
"layer": "text",
"threads": 1
}
],
"threads": 1,
"reachedModel": 1,
"modelShare": 1,
"calls": 1,
"hits": 1,
"callsAvoided": 1,
"usd": 1
}
}