Clarification Handling

When the prompt is ambiguous, the API returns status: "clarification_needed". Handle the questions and retry.

javascript
async function askNeuralAI(prompt) {
  const response = await fetch("https://app.neuralaiweb.com/functions/neuralaiPublicApi", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ api_key: "YOUR_API_KEY", prompt })
json (clarification response)
{
  "status": "clarification_needed",
  "questions": [
    "What image style do you prefer? (realistic, cartoon, artistic)",
    "What dimensions do you want? (square, horizontal, vertical)"

πŸ’‘ Tip:

Always show a user-friendly interface for clarification questions, with pre-filled options when possible to reduce friction.