AI API Documentation

Welcome to the Dentogrid AI ecosystem. This API provides access to state-of-the-art language models hosted specifically for your educational platform. Built on Ollama and served through a high-performance Laravel gateway, currently powered by Llama 3.2 (3B).

Quick Start

The fastest way to test the API is using a standard curl command. All endpoints require JSON payloads and return JSON responses.

curl -X POST https://ai.dentogrid.com/api/ai/generate \
-H "Content-Type: application/json" \
-d '{"prompt": "Generate a lesson plan for 5th grade math about fractions."}'

Generation API

Use this endpoint for single-turn completions, task automation, or content generation. The default model is llama3.2.

POST /api/ai/generate

Parameters

  • prompt Required - The instruction or text to process.
  • model Optional - Override the default model (e.g., qwen2.5-coder:7b).
  • stream Optional - Boolean to enable/disable streaming (default: false).

Example Response

{
  "model": "qwen2.5:1.5b",
  "response": "Here is the content you requested...",
  "done": true
}

Chat API

Perfect for build interactive AI tutors or conversational assistants within the platform.

POST /api/ai/chat

Parameters

  • messages Required - Array of message objects with role and content.
  • model Optional - Specific model to use.
{
  "messages": [
    {"role": "system", "content": "You are a helpful science teacher."},
    {"role": "user", "content": "How do plants grow?"}
  ]
}

Educational Magic

Leverage the power of local AI to transform the learning experience. Here are some sophisticated ways to integrate this API:

1. Automated Quiz Generation

Provide a topic or a paragraph of text, and ask the AI to generate 5 multiple-choice questions with explanations.

2. Intelligent Essay Grading

Feed student essays into the API and request structured feedback based on rubrics (grammar, structure, creativity).

3. AI Tutor Personas

Create specific personas using the System Prompt in the Chat API (e.g., "You are Socrates. Answer every question with another question to encourage critical thinking").

Egyptian Arabic (Aya Model)

We've integrated the Aya model, which is specifically optimized for high-quality Arabic responses, including the Egyptian dialect.

Example: Egyptian Conversation

curl -X POST https://ai.dentogrid.com/api/ai/generate \
-H "Content-Type: application/json" \
-d '{"prompt": "ازيك؟ عامل ايه النهاردة؟"}'