What are Projects?
Projects are how you organize different environments or applications in PromptGuard. Each project has:- Separate API keys - Isolate credentials per environment
- Independent usage tracking - Monitor each project’s requests separately
- Dedicated security settings - Configure policies per project
- Individual analytics - View metrics for each project
Common Project Structures
By Environment
By Application
By Team
Creating Your First Project
When you sign up for PromptGuard, a “Production” project is automatically created for you. This ensures you can start using PromptGuard immediately.Creating Additional Projects
- Navigate to Projects in the dashboard
- Click “Create Project”
- Enter project details:
- Name: Descriptive name (e.g., “Staging”, “Mobile App”)
- Description: Optional context about the project
- Click “Create Project”
Creating API Keys
Each project can have multiple API keys (e.g., different services, rotating keys):- Select your project from the project selector in the header
- Navigate to API Keys
- Click “Create API Key”
- Enter details:
- Name: Descriptive name (e.g., “Backend API”, “Cron Jobs”)
- Click “Create API Key”
Switching Between Projects
Use the project selector in the dashboard header to quickly switch between projects:- Click the project name in the header
- Select a different project from the dropdown
- All pages (Analytics, API Keys, etc.) automatically update to show the selected project’s data
Project URLs
Each project has its own dedicated URLs:Viewing All Projects
Navigate to Projects in the dashboard to see all your projects at once:- Project statistics - Requests, flagged count, last activity
- Time filtering - View stats for last 7/30/90 days
- Search projects - Quickly find projects by name
- Create/delete projects - Manage your project portfolio
Deleting Projects
To delete a project:- Go to Projects page
- Click the delete icon next to the project
- Confirm deletion
- All API keys are immediately revoked
- Historical data is preserved for 30 days
- Active requests will fail
- Cannot be undone
Per-Project Token Limits
Control LLM costs by setting a maximum token count per request on any project. Requests exceeding the limit are rejected with HTTP 413 before reaching the LLM provider - saving you money on runaway prompts.Setting a Token Limit
Configure via the dashboard (Project → Settings → Token Limit) or via the database:How It Works
- PromptGuard estimates the token count of the incoming prompt using tiktoken (the same tokenizer OpenAI uses)
- If the count exceeds
max_tokens_per_request, the request is rejected immediately - The response includes the actual token count so you can adjust
Token Counting
PromptGuard usestiktoken (OpenAI’s tokenizer) for accurate counts. If tiktoken is unavailable, it falls back to a chars / 4 heuristic. Token limits apply to the full prompt text including system messages.
Best Practices
Use Separate Projects for Each Environment
Name Projects Clearly
Rotate API Keys Regularly
Use Descriptive API Key Names
Project Limits
Need more projects or API keys? Upgrade your plan or contact sales.
API Access
Developer API Endpoints: The project management endpoints below are part of the Developer API and are included in the OpenAPI spec. They use API key authentication and are suitable for SDK usage.
Complete CRUD Operations
- Python
- Node.js
- cURL
Response Formats
Create Project Response (201 Created)Session tokens are obtained via the login endpoint. See the Quickstart for details.
Troubleshooting
”Cannot create API key”
Cause: No project selected or project limit reached. Solution:- Ensure a project is selected in the project selector
- Check your plan’s project limits
- Upgrade if needed
”API key not working”
Cause: API key belongs to wrong project or was deleted. Solution:- Verify the API key is correctly set and not empty
- Check which project the key belongs to
- Ensure the key hasn’t been deleted
- Create a new key if needed
”Cannot delete project”
Cause: Trying to delete your last project. Solution: You must always have at least one project. Create a new project first, then delete the old one.Next Steps
Create API Keys
Learn how to create and manage API keys
View Analytics
Monitor your project’s security metrics
Configure Security Rules
Set up security policies for your project
Team Access
Share projects with your team