Features
Marnix AI — LLM without API keys
Every app you build has a built-in LLM. No OpenAI/Anthropic account needed, no key setup — it just works.
AI features with zero setup
Every app deployed through Marnix gets a built-in LLM — no OpenAI or Anthropic account required, no API keys to paste, no user dashboards to navigate. When your app needs AI (chatbot, content generator, summarizer, classifier), it calls Marnix AI and gets a streaming response. Your users never see a “paste your API key” prompt.
Marnix handles auth, rate limits, and billing. Each call costs 3 Marnix credits (~$0.03) and is deducted from your balance — the app builder's — not the end user's. That means you can ship an AI chatbot to a friend with zero friction.
What you get included
Free plan (300 credits) covers ~60 AI calls after one starter build. Pro plan (2,000 credits) covers ~500 AI calls on top of your builds. Business plan (5,000 credits) covers ~1,500+. Plenty for a working chatbot with real traffic.
How to use it in a prompt
You don't have to do anything special — just describe the AI feature you want and Marnix wires it up:
- “Build me a chatbot that helps users plan weekly meals.”
- “Add an AI summarize button that condenses long notes into three bullet points.”
- “When a user pastes a URL, call an AI to extract the page title, author, and a one-line summary.”
- “Classify every submitted ticket as 'bug', 'feature', or 'question'.”
Marnix reads the MARNIX_AI_KEY environment variable (injected at deploy time) and generates a server-side proxy route for you. You don't need to touch any of this unless you want to customize the integration.
Under the hood — the server-proxy pattern
If you export your code or want to customize the AI behavior, here's what Marnix generates. Every app has a route handler that forwards requests to Marnix AI with your key:
Your browser code calls /api/chat (your own route), never marnix.ai/api/marnix-ai/chat directly. That keeps the key off the browser where anyone could steal it.
Three example patterns
1. Streaming chatbot
Perfect for conversational UIs — responses stream word-by-word so the UI feels alive.
2. Single-shot content generation
For summarizers, rewriters, or any one-shot generation where streaming isn't needed. Set stream: false and you get JSON with token usage and remaining credits.
3. Classifier / extractor
Use a strict system prompt to get structured output. Parse the result as JSON.
Request options
messages— array of{ role, content }. Roles:user,assistant,system. Up to 100 messages per call.system— optional top-level system prompt (alternative to a system-role message).stream—true(default) returns plain-text chunks;falsereturns a full JSON response.maxTokens— max output tokens. Default 1,024. Hard cap 4,096.
Error handling
Non-2xx responses return JSON with an error code and a human-readable message:
- 402
insufficient_credits— the builder is out of Marnix credits. Show a clear empty state like “This app is out of AI credits. Try again later.” The response includescreditsRemaining. - 429
rate_limit_exceeded— per-app caps are 60 calls/minute and 5,000 calls/day. Response includeslimit: 'minute' | 'day'. Retry after the window clears. - 401
invalid_api_key— theMARNIX_AI_KEYis missing or invalid. Rare — usually means the deploy didn't complete or the app was deleted. Re-deploy to fix. - 400
bad_request— malformed JSON, missingmessages, or bad role. Fix the request shape.
Security — the one rule
Never put MARNIX_AI_KEY in client code
The key is server-only. If you ever put it in a NEXT_PUBLIC_* env var or reference it in a 'use client' component, anyone can steal it from the browser and burn your credits. Always proxy through a server-side route. Marnix generates the proxy for you by default — keep it that way.
Model & reliability
Marnix AI uses Claude Haiku 4.5 via the Vercel AI Gateway. Haiku is fast (streaming kicks in within ~400ms) and handles the vast majority of chatbot / summarizer / classifier use cases cleanly. The Gateway adds automatic failover — if Anthropic has an outage, requests route through a fallback provider without code changes.
We'll add more model tiers (including Sonnet for harder reasoning) in a future update. For now, one model keeps the pricing clean: 3 credits, every call.