# langfuse API

> langfuse API on Apizie: 22 endpoints (Create a dataset item, Get a dataset item, Create a dataset run item, Get all datasets, …) returned as clean JSON through one API key. Send your own provider key in the x-upstream-key header. Call it over REST at https://apizie.tech/v1/security:langfuse/{endpoint} or from Claude, ChatGPT and Cursor through the Apizie MCP server. Free plan: 1,000 requests a month.

- Project key: `security:langfuse`
- Category: Security
- Status: byok
- Source: https://langfuse.com
- Page: https://apizie.tech/api/security/langfuse
- OpenAPI: https://apizie.tech/api/security/langfuse/openapi.json

## Authentication Authenticate with the API using Basic Auth, get API keys in the project settings: - username: Langfuse Public Key - password: Langfuse Secret Key

## Endpoints

### Create a dataset item
`POST https://apizie.tech/v1/security:langfuse/dataset-items-create` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| body | object | yes | JSON request body |

### Get a dataset item
`GET https://apizie.tech/v1/security:langfuse/dataset-items-get` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | yes |  |

### Create a dataset run item
`POST https://apizie.tech/v1/security:langfuse/dataset-run-items-create` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| body | object | yes | JSON request body |

### Get all datasets
`GET https://apizie.tech/v1/security:langfuse/datasets-list` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | no |  |
| limit | integer | no |  |

### Create a dataset
`POST https://apizie.tech/v1/security:langfuse/datasets-create` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| body | object | yes | JSON request body |

### Get a dataset and its items
`GET https://apizie.tech/v1/security:langfuse/datasets-get` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| datasetName | string | yes |  |

### Get a dataset run and its items
`GET https://apizie.tech/v1/security:langfuse/datasets-get-runs` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| datasetName | string | yes |  |
| runName | string | yes |  |

### Check health of API and database
`GET https://apizie.tech/v1/security:langfuse/health-health` (byok)

### Batched ingestion for Langfuse Tracing
`POST https://apizie.tech/v1/security:langfuse/ingestion-batch` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| body | object | yes | JSON request body |

### Get daily metrics of the Langfuse project
`GET https://apizie.tech/v1/security:langfuse/metrics-daily` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | no | page number, starts at 1 |
| limit | integer | no | limit of items per page |
| traceName | string | no | Optional filter by the name of the trace |
| userId | string | no | Optional filter by the userId associated with the trace |
| tags | array | no | Optional filter for metrics where traces include all of these tags |
| fromTimestamp | string | no | Optional filter to only include traces on or after a certain timestamp |
| toTimestamp | string | no | Optional filter to only include traces before a certain timestamp |

### Get a observation
`GET https://apizie.tech/v1/security:langfuse/observations-get` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| observationId | string | yes | The unique langfuse identifier of an observation, can be an event, span or generation |

### Get a list of observations
`GET https://apizie.tech/v1/security:langfuse/observations-get-many` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | no | page number, starts at 1 |
| limit | integer | no | limit of items per page |
| name | string | no |  |
| userId | string | no |  |
| type | string | no |  |
| traceId | string | no |  |
| parentObservationId | string | no |  |
| fromStartTime | string | no | Retrieve only observations with a start_time greater than this timestamp. |

### Get Project associated with API key
`GET https://apizie.tech/v1/security:langfuse/projects-get` (byok)

### Get a prompt
`GET https://apizie.tech/v1/security:langfuse/prompts-get` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | yes |  |
| version | integer | no |  |

### Create a prompt
`POST https://apizie.tech/v1/security:langfuse/prompts-create` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| body | object | yes | JSON request body |

### Get a list of scores
`GET https://apizie.tech/v1/security:langfuse/score-get` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | no | page number, starts at 1 |
| limit | integer | no | limit of items per page |
| userId | string | no |  |
| name | string | no |  |
| fromTimestamp | string | no | Retrieve only scores newer than this timestamp. |

### Create a score
`POST https://apizie.tech/v1/security:langfuse/score-create` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| body | object | yes | JSON request body |

### Get a score
`GET https://apizie.tech/v1/security:langfuse/score-get-by-id` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| scoreId | string | yes | The unique langfuse identifier of a score |

### Delete a score
`POST https://apizie.tech/v1/security:langfuse/score-delete` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| scoreId | string | yes | The unique langfuse identifier of a score |

### Get a session
`GET https://apizie.tech/v1/security:langfuse/sessions-get` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| sessionId | string | yes | The unique id of a session |

### Get a specific trace
`GET https://apizie.tech/v1/security:langfuse/trace-get` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| traceId | string | yes | The unique langfuse identifier of a trace |

### Get list of traces
`GET https://apizie.tech/v1/security:langfuse/trace-list` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | no | page number, starts at 1 |
| limit | integer | no | limit of items per page |
| userId | string | no |  |
| name | string | no |  |
| fromTimestamp | string | no | Retrieve only traces newer than this timestamp. |
| orderBy | string | no | Format of the string [field].[asc/desc]. Fields: id, timestamp, name, userId, release, version, public, bookmarked, sessionId. Example:… |
| tags | array | no | Only traces that include all of these tags will be returned. |

## Example
```
curl "https://apizie.tech/v1/security:langfuse/dataset-items-create" \
  -H "x-api-key: $APIZIE_KEY" \
  -H "x-upstream-key: $PROVIDER_KEY"
```

## FAQ

### How do I call the langfuse API?
Create a free Apizie key, then send POST https://apizie.tech/v1/security:langfuse/dataset-items-create with the header x-api-key. Every endpoint returns { project, data, timestamp }.

### Is the langfuse API free on Apizie?
Yes. The Free plan includes 1,000 requests a month at 100 requests a minute, no credit card. langfuse itself also needs your own key from cloud.langfuse.com.

### Can AI agents use the langfuse API?
Yes. Add the Apizie MCP server (https://apizie.tech/mcp) to Claude, ChatGPT, Cursor or VS Code, then ask in plain language. The agent calls run_scraper with project key security:langfuse.

### What is the status of the langfuse API?
Needs your own provider key (bring your own key)
