Skip to content
Discussion options

You must be logged in to vote

To fetch detailed trace information, including input and output tokens, you can use the following API endpoints provided by Langfuse:

  • GET /api/public/traces: This endpoint allows you to fetch a list of traces.
  • GET /api/public/traces/:traceId: This endpoint allows you to fetch a single trace by its ID, which may include detailed information such as input and output tokens [1].

If you're using the Langfuse Python SDK, you can log input and output tokens using the langfuse_context.update_current_observation method. Here's an example:

langfuse_context.update_current_observation(
    usage={
        "input": response.usage.input_tokens,
        "output": response.usage.output_tokens
    }
)

T…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@fdb02983rhy
Comment options

@marcklingen
Comment options

@fdb02983rhy
Comment options

@marcklingen
Comment options

@fdb02983rhy
Comment options

Answer selected by marcklingen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment