Emberskill AI API

Streaming AI agent with access to Emberskill tools via MCP.

Endpoint

POST https://ai.emberskill.com/api/chat

Authentication

All requests require a valid Supabase JWT token in the Authorization header.

Authorization: Bearer <your_supabase_jwt_token>

Request Body

{
  "messages": [
    {
      "role": "user",
      "content": "Your message here"
    }
  ],
  "system": "(optional) Custom system prompt"
}

Response

Returns a streaming response using the Vercel AI SDK data stream format. The response includes text chunks and tool call results as they become available.

Available Tools

The AI has access to all tools available via mcp.emberskill.com, including course management, user data, and learning progress tools.

Example Usage

const response = await fetch('https://ai.emberskill.com/api/chat', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${token}`,
  },
  body: JSON.stringify({
    messages: [
      { role: 'user', content: 'List my courses' }
    ]
  }),
});

// Handle streaming response
const reader = response.body.getReader();
// ... process stream