Implementation:Langfuse Langfuse API LLM Connections Schema
| Knowledge Sources | |
|---|---|
| Domains | API, LLM Connections |
| Last Updated | 2026-02-14 00:00 GMT |
Overview
Fern API definition for the LLM connections API, enabling projects to configure and manage API connections to various LLM providers such as OpenAI, Anthropic, Azure, Bedrock, and Google AI.
Description
This file defines the public API contract for managing LLM connections under /api/public. LLM connections store the configuration needed to interface with different LLM providers for features like playground evaluation. The file contains two endpoints:
- GET /api/public/llm-connections -- List all LLM connections in a project (paginated, secrets excluded)
- PUT /api/public/llm-connections -- Create or update an LLM connection (upserts on provider name)
The definition includes an LlmAdapter enum supporting six provider adapters: Anthropic, OpenAI, Azure, Bedrock, Google Vertex AI, and Google AI Studio. Adapter-specific configuration is supported via the config field (required for Bedrock, optional for Vertex AI).
Usage
Developers reference this definition when:
- Adding support for new LLM providers
- Generating SDK types for LLM connection management
- Implementing the playground or eval features that use LLM connections
- Understanding how secret keys and extra headers are handled in the API
Code Reference
Source Location
- Repository: Langfuse
- File: fern/apis/server/definition/llm-connections.yml
- Lines: 1-112
Signature
service:
auth: true
base-path: /api/public
endpoints:
list:
method: GET
docs: Get all LLM connections in a project
path: /llm-connections
response: PaginatedLlmConnections
upsert:
method: PUT
docs: Create or update an LLM connection. The connection is upserted on provider.
path: /llm-connections
request: UpsertLlmConnectionRequest
response: LlmConnection
types:
LlmAdapter:
enum:
- value: anthropic
name: Anthropic
- value: openai
name: OpenAI
- value: azure
name: Azure
- value: bedrock
name: Bedrock
- value: google-vertex-ai
name: GoogleVertexAI
- value: google-ai-studio
name: GoogleAIStudio
I/O Contract
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/public/llm-connections | List all LLM connections in a project (paginated, secrets excluded) |
| PUT | /api/public/llm-connections | Create or update an LLM connection (upserts on provider name) |
Key Types
| Type Name | Description |
|---|---|
| LlmConnection | Connection record with id, provider, adapter, masked secret key, baseURL, custom models, extra header keys, config, timestamps |
| PaginatedLlmConnections | Paginated list of LlmConnection with MetaResponse |
| UpsertLlmConnectionRequest | Request with provider, adapter, secretKey, baseURL, customModels, withDefaultModels, extraHeaders, config |
| LlmAdapter | Enum: anthropic, openai, azure, bedrock, google-vertex-ai, google-ai-studio |
Usage Examples
# List LLM connections
curl -X GET "https://cloud.langfuse.com/api/public/llm-connections?page=1&limit=10" \
-H "Authorization: Bearer $API_KEY"
# Create/update an OpenAI connection
curl -X PUT "https://cloud.langfuse.com/api/public/llm-connections" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "openai",
"adapter": "openai",
"secretKey": "sk-...",
"customModels": ["gpt-4o-mini"],
"withDefaultModels": true
}'
# Create a Bedrock connection (config required)
curl -X PUT "https://cloud.langfuse.com/api/public/llm-connections" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "bedrock",
"adapter": "bedrock",
"secretKey": "aws-secret-key",
"config": {"region": "us-east-1"}
}'