Skip to main content

Langfuse passthrough API

This page documents the 5 gateway endpoints tagged langfuse_passthrough in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.

MethodPathSummary
GET/langfuse/{endpoint}Forward a Langfuse SDK request
POST/langfuse/{endpoint}Forward a Langfuse SDK request
PUT/langfuse/{endpoint}Forward a Langfuse SDK request
PATCH/langfuse/{endpoint}Forward a Langfuse SDK request
DELETE/langfuse/{endpoint}Forward a Langfuse SDK request

Endpoints​

GET /langfuse/{endpoint}​

Forward a Langfuse SDK request

Send any Langfuse public API path, such as /api/public/ingestion or /api/public/prompts. The Langfuse SDK authenticates with HTTP Basic auth, so the virtual key goes in the secret key field and any value in the public key field. The gateway replaces the pair with its own Langfuse keys, or with the team's keys when the team has its own Langfuse logging configured. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X GET "http://localhost:4000/langfuse/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"batch": [
{
"body": {
"name": "refund-triage",
"userId": "agent-17"
},
"id": "evt_1",
"timestamp": "2026-11-21T09:00:00Z",
"type": "trace-create"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path is malformed, or a team's Langfuse host is set without its credentials.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /langfuse/{endpoint}​

Forward a Langfuse SDK request

Send any Langfuse public API path, such as /api/public/ingestion or /api/public/prompts. The Langfuse SDK authenticates with HTTP Basic auth, so the virtual key goes in the secret key field and any value in the public key field. The gateway replaces the pair with its own Langfuse keys, or with the team's keys when the team has its own Langfuse logging configured. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/langfuse/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"batch": [
{
"body": {
"name": "refund-triage",
"userId": "agent-17"
},
"id": "evt_1",
"timestamp": "2026-11-21T09:00:00Z",
"type": "trace-create"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path is malformed, or a team's Langfuse host is set without its credentials.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PUT /langfuse/{endpoint}​

Forward a Langfuse SDK request

Send any Langfuse public API path, such as /api/public/ingestion or /api/public/prompts. The Langfuse SDK authenticates with HTTP Basic auth, so the virtual key goes in the secret key field and any value in the public key field. The gateway replaces the pair with its own Langfuse keys, or with the team's keys when the team has its own Langfuse logging configured. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PUT "http://localhost:4000/langfuse/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"batch": [
{
"body": {
"name": "refund-triage",
"userId": "agent-17"
},
"id": "evt_1",
"timestamp": "2026-11-21T09:00:00Z",
"type": "trace-create"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path is malformed, or a team's Langfuse host is set without its credentials.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

PATCH /langfuse/{endpoint}​

Forward a Langfuse SDK request

Send any Langfuse public API path, such as /api/public/ingestion or /api/public/prompts. The Langfuse SDK authenticates with HTTP Basic auth, so the virtual key goes in the secret key field and any value in the public key field. The gateway replaces the pair with its own Langfuse keys, or with the team's keys when the team has its own Langfuse logging configured. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X PATCH "http://localhost:4000/langfuse/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"batch": [
{
"body": {
"name": "refund-triage",
"userId": "agent-17"
},
"id": "evt_1",
"timestamp": "2026-11-21T09:00:00Z",
"type": "trace-create"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path is malformed, or a team's Langfuse host is set without its credentials.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /langfuse/{endpoint}​

Forward a Langfuse SDK request

Send any Langfuse public API path, such as /api/public/ingestion or /api/public/prompts. The Langfuse SDK authenticates with HTTP Basic auth, so the virtual key goes in the secret key field and any value in the public key field. The gateway replaces the pair with its own Langfuse keys, or with the team's keys when the team has its own Langfuse logging configured. The caller authenticates with a Spanway virtual key. The gateway swaps in its own provider credential, forwards the request, records the call in the spend logs and returns the provider's response unchanged, including the provider's own error responses and status codes.

Parameters:

NameInTypeRequiredDescription
endpointpathstringYes

Request body (application/json, object):

Example request:

curl -X DELETE "http://localhost:4000/langfuse/endpoint-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"batch": [
{
"body": {
"name": "refund-triage",
"userId": "agent-17"
},
"id": "evt_1",
"timestamp": "2026-11-21T09:00:00Z",
"type": "trace-create"
}
]
}'

Responses:

StatusDescriptionBody
200The provider's own response, returned unchanged.application/json object
400The path is malformed, or a team's Langfuse host is set without its credentials.application/json ErrorDetail
401The Spanway virtual key is missing, expired, blocked or over budget.application/json ProxyError
403The key or its team is not allowed to call this pass-through route.application/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError