Use the Ads API to manage campaigns, ad groups, ads, audiences, and product feeds, and to measure advertising performance in ChatGPT. This reference describes the available endpoints, request parameters, response fields, and HTTP examples.
Start here
Section titled “Start here”- Set up your ad account and credentials using the Advertiser API overview. If you manage accounts for other advertisers, start with API Partner Setup.
- Retrieve your ad account to verify access and check its currency and time zone.
- Follow Campaign Management to create a campaign, an ad group, and an ad. For each request, see the endpoint reference for fields and examples.
- Set up conversion tracking and use Reporting to measure results.
Authentication
Section titled “Authentication”Send requests to https://api.ads.openai.com/v1. Use the credentials required by the endpoint. Ads API keys use bearer authentication and are scoped to an ad account; use the key associated with the account you want to manage.
Keep credentials on your server. Do not expose them in browser code or commit them to source control. See Authentication for request headers and supported formats, or API Partner Setup for partner access.
Work with Ads resources
Section titled “Work with Ads resources”A campaign sets the objective, budget, schedule, and targeting. Ad groups configure bidding and group related ads. Ads provide either the creative and destination or a template backed by a product feed.
- Campaigns, ad groups, and ads: create, update, and manage delivery.
- Custom audiences: manage customer lists for supported audience uses.
- Feeds and image uploads: provide product data and creative assets, respectively.
- Conversions: configure conversion sources and events and query conversion insights.
- Ad account insights and audit logs: report on performance and inspect recorded changes.
Make requests
Section titled “Make requests”Each endpoint shows its method, path, authentication requirements, parameters, response schema, and HTTP example. Most requests use JSON; check upload endpoints for their supported formats. For image URL, multipart, and account-icon examples, see Upload creative assets.
Use values appropriate to your account’s currency and time zone. Review Bidding & Budgets and Targeting before activating a campaign.
When retrying a creation request on an endpoint that supports an idempotency key, send the same request with the same key. Use a new key for a new resource. See the endpoint’s parameter descriptions for pagination and other request-specific behavior.
Troubleshoot requests
Section titled “Troubleshoot requests”Start with Troubleshooting for authentication, validation, permissions, and delivery issues. Use Audit Logs to investigate changes to account resources.