Skip to main content
Each handler checks your key, verifies the signature, reads the tool name and inputs, and returns a reply with a hint. They use the standard format, where the body is { tool, arguments, ... }. Replace the lookup with your own logic.
In the app: add the endpoint’s address in Sidebar → Agent Settings → APIs → Add API action with Format set to SmartAlex standard and Sent as set to Bearer token (/home?settings=http_tools).

How do I use these handlers?

Each sample needs the verifySignature function from Signature verification in the same file or module. Set two environment variables: SMARTALEX_SIGNING_SECRET (the shs_ secret) and SMARTALEX_TOOL_TOKEN (the key you saved under API key).
1

Copy your verify function

Take the one for your language from the signature page.
2

Add the handler below

It must read the raw body before any JSON parsing.
3

Expose it over HTTPS

Use a public address, then add it as the action’s URL.

What does a stand-in lookup look like?

Replace it with a lookup in your own system, and keep it quick. The reply the handler returns is what the agent reads. See Request and response.

Signature verification

The verify functions these handlers use.

Troubleshooting

When the handler is not reached or rejects a request.
Last modified on November 27, 2026