← All applications · Connect apps section on /docs
OpenAIManual setup
LlamaIndex
OpenAILike trỏ Vietrouter /v1.
Base URL to paste
Paste exactly one of two formats — wrong URL yields 404 (not 401).
https://vietrouter.com.vn/v1Prerequisites
- pip install llama-index-llms-openai-like
Recommended model: claude-fable-5
Quick way — command / config
from llama_index.llms.openai_like import OpenAILike
llm = OpenAILike(
model="claude-fable-5",
api_base="https://vietrouter.com.vn/v1",
api_key="sk-mtm-...",
context_window=1000000,
is_chat_model=True,
)
print(llm.complete("Hello!"))Where to place file / fill Settings
Environment variableany
.env
OPENAI_API_KEY=sk-mtm-…
Verify connection
- complete() trả text
Troubleshooting
| Symptom | Reason | How to handle |
|---|---|---|
| Connection error | api_base thiếu /v1. | api_base="https://vietrouter.com.vn/v1" |