Langfuse Scores API
The Scores API from Langfuse — 2 operation(s) for scores.
Operations 2
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
The Scores API from Langfuse — 2 operation(s) for scores.
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/langfuse:langfuse-scores-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: langfuse Scores API
version: ''
description: '## Authentication
Authenticate with the API using Basic Auth, get API keys in the project settings:
- username: Langfuse Public Key
- password: Langfuse Secret Key
## Exports
- OpenAPI spec: https://cloud.langfuse.com/generated/api/openapi.yml'
tags:
- name: Scores
paths:
/api/public/v2/scores:
get:
description: Get a list of scores (supports both trace and session scores)
operationId: scores_get-many
tags:
- Scores
parameters:
- name: page
in: query
description: Page number, starts at 1.
required: false
schema:
type:
- integer
- 'null'
- name: limit
in: query
description: Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit.
required: false
schema:
type:
- integer
- 'null'
- name: userId
in: query
description: Retrieve only scores with this userId associated to the trace.
required: false
schema:
type:
- string
- 'null'
- name: name
in: query
description: Retrieve only scores with this name.
required: false
schema:
type:
- string
- 'null'
- name: fromTimestamp
in: query
description: Optional filter to only include scores created on or after a certain datetime (ISO 8601)
required: false
schema:
type:
- string
- 'null'
format: date-time
- name: toTimestamp
in: query
description: Optional filter to only include scores created before a certain datetime (ISO 8601)
required: false
schema:
type:
- string
- 'null'
format: date-time
- name: environment
in: query
description: Optional filter for scores where the environment is one of the provided values.
required: false
schema:
type: array
items:
type:
- string
- 'null'
- name: source
in: query
description: Retrieve only scores from a specific source.
required: false
schema:
$ref: '#/components/schemas/ScoreSource'
- name: operator
in: query
description: Retrieve only scores with <operator> value.
required: false
schema:
type:
- string
- 'null'
- name: value
in: query
description: Retrieve only scores with <operator> value.
required: false
schema:
type:
- number
- 'null'
format: double
- name: scoreIds
in: query
description: Comma-separated list of score IDs to limit the results to.
required: false
schema:
type:
- string
- 'null'
- name: configId
in: query
description: Retrieve only scores with a specific configId.
required: false
schema:
type:
- string
- 'null'
- name: sessionId
in: query
description: Retrieve only scores with a specific sessionId.
required: false
schema:
type:
- string
- 'null'
- name: datasetRunId
in: query
description: Retrieve only scores with a specific datasetRunId.
required: false
schema:
type:
- string
- 'null'
- name: traceId
in: query
description: Retrieve only scores with a specific traceId.
required: false
schema:
type:
- string
- 'null'
- name: observationId
in: query
description: Comma-separated list of observation IDs to filter scores by.
required: false
schema:
type:
- string
- 'null'
- name: queueId
in: query
description: Retrieve only scores with a specific annotation queueId.
required: false
schema:
type:
- string
- 'null'
- name: dataType
in: query
description: Retrieve only scores with a specific dataType.
required: false
schema:
$ref: '#/components/schemas/ScoreDataType'
- name: traceTags
in: query
description: Only scores linked to traces that include all of these tags will be returned.
required: false
schema:
type: array
items:
type:
- string
- 'null'
- name: fields
in: query
description: 'Comma-separated list of field groups to include in the response. Available field groups: ''score'' (core score fields), ''trace'' (trace properties: userId, tags, environment, sessionId). If not specified, both ''score'' and ''trace'' are returned by default. Example: ''score'' to exclude trace data, ''score,trace'' to include both. Note: When filtering by trace properties (using userId or traceTags parameters), the ''trace'' field group must be included, otherwise a 400 error will be returned.'
required: false
schema:
type:
- string
- 'null'
- name: filter
in: query
description: 'A JSON stringified array of filter objects. Each object requires type, column, operator, and value. Supports filtering by score metadata using the stringObject type. Example: [{"type":"stringObject","column":"metadata","key":"user_id","operator":"=","value":"abc123"}]. Supported types: stringObject (metadata key-value filtering), string, number, datetime, stringOptions, arrayOptions. Supported operators for stringObject: =, contains, does not contain, starts with, ends with.'
required: false
schema:
type:
- string
- 'null'
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/GetScoresResponse'
'400':
description: ''
content:
application/json:
schema: {}
'401':
description: ''
content:
application/json:
schema: {}
'403':
description: ''
content:
application/json:
schema: {}
'404':
description: ''
content:
application/json:
schema: {}
'405':
description: ''
content:
application/json:
schema: {}
security:
- BasicAuth: []
summary: Scores get many
x-summary-source: derived
/api/public/v2/scores/{scoreId}:
get:
description: Get a score (supports both trace and session scores)
operationId: scores_get-by-id
tags:
- Scores
parameters:
- name: scoreId
in: path
description: The unique langfuse identifier of a score
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Score'
'400':
description: ''
content:
application/json:
schema: {}
'401':
description: ''
content:
application/json:
schema: {}
'403':
description: ''
content:
application/json:
schema: {}
'404':
description: ''
content:
application/json:
schema: {}
'405':
description: ''
content:
application/json:
schema: {}
security:
- BasicAuth: []
summary: Scores get by id
x-summary-source: derived
components:
schemas:
TextScore:
title: TextScore
type: object
properties:
stringValue:
type: string
description: The text content of the score (1-500 characters)
required:
- stringValue
allOf:
- $ref: '#/components/schemas/BaseScore'
NumericScore:
title: NumericScore
type: object
properties:
value:
type: number
format: double
description: The numeric value of the score
required:
- value
allOf:
- $ref: '#/components/schemas/BaseScore'
GetScoresResponseDataBoolean:
title: GetScoresResponseDataBoolean
type: object
properties:
trace:
$ref: '#/components/schemas/GetScoresResponseTraceData'
allOf:
- $ref: '#/components/schemas/BooleanScore'
GetScoresResponseData:
title: GetScoresResponseData
oneOf:
- type: object
allOf:
- type: object
properties:
dataType:
type: string
enum:
- NUMERIC
- $ref: '#/components/schemas/GetScoresResponseDataNumeric'
required:
- dataType
- type: object
allOf:
- type: object
properties:
dataType:
type: string
enum:
- CATEGORICAL
- $ref: '#/components/schemas/GetScoresResponseDataCategorical'
required:
- dataType
- type: object
allOf:
- type: object
properties:
dataType:
type: string
enum:
- BOOLEAN
- $ref: '#/components/schemas/GetScoresResponseDataBoolean'
required:
- dataType
- type: object
allOf:
- type: object
properties:
dataType:
type: string
enum:
- CORRECTION
- $ref: '#/components/schemas/GetScoresResponseDataCorrection'
required:
- dataType
- type: object
allOf:
- type: object
properties:
dataType:
type: string
enum:
- TEXT
- $ref: '#/components/schemas/GetScoresResponseDataText'
required:
- dataType
GetScoresResponse:
title: GetScoresResponse
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/GetScoresResponseData'
meta:
$ref: '#/components/schemas/utilsMetaResponse'
required:
- data
- meta
utilsMetaResponse:
title: utilsMetaResponse
type: object
properties:
page:
type: integer
description: current page number
limit:
type: integer
description: number of items per page
totalItems:
type: integer
description: number of total items given the current filters/selection (if any)
totalPages:
type: integer
description: number of total pages given the current limit
required:
- page
- limit
- totalItems
- totalPages
GetScoresResponseDataNumeric:
title: GetScoresResponseDataNumeric
type: object
properties:
trace:
$ref: '#/components/schemas/GetScoresResponseTraceData'
allOf:
- $ref: '#/components/schemas/NumericScore'
ScoreDataType:
title: ScoreDataType
type: string
enum:
- NUMERIC
- BOOLEAN
- CATEGORICAL
- CORRECTION
- TEXT
CorrectionScore:
title: CorrectionScore
type: object
properties:
value:
type: number
format: double
description: The numeric value of the score. Always 0 for correction scores.
stringValue:
type: string
description: The string representation of the correction content
required:
- value
- stringValue
allOf:
- $ref: '#/components/schemas/BaseScore'
GetScoresResponseDataText:
title: GetScoresResponseDataText
type: object
properties:
trace:
$ref: '#/components/schemas/GetScoresResponseTraceData'
allOf:
- $ref: '#/components/schemas/TextScore'
GetScoresResponseTraceData:
title: GetScoresResponseTraceData
type: object
properties:
userId:
type:
- string
- 'null'
description: The user ID associated with the trace referenced by score
tags:
type:
- array
- 'null'
items:
type: string
description: A list of tags associated with the trace referenced by score
environment:
type:
- string
- 'null'
description: The environment of the trace referenced by score
sessionId:
type:
- string
- 'null'
description: The session ID associated with the trace referenced by score
ScoreSource:
title: ScoreSource
type: string
enum:
- ANNOTATION
- API
- EVAL
BaseScore:
title: BaseScore
type: object
properties:
id:
type: string
traceId:
type:
- string
- 'null'
description: The trace ID associated with the score
sessionId:
type:
- string
- 'null'
description: The session ID associated with the score
observationId:
type:
- string
- 'null'
description: The observation ID associated with the score
datasetRunId:
type:
- string
- 'null'
description: The dataset run ID associated with the score
name:
type: string
source:
$ref: '#/components/schemas/ScoreSource'
timestamp:
type: string
format: date-time
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
authorUserId:
type:
- string
- 'null'
description: The user ID of the author
comment:
type:
- string
- 'null'
description: Comment on the score
metadata:
description: Metadata associated with the score
configId:
type:
- string
- 'null'
description: Reference a score config on a score. When set, config and score name must be equal and value must comply to optionally defined numerical range
queueId:
type:
- string
- 'null'
description: The annotation queue referenced by the score. Indicates if score was initially created while processing annotation queue.
environment:
type: string
description: The environment from which this score originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
required:
- id
- name
- source
- timestamp
- createdAt
- updatedAt
- metadata
- environment
Score:
title: Score
oneOf:
- type: object
allOf:
- type: object
properties:
dataType:
type: string
enum:
- NUMERIC
- $ref: '#/components/schemas/NumericScore'
required:
- dataType
- type: object
allOf:
- type: object
properties:
dataType:
type: string
enum:
- CATEGORICAL
- $ref: '#/components/schemas/CategoricalScore'
required:
- dataType
- type: object
allOf:
- type: object
properties:
dataType:
type: string
enum:
- BOOLEAN
- $ref: '#/components/schemas/BooleanScore'
required:
- dataType
- type: object
allOf:
- type: object
properties:
dataType:
type: string
enum:
- CORRECTION
- $ref: '#/components/schemas/CorrectionScore'
required:
- dataType
- type: object
allOf:
- type: object
properties:
dataType:
type: string
enum:
- TEXT
- $ref: '#/components/schemas/TextScore'
required:
- dataType
CategoricalScore:
title: CategoricalScore
type: object
properties:
value:
type: number
format: double
description: Represents the numeric category mapping of the stringValue. If no config is linked, defaults to 0.
stringValue:
type: string
description: The string representation of the score value. If no config is linked, can be any string. Otherwise, must map to a config category
required:
- value
- stringValue
allOf:
- $ref: '#/components/schemas/BaseScore'
GetScoresResponseDataCorrection:
title: GetScoresResponseDataCorrection
type: object
properties:
trace:
$ref: '#/components/schemas/GetScoresResponseTraceData'
allOf:
- $ref: '#/components/schemas/CorrectionScore'
GetScoresResponseDataCategorical:
title: GetScoresResponseDataCategorical
type: object
properties:
trace:
$ref: '#/components/schemas/GetScoresResponseTraceData'
allOf:
- $ref: '#/components/schemas/CategoricalScore'
BooleanScore:
title: BooleanScore
type: object
properties:
value:
type: number
format: double
description: The numeric value of the score. Equals 1 for "True" and 0 for "False"
stringValue:
type: string
description: The string representation of the score value. Is inferred from the numeric value and equals "True" or "False"
required:
- value
- stringValue
allOf:
- $ref: '#/components/schemas/BaseScore'
securitySchemes:
BasicAuth:
type: http
scheme: basic
x-provenance:
method: harvested
publisher: Langfuse
source: https://cloud.langfuse.com/generated/api/openapi.yml
note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
stamped by stamp-openapi-provenance.py (roadmap#793)