Skip to main content
Every PromptLayer log has a unique PromptLayer Request ID (pl_id). All tracking in PromptLayer is based on the pl_request_id. This identifier is needed to enrich logs with metadata, scores, associated prompt templates, and more. You can also use it to retrieve the full request payload as a prompt blueprint. You can quickly grab a request ID from the web UI as shown below. Specific instructions for retrieving the ID programmatically are below.

REST API

The pl_request_id is returned as request_id in the case of a successful request when using the REST api with /log-request. This means that request_id will be a key in the object returned by a successful logged response. Learn more

Using the run Method

The run() method returns the request_id directly in the response object. This is the recommended way to retrieve the pl_request_id.

Using the log_request Method

When using log_request for custom logging, the method returns the request_id in its response.