Telemetry integrations send observability data from LLM frameworks, agent SDKs, and model routers into PromptLayer. Use these setup paths when you want PromptLayer to capture traces, spans, LLM calls, tool calls, prompts, completions, token usage, and model metadata from tools you already use. Don’t see your framework listed? You can send traces from any OpenTelemetry-compatible SDK or Collector using the OpenTelemetry page, or email us.Documentation Index
Fetch the complete documentation index at: https://promptlayer-add-demo-projects.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
LiteLLM
LiteLLM allows you to call any LLM API all using the OpenAI format. This is the easiest way to swap in and out new models and see which one works best for your prompts. Works with models such as Anthropic, HuggingFace, Cohere, PaLM, Replicate, Azure. Please read the LiteLLM documentation pageLlamaIndex
LlamaIndex is a data framework for LLM-based applications. Read more about our integration on the LlamaIndex documentation pageClaude Code
PromptLayer supports Claude Code in two setup modes:- CLI: install the PromptLayer Claude plugin directly into Claude Code.
- SDK: use the PromptLayer JavaScript or Python helper to inject the same tracing plugin and environment variables into your Claude SDK options.
CLI: Direct Plugin Install
Use this path if you’re running Claude Code from the terminal and want PromptLayer enabled globally.- Install the plugin
- Run the setup script
- Enter your PromptLayer API key and keep the default endpoint:
https://api.promptlayer.com/v1/traces - Start Claude Code and run a prompt
SDK: JavaScript Or Python
Use this path if you’re embedding Claude Code through Anthropic’s SDK and want PromptLayer configured in code.The PromptLayer Claude SDK helpers currently support macOS and Linux. Windows is not supported.
- Install the required packages
- Generate PromptLayer Claude config and pass it into your Claude SDK options
getClaudeConfig() and get_claude_config() read PROMPTLAYER_API_KEY by default and return:
- a local plugin reference for Claude SDK
plugins - PromptLayer environment variables for Claude SDK
env
- Start your Claude SDK client or agent with those options
OpenAI Agents SDK
PromptLayer supports the OpenAI Agents SDK in both JavaScript and Python, allowing you to export agent traces directly to PromptLayer with a native PromptLayer trace processor. To set up:- Install the required packages
- Register PromptLayer tracing before your first agent run:
- Flush tracing before process exit so PromptLayer receives the final spans:
- Set your environment variables:
OPENAI_API_KEYPROMPTLAYER_API_KEY
Vercel AI SDK
PromptLayer supports integration with the Vercel AI SDK, allowing you to export OpenTelemetry traces from your application directly to PromptLayer. To set up:- Install OpenTelemetry packages
- Configure OpenTelemetry with PromptLayer as the exporter
- Start the SDK before AI calls and shut it down before exit
- Add
experimental_telemetryto your AI SDK calls
promptlayer.telemetry.source to vercel-ai-sdk so PromptLayer can parse the traces correctly.
Once configured, PromptLayer will capture LLM calls, inputs and outputs, token usage, tool traces, workflow spans, model metadata, and reasoning content from models that support extended thinking.
Pydantic AI
PromptLayer supports ingesting Pydantic AI traces through OpenTelemetry. Pydantic AI’s instrumentation emits GenAI semantic convention attributes, so PromptLayer can convert model calls, tool calls, agent spans, and embeddings into traces and request logs. To set up:- Install Pydantic AI, Logfire, and the OTLP HTTP exporter
- Configure OTLP export to PromptLayer before creating your agent
- Run your Pydantic AI agent normally
send_to_logfire=True and authenticate with Logfire. For provider-level request debugging, you can add logfire.instrument_httpx(capture_all=True), but only enable it when you intentionally want to capture raw HTTP request and response bodies.
Once configured, PromptLayer will capture Pydantic AI agent runs, LLM calls, tool calls, embeddings, prompts, completions, token usage, model metadata, and thinking content from extended thinking models.
LangChain / LangSmith
PromptLayer supports ingesting LangChain traces through LangSmith’s OpenTelemetry bridge. For new JavaScript applications where you can choose the framework, use the Vercel AI SDK integration because its OpenTelemetry spans map more directly into PromptLayer. This is also aligned with LangChain / LangSmith’s JavaScript observability path: their docs provide a first-party Vercel AI SDK tracing guide. Use this LangChain / LangSmith path when you already have a LangChain application. LangSmith’s OTEL bridge creates LangChain spans automatically. Add manual spans for application-specific work, custom tool data, or extra inputs and outputs that should appear in PromptLayer traces. To set up:- Install LangChain, LangSmith, and OpenTelemetry packages
- Enable LangSmith’s OTEL tracing mode and configure PromptLayer as the OTLP destination
- Register an OpenTelemetry provider for the Node.js runtime
- Optionally add manual spans for application-specific data
OpenRouter
PromptLayer supports ingesting traces from OpenRouter through OpenRouter’s Broadcast integration for the OpenTelemetry Collector. To set up:- Get your PromptLayer API key from your PromptLayer workspace
- In OpenRouter, go to Settings -> Observability
- Toggle Enable Broadcast
- Click the edit icon next to OpenTelemetry Collector
- Leave the default name or rename the destination if you want
- Configure the destination with PromptLayer’s OTLP endpoint:
- Add your PromptLayer API key in the headers JSON:
- Click Test Connection
- Click Send Trace if you want to verify the integration end-to-end from OpenRouter’s UI
- Save the destination once the test passes
- Send requests through OpenRouter as usual

