Skip to main content
LLM.kiwi LogoLLM.kiwi

Lovable Integration

Lovable allows you to build software just by describing it. You can power the AI features of your Lovable-built apps with LLM.kiwi.

Integration Guide

Since Lovable applications are often exported as React/Supabase projects, integrating LLM.kiwi follows the standard OpenAI SDK pattern.

1. Add Environment Variables

In your project settings or .env file:

VITE_OPENAI_BASE_URL=https://api.llm.kiwi/v1
VITE_OPENAI_API_KEY=sk-...

2. API Call Implementation

// Example function to call LLM.kiwi
export async function generateText(prompt: string) {
  const response = await fetch('https://api.llm.kiwi/v1/chat/completions', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${import.meta.env.VITE_OPENAI_API_KEY}`
    },
    body: JSON.stringify({
      model: 'gpt-4o',
      messages: [{ role: 'user', content: prompt }]
    })
  });

  return response.json();
}