Learning resourcesReviewed · Langfuse

Langfuse AI Gateway REST API guide

This Langfuse AI Gateway REST API guide helps developers connect applications over HTTP, but the gateway is in public beta and supports only the listed routes. It explains regional hosts, gateway-key authentication, provider-specific endpoints and a streaming response detail that clients must handle.

Researched 23 Nov 2026

In short.

This REST API reference helps developers call the Langfuse AI Gateway from scripts or applications, but its public beta interface has a restricted set of routes. It documents OpenAI-format and Anthropic-format endpoints, regional authentication requirements and model identifiers that combine a connection name with a model name. The gateway preserves provider request and response formats rather than translating between them. Pricing, service guarantees and complete request schemas are not established by this page, and no behavior was tested.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete selected page at [https://langfuse.com/docs/gateway/features/rest-api.md], including its beta notice, regional hosts, authentication rules, all listed endpoints, model-ID explanation, unsupported-path and compression notices, streaming behavior and documentation-navigation footer. Linked provider references, key-management pages, model documentation, self-hosting instructions and footer destinations are excluded. No code or HTTP requests were executed. Runtime behavior, performance, billing, deployment requirements and claims beyond the selected text remain unverified.

The overview

Identity

The resource is Langfuse’s REST API documentation for its AI Gateway [https://langfuse.com/docs/gateway/features/rest-api.md]. It explains how to call the gateway directly over HTTP, including from scripts or languages without an SDK.

The page covers the gateway-specific interface: base URLs, authentication, supported routes and streaming usage behavior. It directs readers to provider references for request and response fields; those linked references are outside the selected page.

Assessment

This is a useful reference when you already understand the provider API you intend to call and need the gateway’s address, credentials and routing rules. Its most practical details are the regional key restriction, connection-qualified model IDs and the final streaming chunk that can break a simplistic parser.

It is insufficient by itself for a complete integration: it does not explain how to provision connections or keys, supply complete request bodies, or establish service pricing and reliability. Its documented behavior was not independently verified.

Users

The page is aimed at developers making model requests through HTTP clients, scripts or application code. It is particularly relevant when an SDK is unavailable or when existing provider-format requests need to use Langfuse’s gateway.

Beginners will need some familiarity with HTTP methods, headers and request bodies. Experienced developers can use the route list and compatibility constraints directly, but still need the relevant provider schema and a configured connection.

Capabilities

The documented OpenAI-format routes are GET /openai/v1/models, POST /openai/v1/responses, POST /openai/v1/responses/compact, POST /openai/v1/chat/completions, POST /openai/v1/decisions and POST /openai/v1/embeddings.

The documented Anthropic-format routes are GET /anthropic/v1/models, POST /anthropic/v1/messages and POST /anthropic/v1/messages/count_tokens. The model-list endpoints return models available to the supplied key. Listing an endpoint does not establish support for every provider feature or every model.

Using it

Requirements

Every endpoint requires a gateway API key. OpenAI-format requests use Authorization: Bearer <gateway key>. Anthropic-format requests accept x-api-key: <gateway key> or a Bearer token; if both headers are supplied, their values must match.

The key must belong to the region of the selected gateway host. Each endpoint also needs a connection to a provider that supports its API format, and request bodies must use that provider’s schema. Bodies must be uncompressed; a Content-Encoding value other than identity is documented to fail with HTTP 415.

Mechanism

The gateway exposes separate OpenAI-format and Anthropic-format routes while keeping request and response bodies in the provider’s format. It does not translate between those formats. Model-list responses identify callable models using <connection>:<model>, tying a model name to a particular configured connection.

For streamed Chat Completions, the gateway sets stream_options.include_usage. The client receives a final chunk containing an empty choices array and a usage object immediately before data: [DONE]. Code that reads chunk.choices[0] on every chunk needs a guard for the empty array.

Setup

Choose the host that matches the gateway key’s region. The documented hosts are EU [https://gateway.cloud.langfuse.com], US [https://gateway.us.cloud.langfuse.com], JP [https://gateway.jp.cloud.langfuse.com] and HIPAA [https://gateway.hipaa.cloud.langfuse.com]. Append /openai/v1 or /anthropic/v1 for the corresponding base URL.

Supply the appropriate authentication header, list available models and use a returned model ID with a supported endpoint. For self-hosted Langfuse, use the gateway URL configured through LANGFUSE_AI_GATEWAY_PUBLIC_URL. Key creation, connection configuration and self-hosting deployment steps are not explained on this page.

Example

For an illustrative EU integration, send GET to [https://gateway.cloud.langfuse.com/openai/v1/models] with Authorization: Bearer <gateway key>, using an EU gateway key. Choose a model ID from the response, then send an OpenAI-format response request to [https://gateway.cloud.langfuse.com/openai/v1/responses].

Use the returned connection-qualified model ID rather than inventing a connection or model name. The selected page does not provide a complete response-request body; its fields must come from the provider reference. This example was not executed, and no output is claimed.

Assessment & evidence

Limitations

The gateway is explicitly in public beta and may change. Only the listed routes are supported; other paths return HTTP 404, including websockets and realtime APIs. The separate provider formats require compatible connections, so changing a route alone does not establish cross-provider compatibility.

Compressed request bodies are unsupported, and streaming parsers must handle the empty final choices array. Rate limits, request-size limits, retries, timeouts, latency and availability guarantees are not documented here. Live endpoint behavior and model compatibility remain unverified.

Reasoning

The documented interface suggests a straightforward fit for applications already sending a supported provider format: developers can retain that format while configuring a gateway host, gateway key and connection-qualified model ID. This is an inference from the routing design, not a demonstrated migration result.

The same design creates a clear decision boundary. Applications requiring realtime APIs, websockets or automatic translation between provider formats do not have those needs covered by this page. Existing Chat Completions clients also need their streaming parser checked against the documented final chunk.

Alternatives

Direct provider access is a comparison to investigate because the page links the OpenAI and Anthropic API references and preserves provider request and response formats. Those references were not included, so differences in setup, features, pricing or operational behavior are not established.

The page contains no comparison with other gateways or integration guides. It supports no conclusion that Langfuse is cheaper, faster, more reliable or easier to operate than an alternative.

Evidence

The source is the complete captured Langfuse REST API page [https://langfuse.com/docs/gateway/features/rest-api.md]. It provides documentary support for the hosts, authentication rules, route list, model-ID format, compression restriction and streaming caveat described here.

The captured source revision is sha256:802cfcecf35ad2e6467b031b05769c155428e3a869616b2c46da308987564129. Linked pages provide no additional evidence within this scope. No commands, requests or deployments were executed, so the findings describe documentation rather than observed runtime results.

Access & freshness

Costs

Gateway charges, provider rates, subscription requirements, quotas and self-hosting costs are unknown from this page. It does not establish that access or usage is free.

The page says the gateway enables token usage and cost reporting for streamed Chat Completions by setting stream_options.include_usage. It describes a final usage object but does not explain cost fields, calculation methods or billing arrangements. Usage reporting alone cannot establish the price of a request.

Rights

The selected page does not state a documentation license or permission to redistribute its text. It also does not establish licensing terms for gateway software, model access or generated outputs.

Service terms, request-data retention and contractual data-handling commitments are not supplied. The presence of regional hosts, including a HIPAA-labeled host, does not by itself establish those terms or guarantees.

Freshness

The page was captured at 2026-11-23T01:34:20.131Z. It explicitly warns that the gateway is in public beta and can change.

The selected text gives no publication date, last-update date or gateway release number. The /v1 route segment identifies the documented API path; it does not establish a particular gateway software release. Changes after capture are unknown.

Actions

Before integrating, match your required operations to the documented routes and confirm that your connection supports the chosen provider format. Obtain a gateway key for the intended region, use the matching host and retrieve the models available to that key.

Consult the linked provider reference for request fields and the linked Langfuse documentation for key creation and connection details. Check the final usage chunk when implementing streamed Chat Completions. Establish pricing and relevant service terms separately; this page does not supply them. These steps are recommendations, not completed validation.

Evidence for this report

selected-page.txtselected · checked 2026-11-23