openapi: 3.1.0
info:
  title: komplit API
  version: "1.0.0-preview"
  description: >
    The komplit marketing stack for AI agents. Full-stack automated marketing
    services behind one API key: brief generation, creative ideation, production,
    branded assets, and publishing. Strict JSON in and out, discovery-first,
    idempotent, metered in credits. This is a preview of the contract shape:
    the complete reference specification ships with the API launch. Live service
    and pricing discovery is always available, free, at GET /v1/tools.
  contact:
    email: hello@komplit.co
    url: https://komplit.co/agents
servers:
  - url: https://api.komplit.co/v1
paths:
  /tools:
    get:
      summary: Discover services and live credit prices. Free, no key required.
      operationId: listTools
      responses:
        "200":
          description: The service catalog with per-operation credit prices.
  /briefs:
    post:
      summary: Create a structured campaign brief from a conversation or payload. 1 credit.
      operationId: createBrief
      security: [{ apiKey: [] }]
      responses:
        "200": { description: The structured brief. }
        "402": { description: Insufficient credits, or the identity or billing challenge for new accounts. }
  /concepts:generate:
    post:
      summary: Generate campaign concepts backed by live trend and conversation research. 10 credits.
      operationId: generateConcepts
      security: [{ apiKey: [] }]
      responses:
        "200": { description: Concepts ready for production. }
  /assets:produce:
    post:
      summary: Produce images and video from an approved concept. Charged as the sum of generated media.
      operationId: produceAssets
      security: [{ apiKey: [] }]
      responses:
        "200": { description: Produced, QA-passed assets. Only delivered output is charged. }
  /brand-assets:compose:
    post:
      summary: Compose brand identity onto produced media. 2 credits per asset.
      operationId: composeBrandAssets
      security: [{ apiKey: [] }]
      responses:
        "200": { description: Brand-composed assets. }
  /publish:
    post:
      summary: Validate, schedule, and post content with configurable approval gates. 3 credits per post.
      operationId: publishContent
      security: [{ apiKey: [] }]
      responses:
        "200": { description: Publish confirmations and telemetry. }
  /snapshots:
    post:
      summary: Save or restore campaign state. 1 credit.
      operationId: snapshot
      security: [{ apiKey: [] }]
      responses:
        "200": { description: Snapshot reference or restored state. }
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >
        Your komplit API key, issued at first verified sign-up. Every charged
        response includes credits spent and credits remaining. Registration for
        agents is described at https://komplit.co/auth.md.
