Scripts, automation tools, and other applications work with a self-hosted AnythingLLM instance through its developer API instead of the browser interface. Every request those clients send must carry an API key generated in the instance settings, and AnythingLLM refuses requests that arrive without a valid key.
AnythingLLM 1.19.0 keys have no scopes or per-key permissions. Anyone holding a key can use the whole developer API, which reads and changes workspaces, documents, and chats, manages users on a multi-user instance, and deletes workspaces. Giving each integration its own named key lets you cut off one integration by deleting its key while the others keep working.
Keys are created in the AnythingLLM web interface, and a Bash shell on the Docker host can send the first authenticated request with curl. On a multi-user instance only an administrator account can create keys. The key travels as a bearer token in an HTTP header, so a client on another machine should reach AnythingLLM over HTTPS rather than plain HTTP.
Steps to create an API key in AnythingLLM:
- Open AnythingLLM's settings with the wrench icon at the bottom of the sidebar.

- Expand Tools in the settings sidebar.

- Open Developer API under Tools.
When the expanded list runs past the bottom of the window, scrolling the settings sidebar brings Developer API into view.
- Click Generate New API Key on the API Keys page.

- Enter
Reporting scriptin the Name field.
The name is optional. A name that identifies the integration using the key makes the right key easy to find when it needs to be copied again or deleted.
- Click Create API Key to generate the key.
Anyone who obtains the new key has full developer API access until the key is deleted. AnythingLLM shows the key in full in the next dialog and again on the API Keys page after that dialog closes, so anyone who can open this instance's settings can read it. Without password protection or multi-user mode, that is anyone who can reach the instance in a browser. Keep the key only in the integration that needs it, never in shared documents, chat messages, or source control.
- Copy the new key with the copy icon beside it.
A green check replaces the copy icon once the key is on the clipboard. After Close, the key stays listed in full under API Keys, where Copy API Key copies it again and the trash icon deletes it. A deleted key is refused on its next request, and deletion cannot be undone.
- Paste the copied key at a hidden
readprompt to store it in a shell variable.$ read -rs ANYTHINGLLM_API_KEY
-s keeps the pasted key off the screen and -r stores it unchanged. The prompt stays blank while you paste, and pressing Enter completes the input. The key exists only in this shell session and stays out of the shell history.
- Check that the API refuses a request without a key.
$ curl -sS -w ' %{http_code}\n' http://localhost:3001/api/v1/auth {"error":"No valid api key found."} 403/api/v1/auth reports only whether a request carries a valid key, and -w prints the HTTP status after the response body. A wrong or deleted key receives the same 403 response. For an instance on another host, its address replaces localhost:3001.
- Send an authenticated request with the new key.
$ curl -sS -w ' %{http_code}\n' -H @- \ http://localhost:3001/api/v1/auth \ <<< "Authorization: Bearer $ANYTHINGLLM_API_KEY" {"authenticated":true} 200-H @- reads the Authorization header from standard input, which keeps the key out of the process list that other users on the host can read. {"authenticated":true} with status 200 shows that AnythingLLM accepts the key. The same header authenticates the other developer API endpoints listed at http://localhost:3001/api/docs.