LangDB is an AI Gateway for seamless access to 350+ LLMs. Secure, govern, and optimize AI Traffic across LLMs using OpenAI-Compatible APIs.For detailed integration instructions, see the LangDB Agno documentation.
Authentication
Set your LANGDB_API_KEY environment variable. Get your key from here.
from agno.agent import Agent, RunResponsefrom agno.models.langdb import LangDBagent = Agent( model=LangDB(id="gpt-4o"), markdown=True)# Print the response in the terminalagent.print_response("Share a 2 sentence horror story.")
Params
Parameter
Type
Default
Description
id
str
"gpt-4o"
The model ID used for generating responses.
name
str
"LangDB"
The name identifier for the LangDB agent.
provider
str
"LangDB:" + id
The provider of the model, combining "LangDB" with the model ID.
api_key
Optional[str]
getenv("LANGDB_API_KEY")
The API key for authenticating requests to LangDB, retrieved from the LANGDB_API_KEY environment variable.
project_id
Optional[str]
getenv("LANGDB_PROJECT_ID")
The project ID for LangDB, retrieved from the LANGDB_PROJECT_ID environment variable. If not set, a warning is logged.
base_url
str
"https://api.us-east-1.langdb.ai/{project_id}/v1"
The base URL for making API requests to LangDB. The {project_id} is dynamically included.