← Files PromptGPTARCHIVED FILE

openapi.json

11.4 KB · Nov 4, 2026 · 00:12 UTC

↓ Download file

{
  "openapi": "3.1.0",
  "info": {
    "title": "PromptGPT API",
    "description": "The official PromptGPT prompt engineering engine for ChatGPT. Generate, optimize, expand, and compress high-impact prompts for Images (Midjourney, DALL-E 3, Flux), Videos (Sora, Runway Gen-3, Kling), Code (Cursor, Claude, Copilot), and Productivity models.",
    "version": "1.0.0",
    "termsOfService": "https://promptgpt.io/terms",
    "contact": {
      "name": "PromptGPT Support",
      "url": "https://promptgpt.io",
      "email": "support@monetiscope.com"
    }
  },
  "servers": [
    {
      "url": "https://promptgpt.io"
    }
  ],
  "paths": {
    "/api/v1/prompts/optimize": {
      "post": {
        "operationId": "optimizePrompt",
        "summary": "Optimize, expand, or shorten a prompt with format-specific tags",
        "description": "Transforms, expands, or compresses an existing prompt. Supports format targeting for image generation (Midjourney, DALL-E, Flux), video generation (Sora, Runway), clean code (Cursor, Claude), and general productivity.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptimizePromptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Prompt successfully optimized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptimizePromptResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — Missing or invalid API key"
          },
          "402": {
            "description": "Insufficient credits — User needs to purchase more credits"
          }
        }
      }
    },
    "/api/v1/prompts/generate": {
      "post": {
        "operationId": "generatePrompt",
        "summary": "Generate a brand new prompt from an idea or topic",
        "description": "Generates a complete, high-quality prompt from a raw topic or idea tailored to a specific format (image, video, code, productivity).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeneratePromptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Prompt successfully generated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratePromptResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — Missing or invalid API key"
          },
          "402": {
            "description": "Insufficient credits — User needs to purchase more credits"
          }
        }
      }
    },
    "/api/v1/account/usage": {
      "get": {
        "operationId": "getAccountUsage",
        "summary": "Check remaining PromptGPT credit balance and account status",
        "description": "Returns the authenticated user's available credits, account email, rate limits, and daily request usage.",
        "responses": {
          "200": {
            "description": "Account status and remaining credit balance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — Missing or invalid API key"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "PromptGPT API Key (pgpt_live_...)"
      }
    },
    "schemas": {
      "OptimizePromptRequest": {
        "type": "object",
        "required": ["prompt"],
        "properties": {
          "prompt": {
            "type": "string",
            "description": "The user's raw prompt or text to optimize, expand, or shorten."
          },
          "format": {
            "type": "string",
            "enum": ["image", "video", "code", "productivity"],
            "default": "productivity",
            "description": "The target medium or task format: 'image' (Midjourney, DALL-E, Flux), 'video' (Sora, Runway), 'code' (Cursor, Claude), or 'productivity' (general writing, strategy)."
          },
          "operation": {
            "type": "string",
            "enum": ["optimize", "expand", "shorten"],
            "default": "optimize",
            "description": "'optimize' to polish and structure; 'expand' to add deep details, parameters, and context; 'shorten' to compress into token-efficient power prompts."
          },
          "target_platform": {
            "type": "string",
            "description": "Target AI tool or model (e.g. 'midjourney', 'dall-e', 'flux', 'sora', 'runway', 'cursor', 'claude', 'chatgpt').",
            "default": "universal"
          },
          "tags": {
            "type": "object",
            "description": "Format-specific parameters and add-on tags.",
            "properties": {
              "aspect_ratio": {
                "type": "string",
                "description": "For image format: e.g. '--ar 16:9', '--ar 9:16', '1:1'."
              },
              "lighting": {
                "type": "string",
                "description": "For image format: e.g. 'cinematic volumetric fog', 'golden hour', 'neon reflections'."
              },
              "camera": {
                "type": "string",
                "description": "For image format: e.g. '85mm f/1.4 portrait lens', 'macro lens', 'drone overhead'."
              },
              "art_style": {
                "type": "string",
                "description": "For image format: e.g. 'photorealistic 8k', 'anime cel-shaded', '3d claymation'."
              },
              "camera_motion": {
                "type": "string",
                "description": "For video format: e.g. 'smooth tracking drone sweep', 'slow zoom in', '360 orbit'."
              },
              "fps": {
                "type": "string",
                "description": "For video format: e.g. '60fps 4k', 'cinematic 24fps'."
              },
              "physics": {
                "type": "string",
                "description": "For video format: e.g. 'water splash dynamics', 'cloth physics', 'smoke dispersion'."
              },
              "language": {
                "type": "string",
                "description": "For code format: e.g. 'TypeScript', 'Python', 'Go', 'Kotlin'."
              },
              "framework": {
                "type": "string",
                "description": "For code format: e.g. 'Next.js 15', 'FastAPI', 'Jetpack Compose'."
              },
              "include_tests": {
                "type": "boolean",
                "description": "For code format: true to require unit test coverage."
              },
              "persona": {
                "type": "string",
                "description": "For productivity format: e.g. 'Senior SaaS Growth Marketer', 'Executive Tech Recruiter'."
              },
              "tone": {
                "type": "string",
                "description": "For productivity format: e.g. 'Executive', 'Persuasive', 'Analytical'."
              },
              "output_format": {
                "type": "string",
                "description": "For productivity format: e.g. 'Markdown Table', 'Step-by-step SOP', 'Executive Memo'."
              }
            }
          },
          "negative_prompt": {
            "type": "boolean",
            "description": "Whether to return negative prompt tags (recommended for image and video formats)."
          }
        }
      },
      "OptimizePromptResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "data": {
            "type": "object",
            "properties": {
              "original_prompt": { "type": "string" },
              "optimized_prompt": { "type": "string" },
              "negative_prompt": { "type": "string", "nullable": true },
              "format": { "type": "string" },
              "operation": { "type": "string" },
              "target_platform": { "type": "string" },
              "optimization_score": { "type": "integer" },
              "character_count": { "type": "integer" }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "credits_deducted": { "type": "integer" },
              "credits_remaining": { "type": "integer" },
              "latency_ms": { "type": "integer" }
            }
          }
        }
      },
      "GeneratePromptRequest": {
        "type": "object",
        "required": ["topic"],
        "properties": {
          "topic": {
            "type": "string",
            "description": "The topic, idea, or concept for which to generate a prompt."
          },
          "format": {
            "type": "string",
            "enum": ["image", "video", "code", "productivity"],
            "default": "productivity"
          },
          "target_platform": {
            "type": "string",
            "default": "universal"
          },
          "mode": {
            "type": "string",
            "enum": ["quick", "advanced", "ultimate"],
            "default": "advanced"
          },
          "tags": {
            "type": "object",
            "description": "Optional parameters to guide generation."
          }
        }
      },
      "GeneratePromptResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "data": {
            "type": "object",
            "properties": {
              "topic": { "type": "string" },
              "generated_prompt": { "type": "string" },
              "negative_prompt": { "type": "string", "nullable": true },
              "format": { "type": "string" },
              "mode": { "type": "string" },
              "target_platform": { "type": "string" },
              "character_count": { "type": "integer" }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "credits_deducted": { "type": "integer" },
              "credits_remaining": { "type": "integer" },
              "latency_ms": { "type": "integer" }
            }
          }
        }
      },
      "UsageResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean" },
          "data": {
            "type": "object",
            "properties": {
              "account_id": { "type": "integer" },
              "account_email": { "type": "string" },
              "available_credits": { "type": "integer" },
              "consumer_credits": { "type": "integer" },
              "api_credits": { "type": "integer" },
              "rate_limit_rpm": { "type": "integer" },
              "requests_today": { "type": "integer" },
              "requests_30_days": { "type": "integer" },
              "key_prefix": { "type": "string" }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "credits_remaining": { "type": "integer" }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ]
}

SHA-256: 6bec5c2f959173e41120dc805571f6fe0b70ab7f7f4217c69b45b231e21557e0