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

# Enhance a Google Ads image prompt

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Rewrites a short image prompt into a fuller one that produces better Performance Max creative.

Send the text someone typed as `raw_prompt`. Nothing is saved.

An empty or whitespace-only `raw_prompt` returns an empty `enhanced_prompt` immediately, without running a model and without spending quota. If the model fails, you get your original prompt back as `enhanced_prompt`, so compare it against `original_prompt` when you need to know whether the rewrite actually happened.

<Note>This endpoint runs a language model and draws on a shared quota of 20 requests per minute per app, which every Google Ads AI endpoint debits. Enterprise workspaces get a higher quota. A 429 means the quota is spent, not that this endpoint has its own limit.</Note>

<Note>The copy is written in the language you send in the `Accept-Language` header. Omit the header and you get English — the app's own language is not consulted — so send it explicitly for a non-English app.</Note>

<Note>This endpoint accepts a personal API key. Workspace API keys are not authorized for it and are rejected with a 403.</Note>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/google-ads/suggestions/enhance-prompt
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - ApiKeyAuth: []
paths:
  /api/apps/{app_id}/google-ads/suggestions/enhance-prompt:
    post:
      summary: Enhance a Google Ads image prompt
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Rewrites a short image prompt into a fuller one that produces better
        Performance Max creative.


        Send the text someone typed as `raw_prompt`. Nothing is saved.


        An empty or whitespace-only `raw_prompt` returns an empty
        `enhanced_prompt` immediately, without running a model and without
        spending quota. If the model fails, you get your original prompt back as
        `enhanced_prompt`, so compare it against `original_prompt` when you need
        to know whether the rewrite actually happened.


        <Note>This endpoint runs a language model and draws on a shared quota of
        20 requests per minute per app, which every Google Ads AI endpoint
        debits. Enterprise workspaces get a higher quota. A 429 means the quota
        is spent, not that this endpoint has its own limit.</Note>


        <Note>The copy is written in the language you send in the
        `Accept-Language` header. Omit the header and you get English — the
        app's own language is not consulted — so send it explicitly for a
        non-English app.</Note>


        <Note>This endpoint accepts a personal API key. Workspace API keys are
        not authorized for it and are rejected with a 403.</Note>
      operationId: >-
        enhance_prompt_api_apps__app_id__google_ads_suggestions_enhance_prompt_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app you are planning a Google Ads campaign for.
            title: App Id
          description: ID of the app you are planning a Google Ads campaign for.
          example: 6820f3a4e7b91d003c45a1f2
        - name: Accept-Language
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Language to return generated text in, as a standard
              `Accept-Language` value. An unsupported language falls back to
              English.
            title: Accept-Language
          description: >-
            Language to return generated text in, as a standard
            `Accept-Language` value. An unsupported language falls back to
            English.
          example: de
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnhancePromptRequest'
      responses:
        '200':
          description: The rewritten prompt.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAdsEnhancedPrompt'
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You don't have access to this app, the app does not exist, or you
            used a workspace API key. A missing app and an app you cannot reach
            are deliberately the same answer.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: The shared AI quota for this app is spent. Retry in a minute.
components:
  schemas:
    EnhancePromptRequest:
      properties:
        raw_prompt:
          type: string
          title: Raw Prompt
          description: >-
            The image prompt to rewrite, in the caller's own words. Empty or
            whitespace-only returns an empty result without running a model.
          default: ''
          example: oak table photo
      type: object
      title: EnhancePromptRequest
    GoogleAdsEnhancedPrompt:
      properties:
        enhanced_prompt:
          type: string
          title: Enhanced Prompt
          description: >-
            The rewritten prompt. Empty when you sent an empty or
            whitespace-only `raw_prompt`, in which case no model runs and no
            quota is spent.
          example: >-
            A warm, sunlit photograph of a handmade oak dining table in a bright
            modern kitchen, shallow depth of field, lifestyle advertising
            photography
        original_prompt:
          type: string
          title: Original Prompt
          description: The `raw_prompt` you sent, echoed back unchanged.
          example: oak table photo
      type: object
      required:
        - enhanced_prompt
        - original_prompt
      title: GoogleAdsEnhancedPrompt
      description: A rewritten image-generation prompt.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: Personal API key.

````