In the app: Sidebar → Agent Settings → APIs, then Add API action or open an action and click Edit (
/home?settings=http_tools).Write When to use like a briefing
Say what it does, when to use it, what comes back and what to do with it. The limit is 500 characters.Return a hint and keep replies small
- Add a one-line instruction such as
hintso the agent knows what to say next. - Send only the fields the agent needs. It reads about the first 4,500 characters.
- Return a normal
200with a clear message when nothing is found, for example{"found": false, "hint": "Ask for the account number."}. A4xxalso works, but the agent only learns “the lookup service returned an error”. - Never return stack traces or details the caller should not hear. Anything you return can be spoken.
Be fast
The caller is waiting. Aim for under 2 seconds. SmartAlex stops waiting at 10 seconds. If the work is slower, make two actions: one that starts the job and returns an id, and one that checks it. The agent can talk to the caller between them.Lookup only
Switch Lookup only on for an action that reads data and changes nothing. The caller can keep talking while it runs. Leave it off for anything that books, charges or updates, so the agent waits for the result. Each action takes one of the agent’s 20 tool slots either way. See How many tools an agent can have.Make changes safe to repeat
The agent may run an action twice, for example when the caller repeats a question. Make endpoints that change things safe to repeat, or return an id the agent can confirm. The limit of 10 runs a minute per call also stops loops. See Rate limits.Do not trust inputs blindly
Inputs are checked against types, not meaning. If an input is a phone number, check it on your side and return ahint asking the caller again when it is wrong.
Protect the endpoint
Anyone who learns the URL can call it. Use a key from API key and, for the standard format, verify the signature.Test before you go live
1
Send a test
On the Test tab click Send test. Check your server received it, the signature checked out and the reply is what you want.
2
Read the preview
The Test result shows the request, the reply, the status and the time, and what the agent is told.
3
Switch it on and place a call
Turn on Live, switch APIs on for the agent and call it. The Requests tab shows each run.
Watch the Requests tab
Filter by Failed. A run of failures from your API means it is flaky. Repeated Timed out means it is slow, and repeated Invalid inputs means When to use is steering the agent wrong. An action that never runs needs clearer wording.When an API is the wrong tool
APIs are for quick lookups the agent chooses to make. They are not for files, long jobs over 10 seconds or logic that should always run. For a ready-made app use a connector.Related
Request and response
The reply shape in detail.
Code samples
Handlers that return a hint.

