> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getlilac.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI Compatibility

> Learn which OpenAI API features Lilac supports and how to migrate from OpenAI by changing just the base URL and API key in your existing code.

Lilac provides an OpenAI-compatible API. If you're already using the OpenAI SDK, you only need to change the base URL and API key.

## Migrating from OpenAI

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from openai import OpenAI

    # Before (OpenAI)
    client = OpenAI(api_key="sk-...")

    # After (Lilac) — just change base_url and api_key
    client = OpenAI(
        base_url="https://api.getlilac.com/v1",
        api_key="your-lilac-api-key",
    )

    # Everything else stays the same
    response = client.chat.completions.create(
        model="moonshotai/kimi-k2.6",
        messages=[{"role": "user", "content": "Hello!"}],
    )
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    import OpenAI from "openai";

    // Before (OpenAI)
    const client = new OpenAI({ apiKey: "sk-..." });

    // After (Lilac) — just change baseURL and apiKey
    const client = new OpenAI({
      baseURL: "https://api.getlilac.com/v1",
      apiKey: "your-lilac-api-key",
    });
    ```
  </Tab>
</Tabs>

## Supported Endpoints

| Endpoint                    | Status             |
| --------------------------- | ------------------ |
| `POST /v1/chat/completions` | Supported          |
| `POST /v1/completions`      | Supported (legacy) |
| `POST /v1/responses`        | Supported          |
| `GET /v1/models`            | Supported          |

## Supported Features

| Feature                             | Status    |
| ----------------------------------- | --------- |
| Chat completions                    | Supported |
| Streaming                           | Supported |
| System messages                     | Supported |
| Vision (image inputs)               | Supported |
| Tool / function calling             | Supported |
| Structured output (JSON mode)       | Supported |
| Reasoning (thinking on/off)         | Supported |
| Temperature, top\_p, top\_k, min\_p | Supported |
| Frequency & presence penalties      | Supported |
| Log probabilities                   | Supported |
| Seed (deterministic sampling)       | Supported |
| Stop sequences                      | Supported |
| Multiple choices (n)                | Supported |

## Not Yet Supported

The following OpenAI features are not currently available:

* Embeddings
* Audio
* Fine-tuning
* Assistants API
* Batch API
* File uploads

<Info>
  We're actively expanding API coverage. [Let us know](mailto:contact@getlilac.com) which features matter most to you.
</Info>
