Skip to main content
GET
/
api
/
public
/
v2
/
request
/
{request_id}
Get Request
curl --request GET \
  --url https://api.promptlayer.com/api/public/v2/request/{request_id} \
  --header 'X-API-KEY: <x-api-key>'
{
  "success": true,
  "prompt_blueprint": {
    "prompt_template": {},
    "metadata": {},
    "inference_client_name": "<string>"
  },
  "request_id": 123,
  "provider": "<string>",
  "model": "<string>"
}
Retrieve the full payload of a logged request by its ID, returned as a prompt blueprint. This is useful for:
  • Request replay: Re-run a request with the same input and parameters
  • Debugging: Inspect the exact prompt and model configuration used
  • Dataset creation: Extract request data for use in evaluations
The response includes the prompt blueprint (input messages, model configuration, and parameters) along with the provider and model used.

Authentication

This endpoint requires API key authentication via the X-API-KEY header, or JWT authentication via the Authorization: Bearer header.

Example

curl -H "X-API-KEY: your_api_key" \
  https://api.promptlayer.com/api/public/v2/request/12345

Response

{
  "success": true,
  "prompt_blueprint": {
    "prompt_template": {
      "type": "chat",
      "messages": [
        {
          "role": "user",
          "content": [{ "type": "text", "text": "Hello, world!" }]
        }
      ]
    },
    "metadata": {
      "model": {
        "provider": "openai",
        "name": "gpt-4",
        "parameters": {}
      }
    },
    "inference_client_name": null
  },
  "request_id": 12345,
  "provider": "openai",
  "model": "gpt-4"
}

Headers

X-API-KEY
string
required

API key for authentication.

Path Parameters

request_id
integer
required

The ID of the request to retrieve.

Required range: x >= 1

Response

Successfully retrieved request as a prompt blueprint.

success
boolean

Indicates the request was successful.

prompt_blueprint
object

The request converted to a prompt blueprint format.

request_id
integer

The ID of the request.

provider
string

The LLM provider (e.g. openai, anthropic).

model
string

The model name (e.g. gpt-4, claude-3-sonnet).