# Use LlamaIndex with Bridge

URL: https://bridge.wekoya.tech/guides/llamaindex
Updated: 2026-11-08

**In short:** Install `llama-index-llms-openai-like` and create an `OpenAILike` with Bridge's API base, your key and `is_chat_model=True`. Set `is_function_calling_model=True` for tools and `context_window` to the model's real context. Every Bridge model then works in LlamaIndex, billed in naira.

```bash
pip install llama-index-llms-openai-like
```

```python
import os
from llama_index.llms.openai_like import OpenAILike

llm = OpenAILike(
    model="gemini-3.5-flash-lite",
    api_base="https://wekoya-api.wekoya.tech/v1",
    api_key=os.environ["WEKOYA_API_KEY"],
    is_chat_model=True,
    is_function_calling_model=True,
    context_window=1048576,  # this model's context, from its page
)
print(llm.complete("Hello"))
```

- `is_chat_model=True` is required: without it LlamaIndex calls the old completions endpoint, which Bridge does not have.
- `context_window` defaults to 3,900 tokens. Set it to the model's context from its page on the [models page](https://bridge.wekoya.tech/models).
- For embeddings, Bridge serves `gemini-embedding-2` on OpenAI's embeddings route. See [embeddings](https://bridge.wekoya.tech/docs/embeddings).

[Create a free account](https://bridge.wekoya.tech/sign-up)

## Common questions

**Why do I get 404 errors from LlamaIndex?**

Usually is_chat_model is missing, so LlamaIndex calls /v1/completions. Set is_chat_model=True.

## Read next

- [LangChain with Bridge](https://bridge.wekoya.tech/guides/langchain)
