> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gennia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create plan

> Creates a plan. **Side effect:** a Stripe Product + Price + Payment Link are created automatically. Provide either `packagePublicId` (existing bundle) or `content` (inline bundle, created automatically). Workspaces without Stripe Connect configured will fail here.



## OpenAPI

````yaml /api-reference/openapi.json post /public/api/v1/billing/plans
openapi: 3.1.0
info:
  contact:
    email: support@gennia.ai
    name: Gennia Support
    url: https://gennia.ai
  description: >-
    Workspace-scoped API authenticated via workspace API key (header `X-Api-Key:
    gsk_...` or `Authorization: Bearer gsk_...`).
  title: Gennia Public API
  version: v1
servers:
  - description: Production
    url: https://api.gennia.ai
security:
  - workspaceApiKey: []
tags:
  - description: Slash commands available inside the agent chat.
    name: Agent Commands
  - description: Link skills to an agent.
    name: Agent Skills
  - description: Read/rename/delete workspace knowledge sources.
    name: Knowledge Sources
  - description: Link knowledge sources to an agent.
    name: Agent Knowledge Sources
  - description: Workspace CRUD for HTTP/DB/Custom tools.
    name: HTTP Tools
  - description: Read/write the agent's model selection + capabilities.
    name: Agent Model
  - description: Discover trigger types available for Native MCP toolkits.
    name: Native MCP Triggers
  - description: Discover and toggle capability features.
    name: Agent Features
  - description: Hub access settings.
    name: Hub Access
  - description: Read conversation history and delete conversations.
    name: Conversations
  - description: Send messages to a published agent.
    name: Messages
  - description: Workspace CRUD for External MCP servers.
    name: External MCPs
  - description: Hub billing — plans, coupons, credit packages.
    name: Billing
  - description: External links shown in the hub menu.
    name: Hub External Links
  - description: Link Native MCP (Composio) instances to an agent.
    name: Agent Native MCPs
  - description: Manage AI agents in the workspace bound to the API key.
    name: Agents
  - description: Read published version snapshots and restore.
    name: Agent Versions
  - description: Read/rename/delete workspace skills.
    name: Skills
  - description: Manage hub end-customers (client workspaces).
    name: Clients
  - description: Hub domain (subdomain) management.
    name: Hub Domain
  - description: Read/write the agent's prompt context.
    name: Agent Prompt
  - description: Scheduled / trigger-based runs of an agent.
    name: Agent Automations
  - description: Link HTTP/DB/Custom tools to an agent.
    name: Agent HTTP Tools
  - description: Hub identity, branding, logos and overall configuration.
    name: Hub
  - description: Discover AI models available to this workspace.
    name: AI Models
  - description: Discover channel types and their config schemas.
    name: Channel Types
  - description: Connect agents to messaging surfaces.
    name: Agent Channels
  - description: Link workspace-registered External MCP servers to an agent.
    name: Agent External MCPs
  - description: Workspace-scoped public API (API key authentication)
    name: Public API
  - description: Dynamic-prompt variable definitions.
    name: Agent Variables
  - description: Link sub-agents as delegation targets.
    name: Agent Sub-agents
paths:
  /public/api/v1/billing/plans:
    post:
      tags:
        - Billing
      summary: Create plan
      description: >-
        Creates a plan. **Side effect:** a Stripe Product + Price + Payment Link
        are created automatically. Provide either `packagePublicId` (existing
        bundle) or `content` (inline bundle, created automatically). Workspaces
        without Stripe Connect configured will fail here.
      operationId: createPlan
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePublicPlanRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicPlanDTO'
          description: Created
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicPlanDTO'
          description: Validation failed; duplicate name; bundle/credit package issues
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicPlanDTO'
          description: Missing or invalid API key
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicPlanDTO'
          description: Stripe API failure (rollback)
      security:
        - workspaceApiKey: []
components:
  schemas:
    CreatePublicPlanRequest:
      description: >-
        Body for creating a new plan. Exactly one of packagePublicId or content
        must be provided; bodies with neither are rejected with 400.
      properties:
        billingIntervalMonths:
          description: Billing interval in months for recurring plans.
          example: 1
          format: int32
          type: integer
        billingType:
          description: Billing model (one-time or recurring).
          enum:
            - one_time
            - recurring
          type: string
        content:
          $ref: '#/components/schemas/PublicPlanContentDTO'
          description: >-
            Inline plan content definition. Mutually exclusive with
            packagePublicId.
        creditPackagePublicId:
          description: Public ID of the credit package bundled with the plan.
          example: 1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d
          format: uuid
          type: string
        currency:
          description: 3-letter ISO currency code.
          example: USD
          maxLength: 3
          minLength: 3
          type: string
        description:
          description: Short description of the plan.
          example: Best for growing teams.
          maxLength: 500
          minLength: 0
          type: string
        extraCreditsEnabled:
          description: >-
            Whether customers can purchase extra credits beyond the included
            amount. Defaults to false.
          example: false
          type: boolean
        extraCreditsPriceCents:
          description: Price of an extra credit pack in the smallest currency unit (cents).
          example: 500
          format: int32
          minimum: 1
          type: integer
        name:
          description: Display name of the plan.
          example: Pro
          maxLength: 100
          minLength: 3
          type: string
        packagePublicId:
          description: >-
            Public ID of the agent/feature package backing this plan. Mutually
            exclusive with content.
          example: 9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21
          format: uuid
          type: string
        priceCents:
          description: Plan price in the smallest currency unit (cents).
          example: 4990
          format: int32
          minimum: 0
          type: integer
        seatsIncluded:
          description: Number of workspace seats included in the plan.
          example: 5
          format: int32
          minimum: 1
          type: integer
        unlimitedCredits:
          description: Whether the plan offers unlimited credits. Defaults to false.
          example: false
          type: boolean
        visible:
          description: >-
            Whether the plan is visible in the public pricing widget. Defaults
            to true.
          example: true
          type: boolean
      required:
        - billingIntervalMonths
        - billingType
        - priceCents
        - seatsIncluded
      type: object
    PublicPlanDTO:
      properties:
        activeSubscriptions:
          format: int32
          type: integer
        billingIntervalMonths:
          format: int32
          type: integer
        billingType:
          enum:
            - one_time
            - recurring
          type: string
        checkoutUrl:
          type: string
        createdAt:
          format: date-time
          type: string
        creditPackage:
          $ref: '#/components/schemas/CreditPackageRef'
        currency:
          type: string
        description:
          type: string
        extraCreditsEnabled:
          type: boolean
        extraCreditsPriceCents:
          format: int32
          type: integer
        formattedPrice:
          type: string
        hubPackage:
          $ref: '#/components/schemas/PackageRef'
        name:
          type: string
        priceCents:
          format: int32
          type: integer
        publicId:
          format: uuid
          type: string
        seatsIncluded:
          format: int32
          type: integer
        status:
          enum:
            - active
            - inactive
          type: string
        unlimitedCredits:
          type: boolean
        visible:
          type: boolean
        widgetCtaText:
          type: string
        widgetDescription:
          type: string
        widgetFeatures:
          items:
            $ref: '#/components/schemas/WidgetFeature'
          type: array
        widgetHighlighted:
          type: boolean
        widgetTitle:
          type: string
      type: object
    PublicPlanContentDTO:
      properties:
        agents:
          items:
            $ref: '#/components/schemas/AgentConfig'
          minItems: 1
          type: array
        externalLinkPublicIds:
          items:
            format: uuid
            type: string
          type: array
        pages:
          items:
            enum:
              - home
              - dashboard
              - agents
              - workflows
              - history
              - inbox
              - users
              - settings
            type: string
          minItems: 1
          type: array
        sectionOrdering:
          items:
            $ref: '#/components/schemas/SectionConfig'
          type: array
      type: object
    CreditPackageRef:
      properties:
        creditValueCents:
          format: int32
          type: integer
        creditsAmount:
          format: int32
          type: integer
        extraCreditsAmount:
          format: int32
          type: integer
        name:
          type: string
        publicId:
          format: uuid
          type: string
        renewalIntervalMonths:
          format: int32
          type: integer
      type: object
    PackageRef:
      properties:
        name:
          type: string
        publicId:
          format: uuid
          type: string
      type: object
    WidgetFeature:
      properties:
        included:
          type: boolean
        text:
          type: string
      type: object
    AgentConfig:
      properties:
        agentPublicId:
          format: uuid
          type: string
      required:
        - agentPublicId
      type: object
    SectionConfig:
      properties:
        displayOrder:
          format: int32
          type: integer
        section:
          enum:
            - chat
            - support
          type: string
      required:
        - displayOrder
        - section
      type: object
  securitySchemes:
    workspaceApiKey:
      in: header
      name: X-Api-Key
      type: apiKey

````