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

# Generate Prompt Suggestions

> Generate Prompt Builder suggestions for a project, the same way the Prompt Builder does. Generation runs in the background: this returns as soon as it is queued, and the suggestions appear on `GET /prompts/suggestions?legacy=false` as they are produced, where they can be accepted or rejected. `topic_id`, `prompt_suggestion_id` and `segment` each narrow the run and are mutually exclusive; with an empty body every topic awaiting review is generated for again, replacing its current suggestions. The project's branding/intent split has to be configured first, with `PUT /project-profile` — generation has nothing to run against without it. Markets are optional: without them the project's own country and language are used.



## OpenAPI

````yaml https://api.peec.ai/customer/v1/openapi/json post /prompts/suggestions/generate
openapi: 3.0.3
info:
  title: Peec AI Customer API
  description: Development documentation
  version: 1.0.0
  contact:
    name: Peec AI Team
    email: support@peec.ai
servers:
  - url: https://api.peec.ai/customer/v1
security: []
paths:
  /prompts/suggestions/generate:
    post:
      tags:
        - Project
      summary: Generate Prompt Suggestions
      description: >-
        Generate Prompt Builder suggestions for a project, the same way the
        Prompt Builder does. Generation runs in the background: this returns as
        soon as it is queued, and the suggestions appear on `GET
        /prompts/suggestions?legacy=false` as they are produced, where they can
        be accepted or rejected. `topic_id`, `prompt_suggestion_id` and
        `segment` each narrow the run and are mutually exclusive; with an empty
        body every topic awaiting review is generated for again, replacing its
        current suggestions. The project's branding/intent split has to be
        configured first, with `PUT /project-profile` — generation has nothing
        to run against without it. Markets are optional: without them the
        project's own country and language are used.
      operationId: postPromptsSuggestionsGenerate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                topic_id:
                  description: >-
                    Generates for this topic alone instead of every topic
                    awaiting review, replacing the suggestions it already has.
                  example: to_e6b8cdd3-a51b-4d94-a866-28dbe6b830a6
                  type: string
                  minLength: 1
                prompt_suggestion_id:
                  description: >-
                    Replaces this one Prompt Builder suggestion, keeping its id,
                    topic and market.
                  example: pr_93f790de-5b7a-45ee-b782-61103c81f20d
                  type: string
                  minLength: 1
                segment:
                  description: >-
                    Adds suggestions for one slice of a topic, keeping the
                    suggestions it already has. Any dimension left unset is
                    filled from the project's target distribution and markets.
                  type: object
                  properties:
                    topic_id:
                      type: string
                      minLength: 1
                    branding:
                      type: string
                      enum:
                        - branded
                        - non-branded
                    intent:
                      type: string
                      enum:
                        - informational
                        - commercial
                        - transactional
                    persona_tag_id:
                      type: string
                    country:
                      description: >-
                        Must be one of the project's markets, or its own country
                        when it has none.
                      type: string
                      enum:
                        - AE
                        - AL
                        - AM
                        - AR
                        - AT
                        - AU
                        - BA
                        - BE
                        - BG
                        - BH
                        - BO
                        - BR
                        - BS
                        - BY
                        - CA
                        - CH
                        - CL
                        - CN
                        - CO
                        - CR
                        - CY
                        - CZ
                        - DE
                        - DK
                        - DO
                        - EC
                        - EE
                        - EG
                        - ES
                        - FI
                        - FR
                        - GB
                        - GE
                        - GH
                        - GR
                        - GT
                        - HK
                        - HN
                        - HR
                        - HU
                        - ID
                        - IE
                        - IL
                        - IN
                        - IQ
                        - IS
                        - IT
                        - JO
                        - JP
                        - KR
                        - KW
                        - LB
                        - LI
                        - LT
                        - LU
                        - LV
                        - MA
                        - MD
                        - ME
                        - MK
                        - MN
                        - MT
                        - MX
                        - MY
                        - NG
                        - NI
                        - NL
                        - 'NO'
                        - NZ
                        - OM
                        - PK
                        - PA
                        - PE
                        - PH
                        - PL
                        - PT
                        - PY
                        - PS
                        - QA
                        - RO
                        - RS
                        - SA
                        - SE
                        - SG
                        - SI
                        - SK
                        - SV
                        - TH
                        - TN
                        - TR
                        - TW
                        - UA
                        - US
                        - UY
                        - VE
                        - VN
                        - ZA
                        - AD
                        - AF
                        - AS
                        - AZ
                        - BB
                        - BQ
                        - CG
                        - CI
                        - CM
                        - CW
                        - DM
                        - DZ
                        - FO
                        - GF
                        - GP
                        - JM
                        - KG
                        - KH
                        - KI
                        - KZ
                        - LK
                        - LR
                        - LS
                        - MW
                        - NC
                        - PG
                        - TD
                        - TF
                        - UG
                        - VU
                        - ZW
                    count:
                      type: integer
                      minimum: 0
                      exclusiveMinimum: true
                      maximum: 9007199254740991
                  required:
                    - topic_id
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                topic_id:
                  description: >-
                    Generates for this topic alone instead of every topic
                    awaiting review, replacing the suggestions it already has.
                  example: to_e6b8cdd3-a51b-4d94-a866-28dbe6b830a6
                  type: string
                  minLength: 1
                prompt_suggestion_id:
                  description: >-
                    Replaces this one Prompt Builder suggestion, keeping its id,
                    topic and market.
                  example: pr_93f790de-5b7a-45ee-b782-61103c81f20d
                  type: string
                  minLength: 1
                segment:
                  description: >-
                    Adds suggestions for one slice of a topic, keeping the
                    suggestions it already has. Any dimension left unset is
                    filled from the project's target distribution and markets.
                  type: object
                  properties:
                    topic_id:
                      type: string
                      minLength: 1
                    branding:
                      type: string
                      enum:
                        - branded
                        - non-branded
                    intent:
                      type: string
                      enum:
                        - informational
                        - commercial
                        - transactional
                    persona_tag_id:
                      type: string
                    country:
                      description: >-
                        Must be one of the project's markets, or its own country
                        when it has none.
                      type: string
                      enum:
                        - AE
                        - AL
                        - AM
                        - AR
                        - AT
                        - AU
                        - BA
                        - BE
                        - BG
                        - BH
                        - BO
                        - BR
                        - BS
                        - BY
                        - CA
                        - CH
                        - CL
                        - CN
                        - CO
                        - CR
                        - CY
                        - CZ
                        - DE
                        - DK
                        - DO
                        - EC
                        - EE
                        - EG
                        - ES
                        - FI
                        - FR
                        - GB
                        - GE
                        - GH
                        - GR
                        - GT
                        - HK
                        - HN
                        - HR
                        - HU
                        - ID
                        - IE
                        - IL
                        - IN
                        - IQ
                        - IS
                        - IT
                        - JO
                        - JP
                        - KR
                        - KW
                        - LB
                        - LI
                        - LT
                        - LU
                        - LV
                        - MA
                        - MD
                        - ME
                        - MK
                        - MN
                        - MT
                        - MX
                        - MY
                        - NG
                        - NI
                        - NL
                        - 'NO'
                        - NZ
                        - OM
                        - PK
                        - PA
                        - PE
                        - PH
                        - PL
                        - PT
                        - PY
                        - PS
                        - QA
                        - RO
                        - RS
                        - SA
                        - SE
                        - SG
                        - SI
                        - SK
                        - SV
                        - TH
                        - TN
                        - TR
                        - TW
                        - UA
                        - US
                        - UY
                        - VE
                        - VN
                        - ZA
                        - AD
                        - AF
                        - AS
                        - AZ
                        - BB
                        - BQ
                        - CG
                        - CI
                        - CM
                        - CW
                        - DM
                        - DZ
                        - FO
                        - GF
                        - GP
                        - JM
                        - KG
                        - KH
                        - KI
                        - KZ
                        - LK
                        - LR
                        - LS
                        - MW
                        - NC
                        - PG
                        - TD
                        - TF
                        - UG
                        - VU
                        - ZW
                    count:
                      type: integer
                      minimum: 0
                      exclusiveMinimum: true
                      maximum: 9007199254740991
                  required:
                    - topic_id
          multipart/form-data:
            schema:
              type: object
              properties:
                topic_id:
                  description: >-
                    Generates for this topic alone instead of every topic
                    awaiting review, replacing the suggestions it already has.
                  example: to_e6b8cdd3-a51b-4d94-a866-28dbe6b830a6
                  type: string
                  minLength: 1
                prompt_suggestion_id:
                  description: >-
                    Replaces this one Prompt Builder suggestion, keeping its id,
                    topic and market.
                  example: pr_93f790de-5b7a-45ee-b782-61103c81f20d
                  type: string
                  minLength: 1
                segment:
                  description: >-
                    Adds suggestions for one slice of a topic, keeping the
                    suggestions it already has. Any dimension left unset is
                    filled from the project's target distribution and markets.
                  type: object
                  properties:
                    topic_id:
                      type: string
                      minLength: 1
                    branding:
                      type: string
                      enum:
                        - branded
                        - non-branded
                    intent:
                      type: string
                      enum:
                        - informational
                        - commercial
                        - transactional
                    persona_tag_id:
                      type: string
                    country:
                      description: >-
                        Must be one of the project's markets, or its own country
                        when it has none.
                      type: string
                      enum:
                        - AE
                        - AL
                        - AM
                        - AR
                        - AT
                        - AU
                        - BA
                        - BE
                        - BG
                        - BH
                        - BO
                        - BR
                        - BS
                        - BY
                        - CA
                        - CH
                        - CL
                        - CN
                        - CO
                        - CR
                        - CY
                        - CZ
                        - DE
                        - DK
                        - DO
                        - EC
                        - EE
                        - EG
                        - ES
                        - FI
                        - FR
                        - GB
                        - GE
                        - GH
                        - GR
                        - GT
                        - HK
                        - HN
                        - HR
                        - HU
                        - ID
                        - IE
                        - IL
                        - IN
                        - IQ
                        - IS
                        - IT
                        - JO
                        - JP
                        - KR
                        - KW
                        - LB
                        - LI
                        - LT
                        - LU
                        - LV
                        - MA
                        - MD
                        - ME
                        - MK
                        - MN
                        - MT
                        - MX
                        - MY
                        - NG
                        - NI
                        - NL
                        - 'NO'
                        - NZ
                        - OM
                        - PK
                        - PA
                        - PE
                        - PH
                        - PL
                        - PT
                        - PY
                        - PS
                        - QA
                        - RO
                        - RS
                        - SA
                        - SE
                        - SG
                        - SI
                        - SK
                        - SV
                        - TH
                        - TN
                        - TR
                        - TW
                        - UA
                        - US
                        - UY
                        - VE
                        - VN
                        - ZA
                        - AD
                        - AF
                        - AS
                        - AZ
                        - BB
                        - BQ
                        - CG
                        - CI
                        - CM
                        - CW
                        - DM
                        - DZ
                        - FO
                        - GF
                        - GP
                        - JM
                        - KG
                        - KH
                        - KI
                        - KZ
                        - LK
                        - LR
                        - LS
                        - MW
                        - NC
                        - PG
                        - TD
                        - TF
                        - UG
                        - VU
                        - ZW
                    count:
                      type: integer
                      minimum: 0
                      exclusiveMinimum: true
                      maximum: 9007199254740991
                  required:
                    - topic_id
      responses:
        '200':
          description: Generation queued
          content:
            application/json:
              schema:
                type: object
                properties:
                  topic_id:
                    description: >-
                      The first topic generated for. Present when the project
                      had no suggestions yet and the run produced one while this
                      request waited.
                    type: string
                description: Generation queued
        '400':
          description: Response for status 400
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '404':
          description: Response for status 404
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '429':
          description: Response for status 429
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
      security:
        - APIKeyHeader: []
        - APIKeyQuery: []
        - BearerAuth: []
components:
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    APIKeyQuery:
      type: apiKey
      in: query
      name: api_key
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````