for_user(id).headers()). For the AI SDK, see
AI SDK.
LangChain (Python)
ChatOpenAI(..., default_headers={"x-atlaso-user": user_id}) on
an instance you share across requests.
LangChain (JavaScript)
Build the chat model inside the request, with the user’s headers. A model built this way serves only that request.ChatOpenAI with defaultHeaders holding a user, built
at module scope. There is no receipt in this recipe.
LlamaIndex
LlamaIndex needs Python 3.10 or newer.llama-index-llms-openai-like 0.7 and
later declare Python 3.10 or newer (0.9 declares 3.11); on Python 3.9, pip picks
an older release whose dependencies fail to import. Tested together:
llama-index-llms-openai-like 0.9.0, llama-index-llms-openai 0.9.0 and
openai 3.57.0 on Python 3.15.
OpenAILike(default_headers={"x-atlaso-user": ...}) at module
level, shared by every request. There is no receipt in this recipe.
OpenAI Agents SDK
The OpenAI Agents SDK needs Python 3.10 or newer. Useopenai-agents 0.21 or
later, which declares openai>=3,<4. Older releases pair with openai 2.x, and
some of those pairs fail before any call (for example openai-agents 0.8.4 with
openai 2.48.0). Tested together: openai-agents 0.25.0 and openai 3.57.0 on
Python 3.15.
RunConfig(model_provider=...), as
in Example 6.
Dangerous: set_default_openai_client() with a user’s client. It is global,
so every concurrent run uses that user’s memory.
LiteLLM
Use the LiteLLM Python library and pass the user’s headers on each call.llm_provider- prefix in
_hidden_params, which LiteLLM may change between versions.
Dangerous: setting litellm.headers to a user’s headers. It is a module
global, so every call from every request uses that user.
Pydantic AI
AsyncOpenAI(default_headers={"x-atlaso-user": ...}) passed to
a provider at module level. There is no receipt in this recipe.