Documentation
API Keys
Create, use, and revoke project API keys.
API keys authenticate SDK telemetry. Each key is scoped to one project.
1. Create a project
Projects isolate telemetry. Create one from the workspace switcher or the projects page.
2. Generate an API key
Open Configure → API Keys in the sidebar and click Create key. The raw key is shown once — copy it immediately.
3. Use the API key
Pass the key to the SDK. Never commit keys to source control.
.env
env
PROMPTLAYER_API_KEY=pl_live_your_key_here
PROMPTLAYER_PROJECT_ID=1
client.ts
typescript
const promptlayer = new PromptLayer({
apiKey: process.env.PROMPTLAYER_API_KEY!,
projectId: process.env.PROMPTLAYER_PROJECT_ID!,
})
4. Revoke an API key
Revoked keys stop accepting telemetry immediately. Revoke from the API Keys page if a key is exposed. Generate a new key and update your environment.