Backend & SDK
AI (m77.ai)
Add AI features to your app with one line.
m77.ai.chat runs a chat completion with Builder77 AI. Calls are metered by tokens: 1 integration credit per 500 tokens (input + output, minimum 1 per call) from the app owner's plan — about 3–4 credits for a typical reply.
const reply = await m77.ai.chat('Write a friendly welcome message for a bakery');
const answer = await m77.ai.chat(
[{ role: 'user', content: 'What should I cook tonight?' }],
{ system: 'You are a helpful chef. Keep answers under 80 words.' }
);Structured JSON
Pass json: true to get parsed JSON back:
const ideas = await m77.ai.chat(
'Suggest 3 recipes using eggs, spinach and feta. Return {"recipes":[{"title","minutes","steps":[]}]}',
{ json: true }
);
ideas.recipes.forEach(r => console.log(r.title));Good to know
- Up to 20 messages of history per call.
- Rate limited to protect your credits (30 calls per minute per visitor).
- If the app owner runs out of integration credits, calls fail with status 402.