← Back to changelog
Hassieb Pakzad
February 5, 2025
Typed public API client in SDKs
![Picture Hassieb Pakzad](/_next/image?url=%2Fimages%2Fpeople%2Fhassiebpakzad.jpg&w=96&q=75)
Access all of Langufuse public API resources via a typed client in our SDKs
Both the Langfuse Python SDK and the JS/TS SDK now provide a strongly-typed wrapper around our public REST API for your convenience. The API methods are accessible via the api
property on the Langfuse client instance in both SDKs.
When using the decorator-based integration:
from langfuse.decorators import langfuse_context
# fetch a trace
langfuse_context.client_instance.api.trace.get(trace_id)
# async client via asyncio
await langfuse_context.client_instance.async_api.trace(trace_id)
When using the low-level SDK:
from langfuse import Langfuse
langfuse = Langfuse()
...
# fetch a trace
langfuse.api.trace.get(trace_id)
# async client via asyncio
await langfuse.async_api.trace(trace_id)