Chat Completions API Reference

Integrate Lexino AI into your applications, terminal scripts, or study bots via the versioned REST API.

⏱️ 4 min readPublic Document (No Sign-in Needed)

Lexino AI provides a developer-friendly HTTP API endpoint hosted on chat.lexinoai.in for programmatic message synthesis.

#Endpoint URL

The primary endpoint for conversational inference is:

POST https://chat.lexinoai.in/api/v1/chat (or /api/chat)

#Request Format

Send a JSON payload with your message content and optional model selector:

bash
curl -X POST https://chat.lexinoai.in/api/v1/chat \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Explain binary search tree balancing algorithms in C++",
    "selectedModel": "default"
  }'

#JavaScript / TypeScript Client Example

Consume the streaming response in Node.js or the browser:

typescript
async function generateAnswer(prompt: string) {
  const response = await fetch('https://chat.lexinoai.in/api/v1/chat', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ content: prompt, selectedModel: 'default' }),
  });

  const reader = response.body?.getReader();
  const decoder = new TextDecoder();

  while (reader) {
    const { done, value } = await reader.read();
    if (done) break;
    process.stdout.write(decoder.decode(value));
  }
}