openapi: 3.1.0 info: title: Memesio API Contracts agent-infra templates API version: 0.1.0 description: Contract baseline for AI jobs, trend alerts, collaboration, and billing surfaces. servers: - url: / tags: - name: templates paths: /api/ai/templates/suggest: post: summary: Rank Template Suggestions from Prompt + Trend Signals for Creative Ideation Flow tags: - templates security: - DeveloperApiKeyAuth: [] - AgentApiKeyAuth: [] - {} requestBody: required: true content: application/json: schema: type: object required: - prompt properties: prompt: type: string minLength: 1 trendSignals: type: array items: type: string maxItems: 20 limit: type: number minimum: 1 maximum: 60 responses: '200': description: Template suggestion ranking payload '400': description: Validation error /api/ai/templates/detect: post: summary: Detect Meme Template from Source Image and Return 1-2 Caption Slot Placement with Single/Split Assignment Plan tags: - templates requestBody: required: true content: application/json: schema: type: object required: - sourceImageUrl properties: sourceImageUrl: type: string texts: type: array items: type: string maxItems: 2 maxSlots: type: integer minimum: 1 maximum: 2 mappingMode: type: string enum: - single_or_split actorId: type: string workspaceId: type: string correlationId: type: string responses: '200': description: Template detection payload '400': description: Validation error '500': description: Detection failure /api/v1/templates/ideas: post: summary: Return Ranked Meme Template Ideas for a Prompt Using a Developer or Agent Key tags: - templates security: - DeveloperApiKeyAuth: [] - AgentApiKeyAuth: [] requestBody: required: true content: application/json: schema: type: object required: - prompt properties: prompt: type: string minLength: 1 trendSignals: type: array items: type: string maxItems: 20 limit: type: number minimum: 1 maximum: 60 responses: '200': description: Template idea ranking payload '400': description: Validation error '401': description: Developer or agent API key required '429': description: Rate limit exceeded components: securitySchemes: DeveloperApiKeyAuth: type: apiKey in: header name: x-developer-api-key description: 'Optional higher-rate free-tier auth. You can also send the key as Authorization: Bearer .' AgentApiKeyAuth: type: apiKey in: header name: x-agent-api-key description: 'Agent auth for free endpoints and agent-admin routes. You can also send the key as Authorization: Bearer .'