Canonical docs: https://apidoc.cometapi.com/integrations/langfuse
Use this guide to connect Langfuse to CometAPI by setting the base URL, API key, and model or provider options. Langfuse provides LLM observability, prompt management, playgrounds, and evaluation workflows. Configure a Langfuse LLM Connection with CometAPI when you want Langfuse Playground or LLM-as-a-Judge evaluations to call CometAPI models.
- A Langfuse Cloud project or a self-hosted Langfuse instance
- A CometAPI account with an active API key — get yours in the dashboard
- At least one CometAPI model ID selected from the CometAPI Models page
In Langfuse, open Project Settings → LLM Connections. Start the flow for adding an LLM API key.
Select OpenAI as the provider. Langfuse uses this adapter for model providers that support the OpenAI API schema.
Configure the connection with these values:
| Field | Value |
|---|---|
| API key | Your CometAPI API key |
| Base URL | https://api.cometapi.com/v1 |
| Custom model IDs | One or more model IDs from the CometAPI Models page |
If Langfuse exposes the base URL field under Advanced Settings, expand that section before saving the connection.
In Langfuse Playground, select the CometAPI LLM connection and one of the configured model IDs. Send a short prompt to confirm that Langfuse receives a response.
Langfuse LLM-as-a-Judge evaluators can use the same LLM connection. Select the CometAPI connection in the evaluator configuration, then choose a model ID that supports tool calling if your scoring prompt requires structured extraction.
Use provider options only when the selected CometAPI model supports those request fields. For model discovery, use the CometAPI Models page or the /v1/models API.
Add the exact CometAPI model ID to the custom model IDs list in the LLM connection. Langfuse does not discover every model automatically for custom OpenAI-compatible providers.
Use https://api.cometapi.com/v1 as the base URL. Langfuse appends the OpenAI-compatible path for the selected adapter.
Confirm that the selected model supports the request features used by the evaluator, such as tool calling or JSON output.