Skip to content
Last updated

🔨 In Development — This section is still being developed and may change.
Fetches a specific prompt template by its unique identifier, including full details and variable definitions.
GEThttps://api.freddy.aitronos.com/v1/prompts/{prompt_id}

Use this endpoint to get the complete definition of a prompt template for use in model response requests or for template management.

Path Parameters

prompt_id string required

The unique identifier of the prompt template to retrieve.

Query Parameters

organizationId string required

The unique identifier of the organization that owns the prompt template. Ensures access control and proper scoping.

includeUsage boolean optional · Defaults to false

When true, includes usage statistics and recent usage history for the prompt template.

Response

Returns the complete prompt template object with all properties:

id string

The unique identifier of the prompt template.

object string

Always set to "prompt".

name string

The human-readable name of the prompt template.

description string

Detailed description of the template's purpose and usage.

content string

The full prompt template content with variable placeholders (e.g., {{variable_name}}).

variables object

Complete variable definitions including types, descriptions, defaults, and validation rules.

tags array

Array of tags assigned to the template for categorization.

isPublic boolean

Whether the template is publicly accessible.

metadata object

Custom metadata attached to the template.

createdAt integer

Unix timestamp when the template was created.

updatedAt integer

Unix timestamp of the last modification.

version string

The current version identifier of the template.

usage object optional

Usage statistics (only included when includeUsage=true):

  • totalCalls integer - Total number of API calls using this template
  • lastUsedAt integer - Timestamp of most recent usage
  • averageResponseTime number - Average response time in seconds
  • recentUsages array - Last 5 usage records with timestamps and models used

Returns

A PromptResponse object containing the API response data.

Bash
curl "https://api.freddy.aitronos.com/v1/prompts/prompt_abc123?organizationId=org_abc123" \
-H "Authorization: Bearer $FREDDY_API_KEY"

Example Response

{
  "id": "prompt_abc123",
  "object": "prompt",
  "name": "Code Review Assistant",
  "description": "Reviews code pull requests and provides improvement suggestions",
  "content": "You are an expert code reviewer. Analyze the following code and provide constructive feedback focusing on {{focus_areas}}. Code to review:\n\n{{code}}\n\nLanguage: {{language}}",
  "variables": {
    "focus_areas": {
      "type": "string",
      "description": "Areas to focus the review on (e.g., security, performance, readability)",
      "required": false,
      "default": "best practices"
    },
    "code": {
      "type": "string",
      "description": "The code to review",
      "required": true
    },
    "language": {
      "type": "string",
      "description": "Programming language of the code",
      "required": true,
      "enum": ["javascript", "python", "java", "go", "rust", "typescript"]
    }
  },
  "tags": ["code-review", "development", "quality"],
  "isPublic": false,
  "metadata": {
    "team": "engineering",
    "category": "code-quality"
  },
  "createdAt": 1735689600,
  "updatedAt": 1735689600,
  "version": "1.0.0",
  "usage": {
    "totalCalls": 45,
    "lastUsedAt": 1736208000,
    "averageResponseTime": 2.3,
    "recentUsages": [
      {
        "timestamp": 1736208000,
        "model": "gpt-4o",
        "organizationId": "org_abc123"
      }
    ]
  }
}