AI

Add chatbots, writing, summaries and search to your site with AI models from Anthropic, OpenAI, Google and more, with no account or API key to set up, paid from your workspace credits.

On this page

Every site on a paid plan can use AI. A chatbot that answers questions about your products, a tool that writes a description from a few words, search that understands what a visitor means: your site's server code calls an AI model through Modulify, and the answer comes back in the format the OpenAI libraries already use. There is no account to open with an AI company, no API key to paste in and no separate bill. What your site uses is paid from your workspace credits.

You rarely need to write the code yourself. Ask in chat for the feature, such as "add a chat assistant that answers questions about my menu", and the chat builds it on your site's AI without asking for a key. Chat can also tell you how much AI the site used, turn AI on or off, change the monthly cap and rotate the key when you ask it to, and it asks before it rotates the key.

Before you begin

AI is on from the start for every site, and it needs a paid plan. On the free plan your site can already hold AI code, and every request answers that AI needs a paid plan until the workspace upgrades.

Your site gets two managed secrets on its own, the next time its preview starts and every time it is published: MODULIFY_AI_URL, the address it calls, and MODULIFY_AI_KEY, its own key. Nobody has to open the AI tab first.

Any member of the workspace who can edit the site can turn AI on and off and set the monthly cap. Showing, copying and rotating the key need the Delete projects permission. Without it those buttons are disabled, with a tooltip saying why.

Open the AI tab

Click More in the tab strip, then AI. The address ends in /ai. In the Modulify app for iPhone and Android, AI is in More too, with the same tabs, see On the mobile app.

Four tabs sit under the heading:

  • Overview, the switch, the status and this month's usage
  • Insights, requests, tokens and credits for the period you pick, per day and per model
  • History, every request the site made, newest first
  • Settings, the monthly cap, the models with their prices, and API access with the key and code examples

Turn AI off and on

Use AI on this site on the Overview tab turns AI on or off for the whole site. Turning it off asks first, Turn off AI?, because every AI feature on the site stops answering at once. While it is off, every request answers 403. Turning it back on works straight away.

What it costs

AI is paid per request, at the model's price per token. Prices are shown on the Settings tab under Models, in credits per million tokens on your plan, for the text your site sends (Input), what the model writes back (Output) and text the provider reused from an earlier request (Cached input). A short chat answer usually costs a small fraction of a credit.

Your site does not pay request by request from your balance. It buys AI usage 1 credit at a time from the workspace credits, only when it needs more, and keeps whatever it has not used yet. Each purchase shows on the Usage tab of Plans as AI usage added, under AI. See Credits.

A request that fails is not charged. A streamed answer that your visitor stops partway through is charged for what was written until then.

This month on the Overview tab shows the AI requests this month, the Credits used and Credits bought, the Prepaid left and the Monthly cap. It counts from the 1st of the month, in UTC.

When AI pauses

AI pauses instead of running up a bill:

  • AI is paused until credits are added when the workspace has no credits left. The workspace owner gets an email, and AI starts again on its own within a minute once credits are added. The Overview tab says AI starts again within a minute once the workspace has credits again.
  • AI is paused until next month when the site reached its monthly cap. Raise the cap, or wait for the 1st.
  • AI needs a paid plan when the workspace is on the free plan.

While AI is paused, every request answers 402 with the reason, so your site can show visitors a friendly message.

Set a monthly cap

Monthly credit cap under Monthly cap on the Settings tab is the most credits this site may spend on AI in a calendar month. Type a whole number of credits and save it. Leave it empty for no cap, which is how every site starts. Once the site reaches the cap, AI pauses until the 1st of next month or until you raise the cap.

A cap is worth setting on any site whose AI features visitors can use freely, such as a public chatbot, since every visitor's question spends your credits.

Pick a model

Your site names a model in each request. Three names cover most needs:

  • modulify/fast, quick and low cost answers for chat, summaries, extraction and classification. This is the model your site uses when it names none.
  • modulify/smart, stronger reasoning and writing for assistants and longer answers.
  • modulify/embed, embeddings for search and "chat with your documents".

modulify/fast and modulify/smart move to another provider on their own when one is down, so a provider outage does not stop your site. Models on the Settings tab lists every other model by name, such as anthropic/claude-sonnet-5.5 or google/gemini-3.8-flash, with its price, and marks the default for each kind.

You can also name one model directly. A model named directly stays on that model:

Model Name Kind Good for
Claude Haiku 5.5 anthropic/claude-haiku-5.5 Chat Fast and low cost, with strong writing and tool use
Claude Sonnet 5.5 anthropic/claude-sonnet-5.5 Chat Balanced quality and speed for assistants, writing and tools
Claude Opus 5.5 anthropic/claude-opus-5.5 Chat The most capable Claude for hard reasoning and long tasks
GPT-6 Luna openai/gpt-6-luna Chat Fast and low cost OpenAI model for everyday tasks
GPT-6.1 Terra openai/gpt-6.1-terra Chat Mid-sized OpenAI model with a good balance of cost and quality
GPT-6.1 Sol openai/gpt-6.1-sol Chat Capable OpenAI model for reasoning, writing and tools
Gemini 3.5 Flash Lite google/gemini-3.5-flash-lite Chat Very fast Google model for simple, high volume tasks
Gemini 3.8 Flash google/gemini-3.8-flash Chat Fast Google model that reads images, audio and long documents
Gemini 4 Argon google/gemini-4-argon Chat The most capable Gemini for reasoning over long inputs
DeepSeek V4.1 Flash deepseek/deepseek-v4.1-flash Chat Open model with very low cost for bulk text work
Text Embedding 3 Small openai/text-embedding-3-small Embeddings Low cost embeddings with 1,536 dimensions for search and retrieval
Text Embedding 3 Large openai/text-embedding-3-large Embeddings Higher quality embeddings with 3,072 dimensions
Gemini Embedding 2 google/gemini-embedding-2 Embeddings Multilingual embeddings from Google for search across languages

Every chat model reads text and images. The prices of each model are on the Settings tab, in credits on your plan.

Call it from your site

API access on the Settings tab shows the address and the AI key, and Code examples shows the same call three ways: plain fetch, the OpenAI SDK and the AI SDK.

import OpenAI from 'openai'

const ai = new OpenAI({
    baseURL: process.env.MODULIFY_AI_URL,
    apiKey: process.env.MODULIFY_AI_KEY
})

const completion = await ai.chat.completions.create({
    model: 'modulify/fast',
    messages: [{ role: 'user', content: 'Write a one line welcome for my site.' }]
})

Call AI only from server code, such as an API route, a route handler or a server action. The key spends your workspace credits, so never send it to the browser.

The endpoints, every error and the limits are on AI HTTP API.

Rotate the key

The rotate button beside the AI key replaces it. It asks first, Rotate the AI key?: the old key stops working within a minute, the preview gets the new one right away, and the live site keeps the old key until you publish again, so AI stops answering there until then. Rotate only when the key may have leaked.

Insights and history

Insights shows Requests, Credits, Input tokens and Output tokens for the period you pick with the date picker. Click Requests or Credits to chart it over time, with failed requests shown apart from answered ones. By model splits the same numbers per model, with each model's average latency.

History lists every request the site made, newest first: when it was made, the model and the one that answered when they differ, whether it was Answered, Failed or Stopped, its tokens, its credits and how long it took. A request whose tokens the provider did not report is marked Estimated. Each request stays in the history for 30 days.

Modulify keeps these counts only. It never stores what your visitors asked or what the AI answered.

Limits

  • Each site can send 600 AI requests a minute. Past that, requests answer 429 until the minute rolls on.
  • A request can be up to 16 MB, images included.

Your visitors' data

What a visitor types into an AI feature of your site goes to OpenRouter, which passes it to the model's provider, such as Anthropic, OpenAI or Google, only to return the answer. Through OpenRouter, Modulify only uses providers that do not keep that content or train on it. If your site offers AI features to its visitors, say so in your own privacy policy. See the Privacy Policy.

From an AI client over MCP

A connected AI client, or your own code through the HTTP API, reaches this tab through these tools:

config:write and credentials:reveal are unticked by default. get_site_ai_key and rotate_site_ai_key also need the Delete projects permission, like the buttons beside the AI key, and rotate_site_ai_key does not return the new key. See MCP tools.

Next