{"openapi":"3.1.0","info":{"title":"PrompTessor Public API","version":"1.0.0","description":"Versioned REST API for PrompTessor prompt workflows, usage, history, presets, Prompt Library content, uploads, asynchronous operations, and webhooks."},"servers":[{"url":"https://api.promptessor.com/v1","description":"Production"}],"tags":[{"name":"System"},{"name":"Account"},{"name":"Prompts"},{"name":"Prompt Presets"},{"name":"Operations"},{"name":"Uploads"},{"name":"History"},{"name":"Library"},{"name":"Webhooks"}],"paths":{"/":{"get":{"operationId":"getApiInformation","summary":"Get API information","tags":["System"],"responses":{"200":{"description":"API information","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiInformation"}}}}}}},"/health":{"get":{"operationId":"getApiHealth","summary":"Check API and database availability","tags":["System"],"responses":{"200":{"description":"Service is available","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"503":{"description":"Service is unavailable","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/capabilities":{"get":{"operationId":"getCapabilities","summary":"Get capabilities, granted scopes, and limits","tags":["Account"],"security":[{"apiKey":[]},{"oauth2":[]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/Capabilities"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/models":{"get":{"operationId":"listModels","summary":"List supported target models","tags":["Account"],"security":[{"apiKey":[]},{"oauth2":[]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/ModelList"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/usage":{"get":{"operationId":"getUsage","summary":"Get unified product usage","tags":["Account"],"security":[{"apiKey":[]},{"oauth2":["usage:read"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/Usage"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/prompts/generate":{"post":{"operationId":"generatePrompt","summary":"Generate a prompt","tags":["Prompts"],"security":[{"apiKey":[]},{"oauth2":["prompts:generate"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"A unique key retained for 24 hours. Reuse the same key and request body when retrying."},{"name":"Prefer","in":"header","schema":{"type":"string","enum":["respond-async"]},"description":"Use respond-async to defer a supported AI operation."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"additionalProperties":false,"properties":{"message":{"type":"string","minLength":1,"maxLength":6000},"mode":{"type":"string","enum":["auto","general","research","writing","planning","agent","image","video","code","automation"],"default":"auto"},"outputMode":{"type":"string","enum":["ready_to_use","reusable"],"default":"ready_to_use"},"targetModel":{"type":"string","enum":["Universal","ChatGPT","Claude","Gemini","Grok","Llama","Mistral","DeepSeek","Perplexity","Cohere","Kimi","Qwen","GPT Image","Midjourney","Nano Banana","FLUX","Ideogram","Stable Diffusion","Lumina","Runway Image","Kling Image","Wan Image","Seedream","Veo","Runway","Kling","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video"],"default":"Universal"},"language":{"type":"string","minLength":2,"maxLength":20,"default":"en"},"generationId":{"type":["string","null"],"minLength":1,"maxLength":120},"currentPrompt":{"type":["string","null"],"maxLength":20000},"conversation":{"type":"array","maxItems":50,"default":[],"items":{"type":"object","required":["role","content"],"additionalProperties":false,"properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string","maxLength":4000}}}},"attachmentIds":{"type":"array","maxItems":5,"default":[],"items":{"type":"string","minLength":1,"maxLength":191}}}}}}},"responses":{"200":{"description":"AI operation completed","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiOperationResult"}}}},"202":{"description":"Accepted for asynchronous processing","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Location":{"schema":{"type":"string"}},"Preference-Applied":{"schema":{"type":"string","const":"respond-async"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationAccepted"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/prompts/analyze":{"post":{"operationId":"analyzePrompt","summary":"Analyze a prompt","tags":["Prompts"],"security":[{"apiKey":[]},{"oauth2":["prompts:analyze"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"A unique key retained for 24 hours. Reuse the same key and request body when retrying."},{"name":"Prefer","in":"header","schema":{"type":"string","enum":["respond-async"]},"description":"Use respond-async to defer a supported AI operation."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"additionalProperties":false,"properties":{"promptId":{"type":["string","null"]},"prompt":{"type":"string","minLength":1,"maxLength":50000},"language":{"type":"string","minLength":2,"maxLength":20,"default":"en"},"context":{"type":"string","maxLength":20000,"default":""},"attachmentIds":{"type":"array","maxItems":5,"default":[],"items":{"type":"string","minLength":1,"maxLength":191}},"targetModel":{"type":"string","enum":["Universal","ChatGPT","Claude","Gemini","Grok","Llama","Mistral","DeepSeek","Perplexity","Cohere","Kimi","Qwen","GPT Image","Midjourney","Nano Banana","FLUX","Ideogram","Stable Diffusion","Lumina","Runway Image","Kling Image","Wan Image","Seedream","Veo","Runway","Kling","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video"],"default":"Universal"},"variationCount":{"type":"integer","enum":[1,2],"default":1}}}}}},"responses":{"200":{"description":"AI operation completed","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiOperationResult"}}}},"202":{"description":"Accepted for asynchronous processing","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Location":{"schema":{"type":"string"}},"Preference-Applied":{"schema":{"type":"string","const":"respond-async"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationAccepted"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/prompts/optimize":{"post":{"operationId":"optimizePrompt","summary":"Optimize a prompt","tags":["Prompts"],"security":[{"apiKey":[]},{"oauth2":["prompts:optimize"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"A unique key retained for 24 hours. Reuse the same key and request body when retrying."},{"name":"Prefer","in":"header","schema":{"type":"string","enum":["respond-async"]},"description":"Use respond-async to defer a supported AI operation."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"additionalProperties":false,"properties":{"promptId":{"type":["string","null"]},"prompt":{"type":"string","minLength":1,"maxLength":50000},"language":{"type":"string","minLength":2,"maxLength":20,"default":"en"},"context":{"type":"string","maxLength":20000,"default":""},"attachmentIds":{"type":"array","maxItems":5,"default":[],"items":{"type":"string","minLength":1,"maxLength":191}},"targetModel":{"type":"string","enum":["Universal","ChatGPT","Claude","Gemini","Grok","Llama","Mistral","DeepSeek","Perplexity","Cohere","Kimi","Qwen","GPT Image","Midjourney","Nano Banana","FLUX","Ideogram","Stable Diffusion","Lumina","Runway Image","Kling Image","Wan Image","Seedream","Veo","Runway","Kling","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video"],"default":"Universal"},"variationCount":{"type":"integer","enum":[1,2],"default":1}}}}}},"responses":{"200":{"description":"AI operation completed","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiOperationResult"}}}},"202":{"description":"Accepted for asynchronous processing","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Location":{"schema":{"type":"string"}},"Preference-Applied":{"schema":{"type":"string","const":"respond-async"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationAccepted"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/prompts/analyze-and-optimize":{"post":{"operationId":"analyzeAndOptimizePrompt","summary":"Analyze and optimize a prompt","tags":["Prompts"],"security":[{"apiKey":[]},{"oauth2":["prompts:analyze","prompts:optimize"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"A unique key retained for 24 hours. Reuse the same key and request body when retrying."},{"name":"Prefer","in":"header","schema":{"type":"string","enum":["respond-async"]},"description":"Use respond-async to defer a supported AI operation."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"additionalProperties":false,"properties":{"promptId":{"type":["string","null"]},"prompt":{"type":"string","minLength":1,"maxLength":50000},"language":{"type":"string","minLength":2,"maxLength":20,"default":"en"},"context":{"type":"string","maxLength":20000,"default":""},"attachmentIds":{"type":"array","maxItems":5,"default":[],"items":{"type":"string","minLength":1,"maxLength":191}},"targetModel":{"type":"string","enum":["Universal","ChatGPT","Claude","Gemini","Grok","Llama","Mistral","DeepSeek","Perplexity","Cohere","Kimi","Qwen","GPT Image","Midjourney","Nano Banana","FLUX","Ideogram","Stable Diffusion","Lumina","Runway Image","Kling Image","Wan Image","Seedream","Veo","Runway","Kling","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video"],"default":"Universal"},"variationCount":{"type":"integer","enum":[1,2],"default":1}}}}}},"responses":{"200":{"description":"AI operation completed","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiOperationResult"}}}},"202":{"description":"Accepted for asynchronous processing","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Location":{"schema":{"type":"string"}},"Preference-Applied":{"schema":{"type":"string","const":"respond-async"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationAccepted"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/prompts/refine":{"post":{"operationId":"refinePrompt","summary":"Refine a prompt from feedback","tags":["Prompts"],"security":[{"apiKey":[]},{"oauth2":["prompts:refine"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"A unique key retained for 24 hours. Reuse the same key and request body when retrying."},{"name":"Prefer","in":"header","schema":{"type":"string","enum":["respond-async"]},"description":"Use respond-async to defer a supported AI operation."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt","feedback"],"additionalProperties":false,"properties":{"prompt":{"type":"string","minLength":1,"maxLength":50000},"feedback":{"type":"string","minLength":1,"maxLength":10000},"refinementId":{"type":"string"},"language":{"type":"string","minLength":2,"maxLength":20,"default":"en"},"attachmentIds":{"type":"array","maxItems":5,"default":[],"items":{"type":"string","minLength":1,"maxLength":191}},"targetModel":{"type":"string","enum":["Universal","ChatGPT","Claude","Gemini","Grok","Llama","Mistral","DeepSeek","Perplexity","Cohere","Kimi","Qwen","GPT Image","Midjourney","Nano Banana","FLUX","Ideogram","Stable Diffusion","Lumina","Runway Image","Kling Image","Wan Image","Seedream","Veo","Runway","Kling","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video"],"default":"Universal"}}}}}},"responses":{"200":{"description":"AI operation completed","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiOperationResult"}}}},"202":{"description":"Accepted for asynchronous processing","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Location":{"schema":{"type":"string"}},"Preference-Applied":{"schema":{"type":"string","const":"respond-async"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationAccepted"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/optimizations/{id}/refinements":{"post":{"operationId":"refineOptimizedPrompt","summary":"Refine an optimized version","tags":["Prompts"],"security":[{"apiKey":[]},{"oauth2":["prompts:refine"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":191}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"A unique key retained for 24 hours. Reuse the same key and request body when retrying."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sourceVersionId","feedback"],"additionalProperties":false,"properties":{"sourceVersionId":{"type":"string","minLength":1},"parentRefinementId":{"type":"string","minLength":1},"feedback":{"type":"string","minLength":1,"maxLength":10000},"language":{"type":"string","minLength":2,"maxLength":20,"default":"en"},"attachmentIds":{"type":"array","maxItems":5,"default":[],"items":{"type":"string","minLength":1,"maxLength":191}},"targetModel":{"type":"string","enum":["Universal","ChatGPT","Claude","Gemini","Grok","Llama","Mistral","DeepSeek","Perplexity","Cohere","Kimi","Qwen","GPT Image","Midjourney","Nano Banana","FLUX","Ideogram","Stable Diffusion","Lumina","Runway Image","Kling Image","Wan Image","Seedream","Veo","Runway","Kling","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video"]}}}}}},"responses":{"200":{"description":"AI operation completed","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiOperationResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/reverse-prompts":{"post":{"operationId":"reversePrompt","summary":"Reverse engineer a prompt; no history is stored","tags":["Prompts"],"security":[{"apiKey":[]},{"oauth2":["prompts:reverse"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"A unique key retained for 24 hours. Reuse the same key and request body when retrying."},{"name":"Prefer","in":"header","schema":{"type":"string","enum":["respond-async"]},"description":"Use respond-async to defer a supported AI operation."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["type","uploadId"],"additionalProperties":false,"properties":{"type":{"type":"string","const":"image"},"uploadId":{"type":"string","minLength":1,"maxLength":191},"language":{"type":"string","minLength":2,"maxLength":20,"default":"en"},"targetModel":{"type":"string","enum":["Universal","ChatGPT","Claude","Gemini","Grok","Llama","Mistral","DeepSeek","Perplexity","Cohere","Kimi","Qwen","GPT Image","Midjourney","Nano Banana","FLUX","Ideogram","Stable Diffusion","Lumina","Runway Image","Kling Image","Wan Image","Seedream","Veo","Runway","Kling","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video"],"default":"Universal"}}},{"type":"object","required":["type","frames","frameCount","videoDuration"],"additionalProperties":false,"properties":{"type":{"type":"string","const":"video"},"frames":{"type":"array","minItems":1,"maxItems":30,"items":{"type":"string","pattern":"^data:image/"}},"frameCount":{"type":"integer","minimum":1,"maximum":30},"videoDuration":{"type":"number","exclusiveMinimum":0,"maximum":600},"language":{"type":"string","minLength":2,"maxLength":20,"default":"en"},"targetModel":{"type":"string","enum":["Universal","ChatGPT","Claude","Gemini","Grok","Llama","Mistral","DeepSeek","Perplexity","Cohere","Kimi","Qwen","GPT Image","Midjourney","Nano Banana","FLUX","Ideogram","Stable Diffusion","Lumina","Runway Image","Kling Image","Wan Image","Seedream","Veo","Runway","Kling","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video"],"default":"Universal"}}},{"type":"object","required":["type","content"],"additionalProperties":false,"properties":{"type":{"type":"string","const":"text"},"content":{"type":"string","minLength":10,"maxLength":100000},"language":{"type":"string","minLength":2,"maxLength":20,"default":"en"},"targetModel":{"type":"string","enum":["Universal","ChatGPT","Claude","Gemini","Grok","Llama","Mistral","DeepSeek","Perplexity","Cohere","Kimi","Qwen","GPT Image","Midjourney","Nano Banana","FLUX","Ideogram","Stable Diffusion","Lumina","Runway Image","Kling Image","Wan Image","Seedream","Veo","Runway","Kling","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video"],"default":"Universal"}}},{"type":"object","required":["type","url"],"additionalProperties":false,"properties":{"type":{"type":"string","const":"url"},"url":{"type":"string","format":"uri","maxLength":2048},"language":{"type":"string","minLength":2,"maxLength":20,"default":"en"},"targetModel":{"type":"string","enum":["Universal","ChatGPT","Claude","Gemini","Grok","Llama","Mistral","DeepSeek","Perplexity","Cohere","Kimi","Qwen","GPT Image","Midjourney","Nano Banana","FLUX","Ideogram","Stable Diffusion","Lumina","Runway Image","Kling Image","Wan Image","Seedream","Veo","Runway","Kling","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video"],"default":"Universal"}}}]}}}},"responses":{"200":{"description":"AI operation completed","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiOperationResult"}}}},"202":{"description":"Accepted for asynchronous processing","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Location":{"schema":{"type":"string"}},"Preference-Applied":{"schema":{"type":"string","const":"respond-async"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncOperationAccepted"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/prompts/token-estimate":{"post":{"operationId":"estimatePromptTokens","summary":"Estimate prompt tokens","tags":["Prompts"],"security":[{"apiKey":[]},{"oauth2":["usage:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"additionalProperties":false,"properties":{"prompt":{"type":"string","maxLength":200000}}}}}},"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/TokenEstimate"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/prompt-presets":{"get":{"operationId":"listPromptPresets","summary":"List owned prompt variable presets","tags":["Prompt Presets"],"security":[{"apiKey":[]},{"oauth2":["prompts:presets:read"]}],"parameters":[{"name":"search","in":"query","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/PromptPresetList"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createPromptPreset","summary":"Create a prompt variable preset","tags":["Prompt Presets"],"security":[{"apiKey":[]},{"oauth2":["prompts:presets:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","promptText","values"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"templateTitle":{"type":"string","maxLength":200},"promptText":{"type":"string","minLength":1,"maxLength":20000},"values":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","maxLength":10000}},"generationId":{"type":"string","maxLength":191},"generatedVersionId":{"type":"string","maxLength":191}}}}}},"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/PromptPreset"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/prompt-presets/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":191}}],"get":{"operationId":"getPromptPreset","summary":"Get an owned prompt variable preset","tags":["Prompt Presets"],"security":[{"apiKey":[]},{"oauth2":["prompts:presets:read"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/PromptPreset"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updatePromptPreset","summary":"Update a prompt variable preset","tags":["Prompt Presets"],"security":[{"apiKey":[]},{"oauth2":["prompts:presets:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"values":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","maxLength":10000}}}}}}},"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/PromptPreset"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deletePromptPreset","summary":"Delete a prompt variable preset","tags":["Prompt Presets"],"security":[{"apiKey":[]},{"oauth2":["prompts:presets:write"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/DeleteResult"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/prompt-presets/{id}/render":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":191}}],"post":{"operationId":"renderPromptPreset","summary":"Render a prompt preset with variable overrides","tags":["Prompt Presets"],"security":[{"apiKey":[]},{"oauth2":["prompts:presets:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"values":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","maxLength":10000}}}}}}},"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/RenderedPromptPreset"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/operations":{"get":{"operationId":"listOperations","summary":"List AI operations","tags":["Operations"],"security":[{"apiKey":[]},{"oauth2":["operations:read"]}],"parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","CANCELLED"]}},{"name":"kind","in":"query","schema":{"type":"string","maxLength":100}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/OperationList"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/operations/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":191}}],"get":{"operationId":"getOperation","summary":"Get an AI operation","tags":["Operations"],"security":[{"apiKey":[]},{"oauth2":["operations:read"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/Operation"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"cancelOperation","summary":"Cancel a pending AI operation","tags":["Operations"],"security":[{"apiKey":[]},{"oauth2":["operations:cancel"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/Operation"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/uploads":{"post":{"operationId":"createUpload","summary":"Create a presigned temporary upload","tags":["Uploads"],"security":[{"apiKey":[]},{"oauth2":["uploads:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["scope","filename","contentType","size"],"additionalProperties":false,"properties":{"scope":{"type":"string","enum":["analysis","refinement","feedback","generation","reverse_image","reverse_video"]},"filename":{"type":"string","minLength":1,"maxLength":255},"contentType":{"type":"string","minLength":1,"maxLength":100,"description":"Images: image/jpeg, image/png, image/webp, image/gif. reverse_video: video/mp4, video/quicktime, video/webm."},"size":{"type":"integer","minimum":1,"description":"Maximum 5 MB for images and 100 MB for reverse_video."}}}}}},"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/UploadCreation"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/uploads/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":191}}],"get":{"operationId":"getUpload","summary":"Get an upload","tags":["Uploads"],"security":[{"apiKey":[]},{"oauth2":["uploads:write"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/Upload"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteUpload","summary":"Delete an unconsumed upload","tags":["Uploads"],"security":[{"apiKey":[]},{"oauth2":["uploads:write"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/Upload"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/uploads/{id}/complete":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":191}}],"post":{"operationId":"completeUpload","summary":"Validate and complete an uploaded object","tags":["Uploads"],"security":[{"apiKey":[]},{"oauth2":["uploads:write"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/Upload"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"410":{"$ref":"#/components/responses/Gone"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/history":{"get":{"operationId":"listHistory","summary":"List product history","tags":["History"],"security":[{"apiKey":[]},{"oauth2":["history:read"]}],"parameters":[{"name":"type","in":"query","schema":{"type":"string","enum":["generation","optimization","refinement"],"default":"optimization"}},{"name":"search","in":"query","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/HistoryList"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/history/{type}/{id}":{"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["generation","optimization","refinement"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":191}}],"get":{"operationId":"getHistoryItem","summary":"Get a history item","tags":["History"],"security":[{"apiKey":[]},{"oauth2":["history:read"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/HistoryDetail"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"renameHistoryItem","summary":"Rename a history item","tags":["History"],"security":[{"apiKey":[]},{"oauth2":["history:manage"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"additionalProperties":false,"properties":{"title":{"type":"string","minLength":1,"maxLength":180}}}}}},"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/HistoryDetail"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteHistoryItem","summary":"Delete a history item","tags":["History"],"security":[{"apiKey":[]},{"oauth2":["history:manage"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/DeleteResult"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/library/items":{"get":{"operationId":"listLibraryItems","summary":"List Prompt Library items","tags":["Library"],"security":[{"apiKey":[]},{"oauth2":["library:read"]}],"parameters":[{"name":"scope","in":"query","schema":{"type":"string","enum":["my","community","official","saved","upvoted"],"default":"my"}},{"name":"query","in":"query","schema":{"type":"string","maxLength":200}},{"name":"category","in":"query","schema":{"type":"string","maxLength":120}},{"name":"models","in":"query","schema":{"type":"string"},"description":"Comma-separated model names."},{"name":"sort","in":"query","schema":{"type":"string","enum":["recent","top"],"default":"recent"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":30,"default":30}}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/LibraryList"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createLibraryItem","summary":"Create a private Prompt Library item","tags":["Library"],"security":[{"apiKey":[]},{"oauth2":["library:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","promptText","recommendedModels","category"],"additionalProperties":false,"properties":{"title":{"type":"string","minLength":1,"maxLength":90},"promptText":{"type":"string","minLength":1,"maxLength":20000},"description":{"type":"string","maxLength":400},"whatThisPromptDoes":{"type":"string","maxLength":1500},"tipsForThisPrompt":{"type":"string","maxLength":1500},"howToUsePrompt":{"type":"string","maxLength":1500},"recommendedModels":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"string","enum":["ChatGPT","GPT Image","Claude","Gemini","Nano Banana","Perplexity","Grok","Mistral","Llama","DeepSeek","Qwen","Kimi","Cohere","Copilot","Midjourney","Ideogram","Leonardo","Stable Diffusion","FLUX","Lumina","Runway Image","Kling Image","Wan Image","Seedream","DALL-E","Runway","Kling","Veo","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video","Suno","Udio","ElevenLabs","Other"]}},"category":{"type":"string","minLength":1,"maxLength":120},"exampleText":{"type":"string","maxLength":5000},"tokenEstimate":{"type":"object","properties":{"input":{"type":"integer","minimum":0},"output":{"type":"integer","minimum":0}}},"visibility":{"type":"string","const":"private","default":"private"}}}}}},"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/LibraryItem"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/library/items/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":191}}],"get":{"operationId":"getLibraryItem","summary":"Get a Prompt Library item","tags":["Library"],"security":[{"apiKey":[]},{"oauth2":["library:read"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/LibraryItem"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateLibraryItem","summary":"Update an owned item","tags":["Library"],"security":[{"apiKey":[]},{"oauth2":["library:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"title":{"type":"string","minLength":1,"maxLength":90},"promptText":{"type":"string","minLength":1,"maxLength":20000},"description":{"type":"string","maxLength":400},"whatThisPromptDoes":{"type":"string","maxLength":1500},"tipsForThisPrompt":{"type":"string","maxLength":1500},"howToUsePrompt":{"type":"string","maxLength":1500},"recommendedModels":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"string","enum":["ChatGPT","GPT Image","Claude","Gemini","Nano Banana","Perplexity","Grok","Mistral","Llama","DeepSeek","Qwen","Kimi","Cohere","Copilot","Midjourney","Ideogram","Leonardo","Stable Diffusion","FLUX","Lumina","Runway Image","Kling Image","Wan Image","Seedream","DALL-E","Runway","Kling","Veo","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video","Suno","Udio","ElevenLabs","Other"]}},"category":{"type":"string","minLength":1,"maxLength":120},"exampleText":{"type":"string","maxLength":5000},"tokenEstimate":{"type":"object","properties":{"input":{"type":"integer","minimum":0},"output":{"type":"integer","minimum":0}}}}}}}},"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/LibraryItem"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteLibraryItem","summary":"Delete an owned item","tags":["Library"],"security":[{"apiKey":[]},{"oauth2":["library:write"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/DeleteResult"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/library/items/{id}/saved":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":191}}],"post":{"operationId":"toggleSavedLibraryItem","summary":"Toggle saved state","tags":["Library"],"security":[{"apiKey":[]},{"oauth2":["library:interact"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/LibraryToggle"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/library/items/{id}/vote":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":191}}],"post":{"operationId":"toggleLibraryVote","summary":"Toggle vote","tags":["Library"],"security":[{"apiKey":[]},{"oauth2":["library:interact"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/LibraryToggle"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/library/items/{id}/publish":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":191}}],"post":{"operationId":"publishLibraryItem","summary":"Publish an owned item","tags":["Library"],"security":[{"apiKey":[]},{"oauth2":["library:publish"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/LibraryPublication"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"unpublishLibraryItem","summary":"Make an owned item private","tags":["Library"],"security":[{"apiKey":[]},{"oauth2":["library:publish"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/LibraryPublication"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhook-endpoints":{"get":{"operationId":"listWebhookEndpoints","summary":"List webhook endpoints","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["webhooks:manage"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/WebhookList"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createWebhookEndpoint","summary":"Create an endpoint; secret is returned once","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["webhooks:manage"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","events"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"Must be a public HTTPS URL."},"description":{"type":"string","maxLength":300},"events":{"type":"array","minItems":1,"maxItems":7,"uniqueItems":true,"items":{"type":"string","enum":["operation.succeeded","operation.failed","operation.cancelled","usage.threshold_reached","usage.exhausted","addon_usage.low","library.item.published"]}}}}}}},"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/webhook-endpoints/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":191}}],"get":{"operationId":"getWebhookEndpoint","summary":"Get a webhook endpoint","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["webhooks:manage"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"testWebhookEndpoint","summary":"Send a webhook.test delivery","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["webhooks:manage"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/WebhookTestResult"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"patch":{"operationId":"updateWebhookEndpoint","summary":"Update an endpoint or rotate its secret","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["webhooks:manage"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"Must be a public HTTPS URL."},"description":{"type":"string","maxLength":300},"events":{"type":"array","minItems":1,"maxItems":7,"uniqueItems":true,"items":{"type":"string","enum":["operation.succeeded","operation.failed","operation.cancelled","usage.threshold_reached","usage.exhausted","addon_usage.low","library.item.published"]}},"enabled":{"type":"boolean"},"rotateSecret":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"delete":{"operationId":"deleteWebhookEndpoint","summary":"Delete an endpoint","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["webhooks:manage"]}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["data","requestId"],"properties":{"data":{"$ref":"#/components/schemas/DeleteResult"},"requestId":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"webhooks":{"promptessorEvent":{"post":{"operationId":"receivePromptessorWebhook","summary":"Receive a signed PrompTessor event","tags":["Webhooks"],"parameters":[{"name":"X-PrompTessor-Event","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-PrompTessor-Delivery","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-PrompTessor-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-PrompTessor-Signature","in":"header","required":true,"schema":{"type":"string","pattern":"^v1=[a-f0-9]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Delivery accepted by the subscriber"}}}}},"components":{"schemas":{"ErrorEnvelope":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","code","message","requestId"],"properties":{"type":{"type":"string","enum":["invalid_request_error","api_error"]},"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string"},"details":{},"requestId":{"type":"string"}}}}},"ApiInformation":{"type":"object","required":["name","version","documentation","openapi","mcp"],"properties":{"name":{"type":"string"},"version":{"type":"string","const":"v1"},"documentation":{"type":"string","format":"uri"},"openapi":{"type":"string","format":"uri"},"mcp":{"type":"string","format":"uri"}}},"Health":{"type":"object","required":["service","version","status","timestamp"],"properties":{"service":{"type":"string"},"version":{"type":"string","const":"v1"},"status":{"type":"string","enum":["ok","unavailable"]},"timestamp":{"type":"string","format":"date-time"}}},"PlanLimits":{"type":"object","required":["aiRequestsPerMinute","readRequestsPerMinute","concurrentAiOperations","apiKeys","webhookEndpoints","activeUploads","activeUploadBytes"],"properties":{"aiRequestsPerMinute":{"type":"integer"},"readRequestsPerMinute":{"type":"integer"},"concurrentAiOperations":{"type":"integer"},"apiKeys":{"type":"integer"},"webhookEndpoints":{"type":"integer"},"activeUploads":{"type":"integer"},"activeUploadBytes":{"type":"integer"}}},"Capabilities":{"type":"object","required":["apiVersion","plan","scopes","grantedScopes","availableScopes","limits","retention","features","generatorModes","targetModels"],"properties":{"apiVersion":{"type":"string","const":"v1"},"plan":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["prompts:generate","prompts:presets:read","prompts:presets:write","prompts:analyze","prompts:optimize","prompts:refine","prompts:reverse","uploads:write","usage:read","history:read","history:manage","library:read","library:write","library:interact","library:publish","operations:read","operations:cancel","webhooks:manage"]}},"grantedScopes":{"type":"array","items":{"type":"string","enum":["prompts:generate","prompts:presets:read","prompts:presets:write","prompts:analyze","prompts:optimize","prompts:refine","prompts:reverse","uploads:write","usage:read","history:read","history:manage","library:read","library:write","library:interact","library:publish","operations:read","operations:cancel","webhooks:manage"]}},"availableScopes":{"type":"array","items":{"type":"string","enum":["prompts:generate","prompts:presets:read","prompts:presets:write","prompts:analyze","prompts:optimize","prompts:refine","prompts:reverse","uploads:write","usage:read","history:read","history:manage","library:read","library:write","library:interact","library:publish","operations:read","operations:cancel","webhooks:manage"]}},"limits":{"$ref":"#/components/schemas/PlanLimits"},"retention":{"type":"object","additionalProperties":{"type":"integer"}},"features":{"type":"object","additionalProperties":true},"generatorModes":{"type":"array","items":{"type":"string","enum":["auto","general","research","writing","planning","agent","image","video","code","automation"]}},"targetModels":{"type":"array","items":{"type":"string","enum":["Universal","ChatGPT","Claude","Gemini","Grok","Llama","Mistral","DeepSeek","Perplexity","Cohere","Kimi","Qwen","GPT Image","Midjourney","Nano Banana","FLUX","Ideogram","Stable Diffusion","Lumina","Runway Image","Kling Image","Wan Image","Seedream","Veo","Runway","Kling","Seedance","Wan","MiniMax","Luma","Pika","Vidu","PixVerse","LTX","Adobe Firefly Video","Midjourney Video","Grok Imagine Video"]}}}},"ModelList":{"type":"object","required":["object","data","reversePrompt"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"target_model"},"supports":{"type":"array","items":{"type":"string"}}}}},"reversePrompt":{"type":"object","properties":{"image":{"type":"array","items":{"type":"string"}},"video":{"type":"array","items":{"type":"string"}}}}}},"Usage":{"type":"object","required":["monthlyUsage","addonUsageBalance","addonUsageAvailable","nextUsageReset","plan","api"],"properties":{"monthlyUsage":{"type":"integer"},"monthlyLimit":{"type":"integer"},"addonUsageBalance":{"type":"integer"},"addonUsageAvailable":{"type":"boolean"},"nextUsageReset":{"type":["string","null"],"format":"date-time"},"analysisMonthly":{"type":"integer"},"analysisMonthlyLimit":{"type":"integer"},"basicDaily":{"type":"integer"},"basicMonthly":{"type":"integer"},"advancedDaily":{"type":"integer"},"advancedMonthly":{"type":"integer"},"plan":{"type":"string"},"api":{"$ref":"#/components/schemas/PlanLimits"}}},"UsageCharge":{"type":"object","required":["creditsCharged","source"],"properties":{"creditsCharged":{"type":"integer"},"source":{"type":["string","null"]},"tokens":{"type":["integer","null"]}}},"HistoryLink":{"type":"object","required":["type","id"],"properties":{"type":{"type":["string","null"]},"id":{"type":"string"},"url":{"type":"string"}}},"AiOperationResult":{"type":"object","required":["id","object","status","data","requestId","usage"],"properties":{"id":{"type":"string"},"object":{"type":"string"},"status":{"type":"string","const":"succeeded"},"data":{"type":"object","additionalProperties":true},"history":{"$ref":"#/components/schemas/HistoryLink"},"requestId":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageCharge"}}},"AsyncOperationAccepted":{"type":"object","required":["id","object","status","requestId"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"operation"},"status":{"type":"string","const":"pending"},"requestId":{"type":"string"}}},"Operation":{"type":"object","required":["id","object","kind","status","response","responseStatus","errorCode","history","usage","createdAt","startedAt","completedAt"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"operation"},"kind":{"type":"string"},"status":{"type":"string","enum":["pending","running","succeeded","failed","cancelled"]},"response":{},"responseStatus":{"type":["integer","null"]},"errorCode":{"type":["string","null"]},"history":{"oneOf":[{"$ref":"#/components/schemas/HistoryLink"},{"type":"null"}]},"usage":{"$ref":"#/components/schemas/UsageCharge"},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}}},"OperationListItem":{"type":"object","required":["id","object","kind","status","responseStatus","errorCode","history","usage","createdAt","startedAt","completedAt"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"operation"},"kind":{"type":"string"},"status":{"type":"string","enum":["pending","running","succeeded","failed","cancelled"]},"responseStatus":{"type":["integer","null"]},"errorCode":{"type":["string","null"]},"history":{"oneOf":[{"$ref":"#/components/schemas/HistoryLink"},{"type":"null"}]},"usage":{"$ref":"#/components/schemas/UsageCharge"},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}}},"OperationList":{"type":"object","required":["object","data","nextCursor"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/OperationListItem"}},"nextCursor":{"type":["string","null"]}}},"UploadCreation":{"type":"object","required":["id","status","uploadUrl","requiredHeaders","uploadUrlExpiresAt","assetExpiresAt"],"properties":{"id":{"type":"string"},"status":{"type":"string","const":"pending"},"uploadUrl":{"type":"string","format":"uri"},"requiredHeaders":{"type":"object","additionalProperties":{"type":"string"}},"uploadUrlExpiresAt":{"type":"string","format":"date-time"},"assetExpiresAt":{"type":"string","format":"date-time"}}},"Upload":{"type":"object","required":["id","status","name","contentType","size","scope","expiresAt","createdAt"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","uploaded","processing","consumed","expired","deleted"]},"name":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"integer"},"scope":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"DeleteResult":{"type":"object","required":["id","deleted"],"properties":{"id":{"type":"string"},"deleted":{"type":"boolean","const":true}}},"PromptPreset":{"type":"object","required":["id","name","templateTitle","promptText","values","variables","generationId","generatedVersionId","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"templateTitle":{"type":["string","null"]},"promptText":{"type":"string"},"values":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","maxLength":10000}},"variables":{"type":"array","items":{"type":"string"}},"generationId":{"type":["string","null"]},"generatedVersionId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"PromptPresetList":{"type":"object","required":["object","data","total","limit","offset","hasMore"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PromptPreset"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"hasMore":{"type":"boolean"}}},"RenderedPromptPreset":{"type":"object","required":["id","name","templateTitle","promptText","prompt","values","variables","unresolvedVariables"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"templateTitle":{"type":["string","null"]},"promptText":{"type":"string"},"prompt":{"type":"string"},"values":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","maxLength":10000}},"variables":{"type":"array","items":{"type":"string"}},"unresolvedVariables":{"type":"array","items":{"type":"string"}}}},"HistorySummary":{"type":"object","required":["id","title","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"text":{"type":"string"},"requestText":{"type":"string"},"originalPrompt":{"type":"string"},"mode":{"type":"string"},"versionCount":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"HistoryList":{"type":"object","required":["total","limit","offset"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/HistorySummary"}},"generations":{"type":"array","items":{"$ref":"#/components/schemas/HistorySummary"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}},"HistoryDetail":{"type":"object","required":["id","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"title":{"type":"string"},"text":{"type":"string"},"analysis":{},"requestText":{"type":"string"},"mode":{"type":"string"},"language":{"type":"string"},"conversation":{"type":"array","items":{"type":"object"}},"versions":{"type":"array","items":{"type":"object"}},"originalPrompt":{"type":"string"},"userFeedback":{"type":"string"},"refinedVersion":{},"feedbackIterations":{"type":"array","items":{"type":"object"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"TokenEstimate":{"type":"object","required":["object","tokens","characters","method"],"properties":{"object":{"type":"string","const":"token_estimate"},"tokens":{"type":"integer"},"characters":{"type":"integer"},"method":{"type":"string","const":"character_approximation"}}},"LibraryItem":{"type":"object","required":["id","title","promptText","recommendedModels","category","visibility","publishingBlocked","exampleImages","voteCount","hasVoted","isSaved","isOwner","isPinned","isOfficial","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"whatThisPromptDoes":{"type":["string","null"]},"tipsForThisPrompt":{"type":["string","null"]},"howToUsePrompt":{"type":["string","null"]},"recommendedModels":{"type":"array","items":{"type":"string"}},"promptText":{"type":"string"},"category":{"type":"string"},"visibility":{"type":"string","enum":["private","public"]},"publishingBlocked":{"type":"boolean"},"exampleText":{"type":["string","null"]},"exampleImages":{"type":"array","items":{"type":"object"}},"tokenEstimate":{"type":"object","properties":{"input":{"type":"integer","minimum":0},"output":{"type":"integer","minimum":0}}},"voteCount":{"type":"integer"},"hasVoted":{"type":"boolean"},"isSaved":{"type":"boolean"},"isOwner":{"type":"boolean"},"isPinned":{"type":"boolean"},"isOfficial":{"type":"boolean"},"authorName":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"LibraryList":{"type":"object","required":["items","pagination","stats"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LibraryItem"}},"pagination":{"type":"object","required":["page","pageSize","totalCount","totalPages","hasNextPage","hasPreviousPage"],"properties":{"page":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"},"totalPages":{"type":"integer"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}}},"stats":{"type":"object","additionalProperties":{"type":"integer"}}}},"LibraryToggle":{"type":"object","properties":{"itemId":{"type":"string"},"saved":{"type":"boolean"},"voted":{"type":"boolean"},"voteCount":{"type":"integer"}}},"LibraryPublication":{"type":"object","required":["itemId","visibility","published","updatedAt"],"properties":{"itemId":{"type":"string"},"visibility":{"type":"string","enum":["private","public"]},"published":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time"}}},"WebhookEndpoint":{"type":"object","required":["id","object","url","description","events","enabled","lastDeliveryAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"webhook_endpoint"},"url":{"type":"string","format":"uri"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string","enum":["operation.succeeded","operation.failed","operation.cancelled","usage.threshold_reached","usage.exhausted","addon_usage.low","library.item.published"]}},"enabled":{"type":"boolean"},"lastDeliveryAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"secret":{"type":"string","writeOnly":true}}},"WebhookList":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"WebhookTestResult":{"type":"object","required":["delivered","deliveryId"],"properties":{"delivered":{"type":"boolean"},"deliveryId":{"type":["string","null"]}}},"WebhookEvent":{"type":"object","required":["id","object","event","createdAt","data"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"event"},"event":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"data":{}}}},"headers":{"XRequestId":{"description":"PrompTessor correlation identifier.","schema":{"type":"string"}},"RateLimitLimit":{"description":"Maximum requests in the current one-minute request class.","schema":{"type":"integer"}},"RateLimitRemaining":{"description":"Requests remaining after this request.","schema":{"type":"integer","minimum":0}},"RateLimitReset":{"description":"Unix timestamp in seconds when the current window resets.","schema":{"type":"integer"}},"RetryAfter":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"responses":{"BadRequest":{"description":"Invalid request","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Unauthorized":{"description":"Authentication failed","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Forbidden":{"description":"Insufficient scope or plan entitlement","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"NotFound":{"description":"Resource not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Conflict":{"description":"Resource state or idempotency conflict","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Gone":{"description":"Resource expired","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"TooManyRequests":{"description":"Rate, concurrency, usage, or active-resource limit reached","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"InternalError":{"description":"Unexpected server failure","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"ServiceUnavailable":{"description":"A required dependent service is unavailable","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"pt_live_...","description":"Scoped API key created in the API & MCP dashboard. REST only."},"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.promptessor.com/authorize","tokenUrl":"https://auth.promptessor.com/token","scopes":{"prompts:generate":"Allow prompts:generate operations.","prompts:presets:read":"Allow prompts:presets:read operations.","prompts:presets:write":"Allow prompts:presets:write operations.","prompts:analyze":"Allow prompts:analyze operations.","prompts:optimize":"Allow prompts:optimize operations.","prompts:refine":"Allow prompts:refine operations.","prompts:reverse":"Allow prompts:reverse operations.","uploads:write":"Allow uploads:write operations.","usage:read":"Allow usage:read operations.","history:read":"Allow history:read operations.","history:manage":"Allow history:manage operations.","library:read":"Allow library:read operations.","library:write":"Allow library:write operations.","library:interact":"Allow library:interact operations.","library:publish":"Allow library:publish operations.","operations:read":"Allow operations:read operations.","operations:cancel":"Allow operations:cancel operations.","webhooks:manage":"Allow webhooks:manage operations."}}}}}}}