GPT Prompt (GPTP) is a structured and portable JSON-based file format that defines reusable, templated prompt packages for use with Generative Pre-trained Transformer (GPT) models. GPTP files have the extension .gptp and are versioned, schema-validated files intended for use across GPT-compatible systems.
Each .gptp file is a standalone JSON object that includes all necessary information to define a reusable prompt, including:
- Metadata (
title,description,promptVersion) - Role-based prompt turns (
messagesarray) - Templated variables (declared in
variables, referenced via{{var}}syntax) - Optional system instructions (
system) - Optional configuration: rendering hints, execution parameters, output expectations, assets, vision inputs, tests, tools, and connections
GPTP is based on a strict JSON schema with additionalProperties: false at the top level. All .gptp files must declare a schemaVersion field that is used to validate them.
{
"$doctype": "gptp",
"schemaVersion": "1.2.0",
"promptVersion": "1.0.0",
"title": "Prompt Name",
"description": "What this prompt does",
"messages": [
{ "role": "user", "content": "Say hello to {{name}}" }
]
}| Key | Required | Type | Notes |
|---|---|---|---|
$doctype |
Yes | string | Format identifier (gptp) |
schemaVersion |
Yes | string | Schema version (e.g. 1.2.0) |
promptVersion |
Yes | string | Prompt content version |
title |
Yes | string | Title of the prompt |
description |
Yes | string | Human-readable summary |
messages |
Yes | array | List of {role, content} turns |
system |
No | string | High-level instruction |
variables |
No | object | Input parameters (templated with {{var}}) |
metadata |
No | object | Tags, author, creation date, compatibility |
rendering |
No | object | UI/display hints |
output_format |
No | string | markdown | json | plain-text | html |
output_schema |
Cond. | object | JSON Schema for expected output; required when output_format = json |
params |
No | object | Model call parameters |
connections |
No | object | Provider config using env substitution |
assets |
No | array | Attachments with path + MIME type (type/subtype) |
tools |
No | array | Tool/function declarations |
vision |
No | object | Expected image inputs |
tests |
No | array | Self-checks for prompt output; each item must include at least one expectation (expect_contains/expect_exact/expect_json_schema/expect) |
extends |
No | string | Relative path to base .gptp |
license |
No | string | SPDX ID (e.g., MIT) |
usage_notes |
No | string | Freeform tips |
provenance |
No | object | SHA256 + optional signature |
secrets |
No | array | List of env var names required |
The schemaVersion field identifies the specific version of the GPTP specification. For version 1.2.0, it is:
"schemaVersion": "1.2.0"- Current schema: v1.2.0
- Stability: Stable
- Schema language: JSON Schema Draft-07
- Media type (non-registered):
application/vnd.yuxilabs.gptp+json - File extension:
.gptp
Tools and runtimes can render .gptp into formats suitable for:
- OpenAI models (e.g., GPT-3.5, GPT-4, GPT-4 Turbo)
- Claude 3 (after conversion to
Human:/Assistant:turns) - LLaMA / Mistral (via instruction-style templating)
The full specification is available at:
All conformance claims must validate against the schema referenced by schemaVersion.
- If
output_formatisjson, thenoutput_schemais required. assets[].media_typeandvision.inputs[].media_typemust be valid MIME patterns (type/subtype).provenance.sha256must be a 64‑char hex string (case-insensitive).provenance.signatureshould be base64url (A–Z, a–z, 0–9,_,-, optional padding=).paramsis closed to unknown keys but allows vendor extensions prefixed withx-(e.g.,x-provider-knob).- Each
testsitem must specify at least one expectation:expect_contains,expect_exact,expect_json_schema, orexpect. - Extension points at the root: keys matching
parameters,output_contract,project, and anyx-prefixed keys are allowed for forward compatibility.
To enable validation and auto-completion for *.gptp files in editors that support JSON Schema associations:
// .vscode/settings.json
{
"json.schemas": [
{
"fileMatch": ["*.gptp"],
"url": "https://raw.githubusercontent.com/Yuxi-Labs/gptp/refs/tags/v1.2.0/schema/gptp.schema.json"
}
]
}