> ## 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.

# Get Request

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.

## Related

* [Request IDs](/features/prompt-history/request-id)
* [Prompt Blueprints](/running-requests/prompt-blueprints)
* [Get Trace](/reference/get-trace)


## OpenAPI

````yaml GET /api/public/v2/requests/{request_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/public/v2/requests/{request_id}:
    get:
      tags:
        - tracking
      summary: Get Request
      operationId: getRequest
      parameters:
        - name: request_id
          in: path
          required: true
          schema:
            type: integer
            minimum: 1
          description: The ID of the request to retrieve.
          example: 12345
      responses:
        '200':
          description: Request log detail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestLogDetailResponse'
              examples:
                request:
                  summary: Request detail
                  value:
                    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
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    RequestLogDetailResponse:
      type: object
      title: RequestLogDetailResponse
      required:
        - success
        - prompt_blueprint
        - request_id
      properties:
        success:
          type: boolean
          enum:
            - true
        prompt_blueprint:
          type: object
          additionalProperties: true
          description: Provider-agnostic prompt blueprint that can be replayed.
        request_id:
          type: integer
        provider:
          type: string
        model:
          type: string
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        tokens:
          type: integer
        price:
          type: number
        request_start_time:
          type: string
          format: date-time
        request_end_time:
          type: string
          format: date-time
        latency_ms:
          type: number
        trace_id:
          type: string
          nullable: true
          description: Associated trace ID, if available.
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          default: false
          description: Indicates that the request failed.
        message:
          type: string
          description: Human-readable error message.
        error:
          type: string
          description: Machine-readable or fallback error message.
      additionalProperties: true
      description: >-
        Standard error response. Some legacy endpoints may return either message
        or error.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  responses:
    UnauthorizedError:
      description: Unauthorized - missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ForbiddenError:
      description: Forbidden - API key does not have access to the requested resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFoundError:
      description: Not found - requested resource does not exist or is not accessible.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: Validation error - request parameters or body are invalid.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/HTTPValidationError'
              - $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````