Endpoint
/v1/prompt/{promptId}/query
Authentication
This endpoint requires API key authentication. Include your API key in the request headers:
Authorization: Bearer YOUR_API_KEY
Path Parameters
The unique identifier of the prompt
Request Body
Time range to filter prompt usageStart time in ISO 8601 format
End time in ISO 8601 format
Response
Prompt detailsUnique identifier for the prompt
Display name for the prompt
Current major version number
ID of the latest prompt version
Most recently used model for this prompt
Prompt creation timestamp
Error message if the request failed, null otherwise
Example Request
curl -X POST https://api.helicone.ai/v1/prompt/prompt_abc123/query \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"timeFilter": {
"start": "2024-01-01T00:00:00Z",
"end": "2024-01-31T23:59:59Z"
}
}'
Example Response
{
"data": {
"id": "prompt_abc123",
"user_defined_id": "customer-support-v1",
"description": "Customer support prompt template",
"pretty_name": "Customer Support",
"major_version": 2,
"latest_version_id": "pv_xyz789",
"latest_model_used": "gpt-4",
"created_at": "2024-01-01T10:00:00Z",
"last_used": "2024-01-30T15:30:00Z",
"versions": ["pv_xyz789", "pv_xyz788"],
"metadata": {
"department": "support"
}
},
"error": null
}