Run the EveryAPI gateway inside LlamaIndex
LlamaIndex can use an OpenAI-compatible LLM instance for RAG and agent applications. Configure its OpenAI integration with the EveryAPI base URL, key, and a model ID from your account catalog, then test the LlamaIndex features your application uses.
One base URL line points LlamaIndex at EveryAPI
Default global Base URL / China-first Base URL: https://api.everyapi.ai/v1 / https://api-cn.everyapi.ai/v1
from llama_index.llms.openai import OpenAI llm = OpenAI( model="claude-sonnet-5", # use an ID available in your account api_base="https://api.everyapi.ai/v1", api_key="sk-everyapi-...",) response = llm.complete("Explain RAG in three sentences")print(response)From zero to your first call
- Install LlamaIndex
Install LlamaIndex and its OpenAI LLM integration: pip install llama-index llama-index-llms-openai.
- Set the LLM instance's api_base + api_key
Use OpenAI(api_base="https://api.everyapi.ai/v1", api_key="sk-everyapi-...", model="...") in place of the default OpenAI() instance.
- Want a global default? Set Settings.llm
After Settings.llm = everyapi_llm, every query engine / chat engine / agent uses it automatically — no need to pass the llm parameter each time.
LlamaIndex × EveryAPI
Why not use llama-index-llms-anthropic / llama-index-llms-gemini?
You can, but every upstream provider you add is another dependency. Going uniformly through llama-index-llms-openai + the EveryAPI base URL means one key, one dependency.