# Get Request Inputs

> Retrieve the prompt template inputs (variables) used for a specific request made through AI Gateway prompt management.

`GET /v1/request/{requestId}/inputs`

import EUAPIWarning from "/snippets/eu-api-warning.mdx";

<EUAPIWarning />

## Overview

When you use [Prompt Management](/features/advanced-usage/prompts/overview) through the AI Gateway, template variables (inputs) are stored automatically. This endpoint lets you retrieve those inputs by request ID — useful for building testing pipelines that replay past requests against new prompt versions.

## Use Cases

- **Regression testing**: Pull a past request's inputs and replay them against a new prompt version to validate behavior.
- **Prompt comparison**: Compare outputs across prompt versions using the same inputs, without storing inputs separately on your end.
- **Debugging**: Inspect the exact variables that were injected into a prompt template at runtime.

<Note>Request data is retained for 90 days. Plan your testing workflows accordingly.</Note>

## Response

Returns `null` for `data` if the request has no associated inputs (e.g., the request was not made through prompt management, or the request ID doesn't exist).

### Example Response

```json
{
  "data": {
    "inputs": {
      "customer_name": "Sarah",
      "issue": "refund request"
    },
    "prompt_id": "customer-support",
    "version_id": "1c7a86c8-...",
    "environment": "production"
  },
  "error": null
}
```

### No Inputs Found

```json
{
  "data": null,
  "error": null
}
```

## OpenAPI

````yaml swagger.json get /v1/request/{requestId}/inputs
openapi: 3.0.0
info:
  title: helicone-api
  version: 1.0.0
  license:
    name: MIT
  contact: {}
servers:
  - url: https://api.helicone.ai/
  - url: http://localhost:8585/
paths:
  /v1/request/{requestId}/inputs:
    get:
      operationId: GetRequestInputs
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Result__inputs-Record_string.any_--prompt_id-string\
                  --version_id-string--environment-string-or-null_-or-null.stri\
                  ng_"
      tags:
        - Request
      security:
        - api_key: []
      parameters:
        - in: path
          name: requestId
          required: true
          schema:
            type: string
components:
  schemas:
    Record_string.any_:
      properties: {}
      additionalProperties: {}
      type: object
      description: Construct a type with a set of properties K of type T
    ResultError_string_:
      properties:
        data:
          type: number
          enum:
            - null
          nullable: true
        error:
          type: string
      required:
        - data
        - error
      type: object
      additionalProperties: false
    ResultSuccess__inputs-Record_string.any_--prompt_id-string--version_id-string--environment-string-or-null_-or-null_:
      properties:
        data:
          properties:
            environment:
              type: string
              nullable: true
            version_id:
              type: string
            prompt_id:
              type: string
            inputs:
              $ref: "#/components/schemas/Record_string.any_"
          required:
            - environment
            - version_id
            - prompt_id
            - inputs
          type: object
          nullable: true
        error:
          type: number
          enum:
            - null
          nullable: true
      required:
        - data
        - error
      type: object
      additionalProperties: false
    Result__inputs-Record_string.any_--prompt_id-string--version_id-string--environment-string-or-null_-or-null.string_:
      anyOf:
        - $ref: "#/components/schemas/ResultSuccess__inputs-Record_string.any_--prompt_id\
            -string--version_id-string--environment-string-or-null_-or-null_"
        - $ref: "#/components/schemas/ResultError_string_"
````
