Skip to main content
The agent decides when to run an API action from its When to use text, and decides what to say from your reply. So write clearly, reply briefly and answer fast.
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.
Name each input in plain words too. The line under each input is what the agent is told about it.

Return a hint and keep replies small

  • Add a one-line instruction such as hint so 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 200 with a clear message when nothing is found, for example {"found": false, "hint": "Ask for the account number."}. A 4xx also 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 a hint 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.

Request and response

The reply shape in detail.

Code samples

Handlers that return a hint.
Last modified on November 27, 2026