Authentication
The key format, where to keep a key, per-key restrictions, rotation and what to do if a key leaks.
Authenticate API requests by sending an API key in the Authorization header:
Authorization: Bearer sk-popnow-3f9c0a…Keys in the URL query string are not accepted. Your popnow.ai website login does not authenticate API requests.
The OpenAI-compatible routes under /v1 also accept the key in an x-api-key header. The native /api/v1 routes only read Authorization.
What a key looks like
A key is sk-popnow- followed by 48 lowercase hexadecimal characters. After the initial full-key display, the API console shows only the first few characters. If you lose the key, create a new one; the full value cannot be recovered.
Create a key
- Sign in at popnow.ai and open the API console.
- Choose Create key and give it a name that identifies its environment or service, such as
production-backend. - Copy the full key immediately. It is shown only once.
You can hold several keys at once — one per environment or per service is a good habit, because you can then revoke one without touching the others. All keys on an account spend from its PopNow balance, shown in USD. A new account starts at $0; add funds in API billing.
Where to keep it
- In an environment variable or your platform's secret store (
POPNOW_API_KEY), not in source code. - Never in a browser, a mobile app or any other code that runs on someone else's device. Anyone who can read the key can spend your balance. Put your own server in between and let it call PopNow.
- Not in logs. If you log request headers, drop
Authorizationfirst.
Restrict what a key can do
Each key can carry its own limits, set in the API console:
| Restriction | What it does | Error when it blocks a request |
|---|---|---|
| Allowed models | The key can call only the models you list | 40301 |
| IP allowlist | Requests must come from these addresses or ranges | 40302 |
| Spend caps | Daily, monthly and lifetime USD limits: dailySpendCap, monthlySpendCap, totalSpendCap | 40202 |
By default a key has no restrictions and no caps. Give production keys the narrowest set that still works.
Tasks belong to the key that created them
recordInfo, retry, purge, the task list and usage are scoped to tasks created with the same key. Querying a task created with another key on your account returns 404, just like querying a task that does not exist. Tasks started on the website are not accessible through API keys. Use the API console for an account-wide view.
Rotation
To replace a key without downtime:
- Create the new key.
- Deploy it everywhere the old one was used.
- Check the console until the old key's last-used time stops updating.
- Revoke the old key.
If a key leaks
- Revoke it now in the API console. Revocation takes effect on the next request.
- Create a replacement and deploy it.
- Check what it was used for: the console's logs and usage show every task the key created.
- Tighten the replacement with an IP allowlist and a spend cap.
Contact support if you see spending you did not make.
What a failure looks like
All three authentication problems return HTTP 401 with code: 401; msg tells them apart:
msg says | What happened | What to do |
|---|---|---|
| Missing credentials | No Authorization header arrived | Check that the header is set and that the environment variable is loaded in the running process |
| API key format is not recognized | Something arrived, but it is not a PopNow key | Make sure it starts with sk-popnow-; you may have pasted a different value |
| Credentials are invalid or expired | The key does not exist, was revoked or has expired | Create a new key instead of retrying with the invalid one |
A valid key can still be refused with 403 — for example when the account's email address is not verified yet (40310). See Errors.
Overview
Explore image, video, audio and chat APIs, model IDs, asynchronous tasks, USD billing, idempotency and webhooks.
SDKs and CLI
Official open-source PopNow SDKs for Python, JavaScript, Go, PHP and Java, a CLI, the MCP stdio bridge, Agent Skills, a server-side proxy, a chat bot and the Blender, ComfyUI and n8n integrations, with install commands from PyPI, npm, Packagist, Maven Central and the Comfy Registry.

