Codex · III

API keys

API keys let you call the checkout and status endpoints from your own code, without the buy button. You only need one if you’re building your own checkout or server integration; if you’re pasting the buy button, you can skip this entirely.

When you need a key

The buy button works with no key at all — it talks to public, project-scoped endpoints. A key is for the other path: calls you make from your own server, where you create a checkout or read a transaction’s status in code. Keys live under your project’s API Keys tab.

The API Keys tab. Empty until you create your first key.

Create a key

Click Create key, give it a name you’ll recognise later — usually where it runs, like “Production server” — and click Generate key. The name is only a label for you; it doesn’t change what the key can do (a key is scoped to this project).

Name the key for where it’ll live, then generate it.

Copy it once

The key is shown once, right after you generate it. It starts with cmk_. Copy it now and store it somewhere safe — we keep only a hash, so we can’t show it to you again. Lose it and you simply create a new one and delete the old.

This is the only time the full key is shown. Copy it before you close.

Treat the key like a password. Use it only from server-side code, send it in the Authorization header as a bearer token, and never put it in a web page, a public repo, or anything that ships to a buyer’s browser. Anyone with the key can act for your project.

Use, list, and revoke

Saved keys are listed by name, a masked prefix, and the date created. You never see the full key again — the prefix is just enough to tell them apart. The trash icon revokes a key immediately: any code still using it starts getting rejected, so rotate by creating the new key first, deploying it, then deleting the old one.

Each key shows a masked prefix and a created date; the trash icon revokes it.

For what you can call with the key — creating a checkout from your own code, handling events, and polling status — see Using the API.

Ready to wire it up?

Free tier covers most sites and never asks for a card.