Skip to Content
Docs

Authentication

How API keys work, what each permission allows, and how to keep a key safe.

Send your key in the Authorization header of every call:

POST /api/v1/list_projects HTTP/1.1
Host: app.awen.ai
Authorization: Bearer awen_sk_…
Content-Type: application/json

What a key is

  • It acts as you, in one organisation. The organisation is the one you made the key in. A call cannot name another one.
  • It has permissions. You choose them when you make the key.
  • It expires. After 30 days, 90 days or 1 year, as you chose. Make a new key before it does.
  • Awen shows it once. Awen keeps only a fingerprint of it, so a lost key cannot be shown again: revoke it and make another.

Every key starts with awen_sk_ and ends with a checksum, so secret scanners can find a leaked one.

Permissions

PermissionLets the keyOperations
ReadSee your projects, conversations and files. Always on.whoami, list_*, search, fetch, download, get_turn…
WriteCreate projects, conversations and folders; add, move, rename and trash files.create_project, move_file, trash_entries…
CreateCreate with Awen. Spends the organisation's credits. Needs Write.create_with_awen, enhance, cancel_turn

A call outside the key's permissions answers 403 with the code insufficient_scope. The reference groups the operations by the permission they need.

Who can make a key

  • An active member of an organisation on a paid plan, where an Owner has not turned assistant and API access off.
  • Each member holds at most 10 live keys in an organisation. Revoking one frees its place.
  • Awen asks you to confirm it's you with a code before it makes a key.

Keep keys on a server

  • Never put a key in a web page, an app or a repository. Awen refuses every call that carries a browser's Origin header, with the code browser_not_allowed.
  • Store it as a secret of your server or your CI, and give each place its own key, so you can revoke one alone.

When a key stops working

A key answers 401 with invalid_api_key once it is revoked or expired. Awen also ends your keys when:

  • you or an Owner revoke it in Settings → Connected apps → API keys;
  • your membership is suspended, or your role changes;
  • you leave the organisation, or your account or the organisation is deleted.

A key keeps working, but its calls are refused, while the organisation's plan is unpaid or an Owner has turned access off. It works again once that changes.

On this page