AI & Technology

Introducing API Management: Build on the SweetPilot AI Workforce

SweetPilot's API lets developers call AI employees from their own code. Here is what it does today: endpoints, keys and permissions, IP allowlists, rate limits, idempotent retries, and analytics.

SweetPilot Team May 2, 2026 11 min read
Introducing API Management: Build on the SweetPilot AI Workforce

Quick Overview

Until now, SweetPilot was something you used in the dashboard. With API Management it is also something you can call from your own code. You create an API key in Settings, send requests to the public surface at /api/v1, and get an AI employee's answer back as JSON or as a stream. This post describes what the API does today: the endpoints, how keys and permissions work, the IP allowlist, rate limits, safe retries with idempotency keys, and the analytics you get for every key. It also says plainly what the API does not do yet.

What the API Does Today

The public API is small on purpose. These are the endpoints:

API chat is stateless. Each request stands on its own and nothing is saved to your dashboard conversations, so if you want a multi turn exchange you send the earlier messages with each request. Actions in connected accounts, such as sending an email from Gmail, are part of the dashboard chat and its approval step; they are not available through the API.

API Keys

Go to Settings, open the API tab, and create a key under Config. Name it (something like "Production Server" or "Local Dev"), pick the permissions it needs, and optionally set an expiry of 30 to 365 days. Keys start with sp_pk_. The full key is shown exactly once, so copy it somewhere safe; SweetPilot stores only a hash of it.

You can create as many keys as you need. Most teams create one per service and one per environment. If a key leaks, regenerate it or delete it, and the old value stops working immediately.

There is no separate test mode. A key used from your development machine does real AI work and uses credits the same way a production key does.

Permissions

Every API key carries a list of explicit permissions, chosen when the key is created:

If a key calls an endpoint it has no permission for, the response is a 403 with a message naming the exact permission it is missing. No silent failures, no mystery debugging. Give each key only what its job needs: a key for a public facing widget should be able to chat and nothing else.

Pick exactly which permissions each API key carries at creation.
Pick exactly which permissions each API key carries at creation.

IP Allowlists

For the keys that power your backend, you can lock them down to specific IP addresses. After creating the key, open the Security tab, choose Manage IPs, and add up to 50 addresses. Any request from an address that is not on the list is rejected with a 403 before it reaches the endpoint.

Addresses are matched exactly, so list each server address rather than a range. Combined with permissions, an allowlist means that a key stolen from a server cannot be used from a laptop or from anywhere outside your fleet.

Lock backend keys to known IPs so a leaked key has limited blast radius.
Lock backend keys to known IPs so a leaked key has limited blast radius.

Rate Limiting (with Headers Your Client Can Use)

Every API key has a budget of 120 requests per minute, the same on every plan. It protects your credit balance from runaway loops and misconfigured retries.

Responses include the headers you would expect:

If you hit the limit, the response is a 429. Wait the indicated number of seconds and retry. A general limit of 100 requests per minute from one IP address to one endpoint also applies to the whole site, including the API.

Idempotency for Safe Retries

Network calls fail. Functions get retried. Cron jobs run twice. Without idempotency, every retry of a chat request does the AI work again and uses credits again.

Send an Idempotency-Key header on any POST request, and the first successful response is stored for 24 hours for that API key. A later request with the same header replays the stored response instead of running again, and carries an Idempotent-Replayed: true header so your code can tell the difference. Errors are not stored, so a failed first call does not stop you from retrying. Use a unique value of 8 to 128 characters per logical operation; a UUID works well.

Analytics for Every Key

The API tab in Settings has four views:

The Performance tab surfaces response times and the slowest endpoints.
The Performance tab surfaces response times and the slowest endpoints.

How to Get Started

Three steps from zero to your first authenticated request.

Step 1. Create an API Key

In your SweetPilot dashboard go to Settings, then API, then Config. Click "Create Key," name it, and pick the permissions it needs. Copy the key when it is shown.

Step 2. Make Your First Request

Every request needs a Bearer token in the Authorization header

GET https://sweetpilot.com/api/v1/employees
Authorization: Bearer sp_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

A successful response returns a JSON list of the AI employees, each with the id you use in the chat endpoint.

Step 3. Chat with an Employee

Send a message to an employee by id. Ink is the copywriter:

POST https://sweetpilot.com/api/v1/employees/ink/chat
Authorization: Bearer sp_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

{"message": "Write a two sentence product description for a stainless steel water bottle."}

Add ?stream=true to receive the reply as a stream of events instead of a single JSON response. To continue a conversation, send a messages array with the earlier turns instead of a single message.

What You Can Build

A few patterns the API supports today:

What the API Does Not Do Yet

FAQs

Q1 Is API Management included in my plan?

Answer :Yes. API access is included on every SweetPilot plan, from Starter at $9 per month upward. There is no free plan. The plans differ only in the monthly credit allowance.

Q2 Do API requests use credits?

Answer :Yes. A chat request through the API uses credits from the same monthly allowance as the dashboard, based on the length of the request and the reply.

Q3 Can I rotate keys without downtime?

Answer :Yes. Create a new key, swap it into your production config, then delete the old one.

Q4 What happens if I hit my rate limit?

Answer :You get a 429 response with a Retry-After header. Wait the indicated number of seconds and retry. Your client should respect this header automatically.

Q5 Does the API work with every AI employee?

Answer :Yes. Every employee returned by the employees endpoint can be used in the chat endpoint, including Ink, Aria, Atlas, and the rest of the team.

Q6 Does the API remember earlier messages?

Answer :No. Each request is independent. Send the earlier turns in the messages array when you need context.

Conclusion

API Management gives developers a direct line to SweetPilot's AI employees: keys with explicit permissions, IP allowlists, per key rate limits, idempotent retries, and analytics for every key. It is a focused surface today, built around chatting with an employee and asking your Brain AI a question.

Create your first API key today. Head to Settings, then API, in your SweetPilot dashboard, create a key, and make your first authenticated request in under five minutes. See the plans if you do not have an account yet.

#API management#AI workforce#SweetPilot#business operations#technology integration

Enjoyed this article?

Discover how SweetPilot's AI employees can transform your business.

See plans and get started