Support Brain Example
Draft customer or community replies with intent, confidence, suggested action, and context update.
When to use this task
Use these examples as starting points, then adapt the input contract to your own product.
Request JSON
Send this payload to /v1/generate with your OneAI API key.
{
"type": "support_brain",
"input": {
"message": "What is OneAI and how can my product use it?",
"context": "customer support",
"customer": "new SaaS builder",
"recentMessages": "The user is asking for a simple explanation and next step."
},
"options": {
"llm": {
"mode": "balanced",
"maxCostUsd": 0.05
}
}
}cURL
Use Idempotency-Key for production retries and store requestId from the response.
curl -s https://oneai-saas-api-production.up.railway.app/v1/generate \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_ONEAI_API_KEY" \
-H "Idempotency-Key: support-brain-001" \
-d '{"type":"support_brain","input":{"message":"What is OneAI and how can my product use it?","context":"customer support","customer":"new SaaS builder","recentMessages":"The user is asking for a simple explanation and next step."},"options":{"llm":{"mode":"balanced","maxCostUsd":0.05}}}' | jqExample output shape
Actual model wording can vary, but your integration should expect the same business-level structure.
{
"reply": "OneAI helps your product call multiple models and package common workflows into structured AI tasks.",
"intent": "product_explanation",
"confidence": 0.86,
"suggestedAction": "Offer the quickstart and invite the user to test business_strategy in Playground.",
"memoryUpdate": "Customer is evaluating OneAI for SaaS product integration."
}Use balanced mode for customer-facing replies. Keep maxCostUsd low and store requestId for support audits.
This example is available on the Pro tier. Free examples are suitable for initial testing. Pro examples are designed for customer-facing workflows.
Common mistakes
Most integration issues come from missing context or using the wrong plan for the task tier.
Load the matching preset in Playground, run a real request, then copy the final payload into your backend.