
LlamaIndex + TokenRex — setup
Point LlamaIndex's OpenAI class at TokenRex and keep every downstream RAG pattern.
Same story as LangChain — LlamaIndex accepts a base_url on its OpenAI LLM class.
python
from llama_index.llms.openai import OpenAI
llm = OpenAI(
model="gpt-5.4-mini",
api_key="YOUR_TOKENREX_API_KEY",
api_base="https://tokenrex.ai/api/public/v1",
)Models in this article
Review current prices, specifications and source-linked benchmarks.
Build this with TokenRex
TokenRex is an LLM marketplace by Asirex Labs. Choose an enabled model, create a private API key and use the supported endpoint shown in Docs. Check live prices before your first request.