Skip to main content
GET
/
api
/
public
/
v2
/
requests
/
{request_id}
Get Request
curl --request GET \
  --url https://api.promptlayer.com/api/public/v2/requests/{request_id} \
  --header 'X-API-KEY: <api-key>'
{
  "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",
  "input_tokens": 12,
  "output_tokens": 25,
  "tokens": 37,
  "price": 0.00123,
  "request_start_time": "2024-04-03T20:57:25Z",
  "request_end_time": "2024-04-03T20:57:26Z",
  "latency_ms": 1000,
  "trace_id": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"
}

Documentation Index

Fetch the complete documentation index at: https://docs.promptlayer.com/llms.txt

Use this file to discover all available pages before exploring further.

Retrieve the full payload of a logged request by ID. The response includes a prompt blueprint, token usage, timing data, pricing, and an associated trace_id when tracing data is available.

Authorizations

X-API-KEY
string
header
required

Path Parameters

request_id
integer
required

The ID of the request to retrieve.

Required range: x >= 1

Response

Request log detail.

success
enum<boolean>
required
Available options:
true
prompt_blueprint
object
required

Provider-agnostic prompt blueprint that can be replayed.

request_id
integer
required
provider
string
model
string
input_tokens
integer
output_tokens
integer
tokens
integer
price
number
request_start_time
string<date-time>
request_end_time
string<date-time>
latency_ms
number
trace_id
string | null

Associated trace ID, if available.