Orq MCP is live: Use natural language to interrogate traces, spot regressions, and experiment your way to optimal AI configurations. Available in Claude Desktop, Claude Code, Cursor, and more. Start now →
Connect Langchain to the AI Gateway for enhanced LLM orchestration. Use Orq.ai as a drop-in provider for chains, agents, and RAG applications.
AI Gateway
Route your LLM calls through the AI Gateway with a single base URL change. Zero vendor lock-in: always run on the best model at the lowest cost for your use case.
Observability
Attach the native Orq callback handler to your LangGraph to capture traces for every LLM call, graph node, tool use, and retrieval.
LangChain is a framework for building LLM-powered applications through composable chains, agents, and integrations with external data sources. By connecting LangChain to Orq.ai’s AI Gateway, you access 300+ models through a single base URL change.
from langchain_openai import ChatOpenAIimport osllm = ChatOpenAI( model="openai/gpt-5", api_key=os.getenv("ORQ_API_KEY"), base_url="https://api.orq.ai/v3/router",)for chunk in llm.stream("Write a short poem about the ocean."): print(chunk.content, end="", flush=True)print()
orq_ai_sdk.langchain provides a global setup() function that automatically instruments all LangChain and LangGraph components. Call it once at the top of your application and every LLM call, graph node, tool execution, and retrieval is traced automatically, no callback wiring needed.
Zero configuration
One setup() call and tracing is live, no callbacks, no OpenTelemetry exporters, no extra wiring.
Full graph visibility
Traces preserve the parent-child structure of your LangGraph so you see exactly which node triggered each LLM call or tool use.
Token usage and costs
Input and output token counts are captured on every LLM call and synced to Orq.ai for cost tracking.
Retrieval tracking
Retrieval events include the query and all returned documents, making RAG pipelines fully inspectable.
Call setup() at the top of your entry point, before invoking any graphs or chains. It globally instruments LangChain so that all subsequent executions are traced automatically.
Traces appear in the Orq.ai Studio under the Traces tab. Each run is captured as a tree reflecting your graph structure: top-level chain spans for each node, with LLM calls, tool executions, and retrievals nested underneath.