AI Ad Clone API documentation
The AI Ad Clone API is a private REST API over HTTPS. Every request must carry an API key, and every response is JSON.
To start using it, get an API key, then make your first request to /status. The endpoint reference lists every endpoint and lets you try each one from this page.
| Base URL | {{BASE}} |
|---|---|
| Auth | API key in X-API-Key or Authorization: Bearer |
| Format | JSON request and response bodies, UTF-8 |
| Machine-readable spec | /openapi.json · Swagger UI · ReDoc |
Get an API key
Keys are issued by request, so we know who is calling the API and can contact you about changes. Here's the whole process:
-
Request access
Email the API owner with:
- Your name and company or project
- What you'll use the API for
- Roughly how many requests per day you expect
- Which environment the key is for (production, staging or development)
- We review your request We check the use case and reply by email, asking for more detail if we need it.
- Receive your key privately Once approved, your key is sent through a private channel such as a one-time secret link, never in a plain email body or chat message. Save it right away and treat it like a password.
- Store it on your server Put the key in an environment variable or secret manager on the server that calls the API, then make your first request to check it works.
One key per app and environment. Ask for separate keys for production and staging. You can then rotate or revoke one without touching the others.
Make your first request
Save your key as the API_KEY environment variable, then call GET /status. It does nothing except confirm that your key works.
export API_KEY="your-key-here" curl {{BASE}}/status \ -H "X-API-Key: $API_KEY"
# pip install requests import os, requests resp = requests.get( "{{BASE}}/status", headers={"X-API-Key": os.environ["API_KEY"]}, timeout=10, ) resp.raise_for_status() print(resp.json())
// Node.js 18+ (built-in fetch) const res = await fetch("{{BASE}}/status", { headers: { "X-API-Key": process.env.API_KEY }, }); if (!res.ok) throw new Error(`HTTP ${res.status}`); console.log(await res.json());
A working key returns 200 OK:
{
"message": "AI Ad Clone API is running",
"authenticated": true
}If you get 401 instead, see Errors. The most common cause is a missing header or extra spaces copied with the key.
Authentication
Send your key on every request, in either of these headers. Both work the same; use whichever your HTTP client makes easier.
| Header | Example |
|---|---|
X-API-Key | X-API-Key: 3f9a…c21e |
Authorization | Authorization: Bearer 3f9a…c21e |
What needs a key
| Path | Key needed? | What it is |
|---|---|---|
| All API endpoints | Yes | Everything listed in the endpoint reference |
/, /documentation | No | This website |
/docs, /redoc, /openapi.json | No | Interactive docs and the API spec. They describe the API but can't call it without a key. |
Keep keys on your server. Never put a key in browser JavaScript, a mobile app, a public repo or a URL query string. Anyone who can see the key can use it.
Base URL & conventions
- Base URL:
{{BASE}}. All paths in these docs are relative to it. - HTTPS only. Plain HTTP requests are redirected to HTTPS. Send your key over HTTPS from the start.
- JSON. Send request bodies as JSON with
Content-Type: application/json. Responses are JSON. - Request IDs. Every response has an
x-request-idheader. You can send your ownx-request-idto trace a call end to end; we echo it back. - Body size. Request bodies are limited to 1 MB.
Endpoint reference
This list is generated from the live API spec, so it's always current. Paste your key below to send real requests from this page.
Loading endpoints…
Errors
Errors use standard HTTP status codes. Authentication errors have this body:
{
"error": "invalid_api_key",
"message": "Invalid API key."
}| Status | Meaning | What to do |
|---|---|---|
401 | The key is missing ("Missing API key…") or not recognised ("Invalid API key.") | Check the header name, and that the key has no extra spaces or line breaks. If it was revoked, request a new one. |
404 | No such endpoint | Check the path against the endpoint reference. |
413 | Request body over 1 MB | Send a smaller body. |
422 | The request body or parameters failed validation. The body is {"detail": [...]} and lists each problem. | Fix the fields named in detail. |
5xx | Something went wrong on our side | Retry with backoff. If it continues, contact support with the x-request-id. |
Key security & rotation
Do
- Store keys in environment variables or a secret manager (AWS Secrets Manager, Doppler, 1Password and so on).
- Use a separate key for each app and environment.
- Call the API only from servers you control.
Don't
- Commit keys to git, even to private repos.
- Put keys in front-end code, mobile apps, URLs or logs.
- Share one key between teams or customers.
Rotating a key
- Ask for a new keyEmail the API owner and say which key it replaces. Your old key keeps working for now.
- Deploy the new keyUpdate your server's environment variable and deploy. Both keys work during the switch, so no requests fail.
- Confirm, then retire the old keyTell us when you've switched, and we'll revoke the old key.
Key leaked? Contact us straight away. We'll revoke it and issue a new one. Revoking a key stops it working immediately.
Support
For access requests, questions or problems, email the API owner. When reporting a problem, include:
- The
x-request-idfrom the response - The endpoint, the time (with time zone) and the status code you got
- Never your full API key. The first 4 characters are enough to identify it.