Skip to main content
Every request to the Polyvia API is authenticated with an API key. Here’s how to create one, use it, and keep it scoped correctly.

Create a key

1

Sign in to Polyvia Platform

Go to app.polyvia.ai and sign up or log in.
2

Open the API page

Click API in the sidebar, then Create API Key, give it a name, and optionally set an expiry date.
3

Copy it once

The key is shown only once — copy it now and store it somewhere safe. All keys start with poly_.
Keep your API key secret. Never commit it to a repo or expose it in client-side code. If a key leaks, revoke it on the API page and mint a new one.

Use the key

Pass the key when you create a client:
from polyvia import Polyvia

client = Polyvia(api_key="poly_<key>")
Prefer not to hard-code it? Both SDKs also read the key from the POLYVIA_API_KEY environment variable — export POLYVIA_API_KEY=poly_<key> and you can drop the api_key / apiKey argument.

Workspace scoping

Each key is bound to one workspace at the moment you create it — your personal workspace or a specific organization — and only ever reads and writes that workspace’s data.
  • Mint a key in your personal workspace → it sees your personal documents, groups, and chats only.
  • Mint a key in an organization → it sees that org’s shared documents and groups; any teammate’s key minted in the same org reads the same data.
To work across workspaces, switch workspace and create a separate key for each.
Switching your active workspace in the UI later does not change what an existing key can access — the binding is permanent. Revoke and re-mint to change scope.

Manage & revoke

Return to the API page any time to see your keys, their names and expiry, and to delete (revoke) a key. Revocation takes effect immediately.

Start building

Have your key? Ingest your first batch and query it in a couple of minutes.