Prompt templates support variable substitution where placeholders in the template are replaced with actual values at runtime. This enables flexible, parameterized prompts for consistent AI behavior across different use cases.
organizationId string required
The unique identifier of the organization to which this prompt belongs. All API requests must be scoped to an organization for billing, access control, and resource management. Find your organization ID in Freddy Hub → Settings → Organization.
name string required
A human-readable name for the prompt template. Used for identification in the Freddy Hub dashboard and API listings.
description string optional
A detailed description of what the prompt template does and when it should be used. Helps developers understand the template's purpose and usage.
content string required
The prompt template content with variable placeholders. Use {{variable_name}} syntax for variables that will be substituted at runtime.
Example: "You are a {{role}} assistant. Respond to the user query: {{user_query}}. Target audience: {{audience}}"
variables object optional
Defines the expected variables for this prompt template, including their types, descriptions, and whether they're required. This schema is used for validation and IDE autocompletion when using the template.
Show structure
Each variable definition:
name string required
The variable name as referenced in the template (e.g., {{user_query}}).
type string required
The data type of the variable. Available types: string, number, boolean, array, object, image, file.
description string optional
Description of what the variable represents and how it should be used.
required boolean optional · Defaults to false
Whether this variable must be provided when using the template.
default any optional
Default value to use if the variable is not provided in the request.
enum array optional
For string types, restricts the variable to a specific set of values.
Example:
{
"variables": {
"role": {
"type": "string",
"description": "The role the AI should assume",
"required": true,
"enum": ["helpful_assistant", "code_reviewer", "creative_writer"]
},
"user_query": {
"type": "string",
"description": "The user's input or question",
"required": true
},
"max_length": {
"type": "number",
"description": "Maximum response length in words",
"default": 200,
"required": false
}
}
}tags array optional
Array of tags to categorize and filter prompt templates. Useful for organizing templates by use case, team, or project.
isPublic boolean optional · Defaults to false
Whether this prompt template can be accessed by other organizations or team members. Public templates are discoverable in the Freddy Hub template gallery.
metadata object optional
Custom key-value pairs for attaching additional information to the prompt template. Useful for internal tracking, versioning notes, or integration metadata.
A PromptResponse object containing the API response data.
- Bash
- Python
- JavaScript
curl https://api.freddy.aitronos.com/v1/prompts \
-H "Authorization: Bearer $FREDDY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"organizationId": "org_abc123",
"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"]
}'id string
The unique identifier of the created prompt template.
object string
Always set to "prompt".
name string
The name of the prompt template.
description string
The description of the prompt template.
content string
The prompt template content.
variables object
The variable definitions for the template.
tags array
The tags assigned to the template.
isPublic boolean
Whether the template is public.
metadata object
Custom metadata attached to the template.
createdAt integer
Timestamp when the template was created (Unix timestamp).
updatedAt integer
Timestamp when the template was last updated (Unix timestamp).
version string
The version identifier of this template (auto-generated).