Create an API key
Create a scoped key for a script, a CI job or an agent, and rotate or revoke it when you need to.
All pages
- Open API keys in your account and choose Create a key.
- Confirm it's you: type your Current password and choose Confirm.
- If you sign in with a link and have no password, choose Email me a confirmation link and open it in the same browser.
Creating, rotating and revoking a key all ask for this, and a key can never pass it.
- Type a Key name that reminds you where the key runs, up to 80 characters.
- Under What it can reach, pick what the key may do:
- Read only: everything your account can read or list, and nothing that changes state.
- Ghaym Cloud only: every action on Ghaym Cloud resources, and nothing outside them.
- Full access: everything your account can do.
- Write my own: one scope per line, shaped
app:resource:action, where any part can be*. API keys and scopes explains them.
- Under How long it lives, pick Until revoked, 30 days, 90 days or 1 year, and choose Create the key.
- This is the only time the secret is shown: Ghaym keeps only its hash. Choose Copy the secret, put it where the key runs, then choose I've stored it.
The secret starts with
ghk_.
To use the key from a terminal, CI or an agent, sign the CLI in with it.
Every key on the page shows when it was Created, Last used, and when it Expires. A revoked or expired key stays on the list, marked Revoked or Expired.
- Rotate gives the key a new secret and keeps its name, scopes and expiry. The old secret keeps working for a short while, and the page says until when, so you can move the new one into place first.
- Revoke stops the key immediately: anything still carrying its secret fails from that moment. Revoke a key as soon as you think it leaked.