AI inside a drop
How a drop can call an AI model without an API key: the functions, which model answers, what the maker can configure and what happens when a limit is reached.
Last updated
How a drop calls AI
window.claude.complete(prompt)returns a promise with the answer as text. This matches the function Claude artifacts use, so an AI artifact built in Claude keeps working on Toolcrow.- Calls with
fetchto the Anthropic Messages API (api.anthropic.com/v1/messages) or the OpenAI Chat Completions API (api.openai.com/v1/chat/completions) are picked up by Toolcrow and answered in the same response format the code expects. - All of these go through Toolcrow's AI proxy. The maker does not need an API key, and no key is ever placed in the page.
Which model answers
- Every call is answered by a small, fast OpenAI model that Toolcrow chooses (currently gpt-5.4-nano), whatever model the code asks for.
- Streaming requests get the full answer in one piece.
- An answer is at most 4,096 tokens long.
window.claude.complete()always uses this maximum. Afetchcall that setsmax_tokens(ormax_completion_tokens) gets that maximum instead. A longer answer is cut off. - A call that gets no answer from the model within 25 seconds is stopped and fails (see below).
- The maker can set a custom system prompt for a drop on the drop page: Connections, then "How it's built", then "Edit prompt" next to AI. It replaces the system message in the drop's code, so the behaviour can be tuned without a new version, and it works right away for everyone using the tool. "Go back to the prompt from your code" removes it again. If the code has more than one prompt, the custom prompt replaces all of them.
Limits
- AI calls per drop per day depend on the maker's plan. The "AI credits" tile on the home page shows how many are left today on the maker's busiest tool (the limit counts per tool and resets at midnight, Amsterdam time), and the Usage panel on the drop page shows how much that drop used today; the Usage panel also shows the requests per day over the last 7 or 30 days.
- AI that Toolcrow runs for a drop on the maker's behalf (such as summing up its feedback) counts toward the same daily limit.
- Toolcrow also has an overall daily AI budget and can switch the AI proxy off.
- The day runs on Amsterdam time.
When a call fails
- When a limit is reached, the call is answered with HTTP status 429 and
{ error: "rate_limited", reden }, whereredenisdrop-limiet(this drop's daily limit),globaal-budget(Toolcrow's daily budget) oruit(AI switched off). - When the model does not answer in time or answers with an error, the call is answered with status 502 and
errorset toupstream_unreachableorupstream_error, without areden. - When the page's access has run out or changed since it was opened (see
unauthorizedin Saving data), the call is answered with status 401. - A
fetchcall gets these responses as they are, so the code can checkres.okandres.status. window.claude.complete()rejects with anErrorwhose message is "Toolcrow AI: " followed by thereden, for exampleToolcrow AI: drop-limiet. Without areden(time-out, model error, expired access) the message isToolcrow AI: unavailable. When Toolcrow cannot be reached at all, it rejects with the browser's own network error, without the "Toolcrow AI:" prefix.- Code that catches these errors can show a friendly message, for example that today's AI limit has been reached.
Where it works
AI works on open, password-protected and private drops. A drop that is turned off or taken down gets no AI.
Something missing or unclear? Email hello@toolcrow.app. We answer personally.
