LangChain integration + Ainfera Routing. Working agent in ~30 lines. Clone, install, run.
git clone https://github.com/ainfera-ai/ainfera-langchain
cd ainfera-langchain
pip install -r requirements.txt
export AINFERA_API_KEY=ai_infera_... # https://app.ainfera.ai/signup
python main.pyOr with curl only — no LangChain install:
./curl-example.sh # signup → inference → audit verify- One Agent Card across providers (L1)
- Routed inference with per-call budget caps (L3)
- Audit URL printed after every call (L4)
- Quality scored by Artificial Analysis per model
EU AI Act Annex IV ready — every call hash-chained, signed, exportable.
LangChain speaks OpenAI's API. Two env vars and your existing
ChatOpenAI code routes through Ainfera:
from ainfera_callback import AinferaCallbackHandler
handler = AinferaCallbackHandler()
chat = ChatOpenAI(
model="claude-opus-4-7",
openai_api_key=os.environ["AINFERA_API_KEY"],
openai_api_base="https://api.ainfera.ai/v1",
callbacks=[handler],
)
# handler.last_audit_url after each invokeThat's it.
AinferaCallbackHandler reads the ainfera extension block and
x-ainfera-* headers returned by POST /v1/chat/completions:
handler = AinferaCallbackHandler()
# after invoke:
print(handler.last_audit_url)
print(handler.last_inference_id, handler.last_agent_id)After running, visit https://verify.ainfera.ai/agents/<your-agent-id> to see the hash-chained audit trail. Every call has a verifiable receipt.
- ainfera-openai-compatible — universal wedge (no framework)
- ainfera-crewai — multi-agent crews
- ainfera-google-adk — Google ADK
- ainfera-mcp — Claude Desktop + Cursor
- ainfera-letta — Letta (MemGPT)
Apache 2.0. © Ainfera Inc. 2026.