What costs credits
Four tools spend one credit per call, the same as generating or AI-editing in the app:
If the AI step itself fails, the credit is refunded. Everything else is free, including AI analysis such as
score_email, improve_email, apply_dark_mode, create_segment, and import_brand. Every call, free or not, counts toward the per-minute call budget. See Credits and limits.
Emails
edit_email saves only if nobody changed the email while it worked. If you or a teammate saved it in the editor meanwhile, your save is kept, the edit is discarded, the credit is refunded, and the assistant is told to read the email again.
Campaigns
These tools work only on draft campaigns. None of them sends anything. When
get_campaign_state says the campaign is ready, open it in the app to send it or confirm the schedule.
Audience
Brands
Analytics
All read-only. The summary, series, and campaign-table tools take a number of days to look back over.Templates
To start from a template, have the assistant pass its ID to
create_email.
ESP
These work only after you’ve connected an ESP in the app. Otherwise they reply that the provider isn’t connected. Connecting stays a human step.generate_email in detail
It returns two blocks: the finished email as ready-to-send HTML, and a metadata block with
email_id, subject, preheader, score, subject_variants, and dark_mode. The email is saved in your workspace, so the assistant can carry on with edit_email, score_email, or select_email using that email_id.
generate_email doesn’t take a format. For the editable MJML source, follow up with get_email.Ask for good results
The same things that make a good prompt in the app make a good one here: who it’s going to, what you want them to do, and the tone. A brand handles the look.Troubleshooting
The assistant doesn't use the tools
The assistant doesn't use the tools
Mention AlpacaRelay or the tool by name, such as “use generate_email to…”. Assistants sometimes write their own draft when the request sounds like ordinary writing.
"Too many tool calls: the limit is 60 a minute"
"Too many tool calls: the limit is 60 a minute"
The per-minute call budget is spent. The message says how many seconds to wait. Long agent loops over many contacts or emails hit this first, so ask for one bulk call (
import_contacts) instead of many small ones."Too many concurrent generations"
"Too many concurrent generations"
Three generations run at once per workspace, counted across every key and sign-in. A fourth is refused until one finishes, and extra keys don’t raise the limit. Only
generate_email counts toward it.The assistant gives up while waiting
The assistant gives up while waiting
Generation can take minutes. If your client has a configurable tool timeout, raise it to at least six minutes. If it gives up anyway, the email usually still finishes and appears in your workspace, so check
list_emails before asking again.A campaign tool refuses to change the campaign
A campaign tool refuses to change the campaign
It has left draft, because it was sent or scheduled in the app. Create a new campaign, or edit this one in the app.
It says you're out of credits
It says you're out of credits
Top up under Settings → Billing & usage. Credits are shared with the app and the REST API. There’s no separate API allowance.