Edit

Share via


Generative AI API

Advertisers, agencies, and partners who access Microsoft Advertising via API can use Copilot in Microsoft Advertising Platform's generative AI capabilities to create and optimize campaign creatives at scale.

Ad generation quickly build ads and asset groups by leveraging generative AI to generate ad copy, recommend images, and assemble video and display banner assets based on a website URL and a text prompt.

Asset generation leverages generative AI to scale production and refinement of text, image, background image, and banner assets. With Brand Kit, your assets can look and read like your brand.

See market and language availability for Generative AI tools.

Ad Generation

Copilot makes it easy to generate high volumes of custom ads and asset groups.

Performance Max

To create an asset group for a Performance Max campaign with AI-generated text and recommended images use CreateAssetGroupRecommendation.

  • A list of Final URLs (string array)
  • Optional: AdRecommendationTextTone = Cute, Friendly, Inspiring, or Persuasive
  • Optional: Prompt = Description of campaign theme, used for generating ad copy, and get image recommendations (string)

Copilot will return:

Then, use AddMedia to add image assets to an account:

  • Account ID (long)
  • An array of Media to add to the account's asset library. (Media array) You can add a maximum of 10 media in a single call.

Lastly, use AddAssetGroups to add a new one to a specified campaign or UpdateAssetGroups to update an existing asset group:

  • Campaign ID (long)
  • Array of asset groups to update for the specified campaign. (AssetGroup array) A maximum of 100 asset groups can be specified in a single call.

Responsive Search ads

To create a Responsive Search ad with AI-generated text, use CreateResponsiveSearchAdRecommendation.

  • A list of Final URLs (string array)
  • Optional: AdRecommendationTextTone = Cute, Friendly, Inspiring, or Persuasive
  • Optional: Prompt = Description of campaign theme, used for generating ad copy (string)

Copilot will return:

Lastly, use AddAds to add ads to an ad group:

  • Ad Group ID (long)
  • A list of ads to update. (Ad array) You may update or add a maximum of 50 ads.

Native ads

To create a native ad with AI-generated text and recommended images use CreateResponsiveAdRecommendation

  • A list of Final URLs (string array)
  • Optional: Brand kit ID (long)
  • Optional: AdRecommendationTextTone = Cute, Friendly, Inspiring, or Persuasive
  • Optional: Prompt = Description of campaign theme, used for generating ad copy, and get image recommendations (string)

Copilot will return:

Then, use AddMedia to add image assets to an account:

  • Account ID (long)
  • An array of Media to add to the account's asset library. (Media array) You can add a maximum of 10 media in a single call.

Lastly, use AddAds to add ads to an ad group or UpdateAds to change existing ads:

  • Ad Group ID (long)
  • A list of ads to update. (Ad array) You may update or add a maximum of 50 ads.

Display ads

To create a display ad with AI-generated text and recommended images use CreateResponsiveAdRecommendation

  • A list of Final URLs (string array)
  • AdSubType = Display
  • Optional: Brand kit ID (long)
  • Optional: AdRecommendationTextTone = Cute, Friendly, Inspiring, or Persuasive
  • Optional: Prompt = Description of campaign theme, used for generating banner assets containing ad copy and images from final URL or stock (string)

Copilot will return:

Then, use AddMedia to add image assets to an account:

  • Account ID (long)
  • An array of Media to add to the account's asset library. (Media array) You can add a maximum of 10 media in a single call.

Lastly, use AddAds to add ads to an ad group or UpdateAds to change existing ads:

  • Ad Group ID (long)
  • A list of ads to update. (Ad array) You may update or add a maximum of 50 ads.

Video ads

To create a video ad with AI-generated text and recommended videos use CreateResponsiveAdRecommendation

  • A list of Final URLs (string array)
  • AdSubType = Video
  • AdRecommendationVideoType = CTV or OLV
  • Optional: Brand kit ID (long)
  • Optional: AdRecommendationTextTone = Cute, Friendly, Inspiring, or Persuasive
  • Optional: Prompt = Description of campaign theme, used for generating videos from containing ad copy and images from final URL or stock (string)

Then, use AddVideos to add video assets to an account:

  • Account ID (long)
  • The list of videos to add to the account. (Video array) The maximum size of the list is 100 items per service request.

Lastly, use AddAds to add ads to an ad group or UpdateAds to change existing ads:

  • Ad Group ID (long)
  • A list of ads to update. (Ad array) You may update or add a maximum of 50 ads.

Asset Generation

Copilot enables you to generate and refine assets at scale.

Text generation

To generate new ad copy for your Performance Max asset group, Responsive Search ad, and Native ad, use one of these service operations:

Copilot uses your landing page URL, tone of voice (optional), and prompt (optional) to generate custom ad copy. Instructions above in Ad Generation section of this guide.

To refine your existing ad copy for your asset group or ad, use one of these service operations:

Each method takes in:

Copilot will return:

Lastly, apply changes with one of these service operations:

Background generation

Generate a new background for your existing image, using one of these service operations, to refine it within its asset group or ad:

Each method takes in:

Copilot will return:

Then, use AddMedia to add image assets to an account:

  • Account ID (long)
  • An array of Media to add to the account's asset library. (Media array) You can add a maximum of 10 media in a single call.

Lastly, apply changes to ads and asset groups with one of these service operations:

Build a new display banner asset for your display ad, use CreateResponsiveAdRecommendation.

Copilot uses your landing page URL, tone of voice (optional), and prompt (optional) to generate banner assets as you create a display ad. Instructions above in Ad Generation section of this guide.

Video generation

Build a new video asset for your Video ad, use CreateResponsiveAdRecommendation.

Copilot uses your landing page URL, tone of voice (optional), and prompt (optional) to generate video assets as you create an online video and premium streaming ad. Instructions above in Ad Generation section of this guide.

Brand Kit

Brand Kit allows users to specify a brand's fonts, logos, color palettes, and voice to be used by Copilot in ad and asset generation. There are three ways to set up a brand kit: create with a URL, manually, or with a bulk file.

To create a Brand Kit with a URL, use CreateBrandKitRecommendation

  • Account ID (long)
  • URL (string)

Copilot will return:

Lastly, use AddBrandKits to save a Brand Kit to an account.

To create a Brand Kit manually, use AddBrandKits:

To create with a bulk file via Bulk API, use Brand Kit with the following attribute fields are available in the Bulk File Schema:

Additionally, service operations related to Brand Kits:

All Service Operations, Data Objects, Value Sets

Campaign Management API

Service Operations

Data Objects

Value Sets

Bulk API

Bulk File Schema