API Key Authentication
AgenticPencil uses Bearer token authentication with API keys. All API requests must include your API key in the Authorization header.API Key Format
All AgenticPencil API keys follow this format:- Prefix:
ap_ - Length: 32 characters after the prefix
- Example:
ap_1234567890abcdefghijklmnopqrstuv
How to Get Your API Key
Create Account
Sign up at platform.agenticpencil.com
Making Authenticated Requests
Include your API key in theAuthorization header with the Bearer prefix:
API Key Management
Multiple Keys
You can create multiple API keys for different use cases:Development
Use separate keys for development and testing environments
Production
Dedicated keys for your production AI agents
Team Members
Individual keys for team members with different access levels
Third-party Integrations
Separate keys for external services and integrations
Key Rotation
For security best practices, rotate your API keys regularly:- Generate a new API key
- Update your applications with the new key
- Test that everything works correctly
- Revoke the old key
Key Permissions
API keys inherit the permissions of the user who created them. Currently, all API keys have access to:- All endpoint functionality
- Credit consumption up to your plan limits
- Rate limits based on your subscription tier
Authentication Errors
Common authentication errors and how to resolve them:401 Unauthorized - Invalid API Key
401 Unauthorized - Invalid API Key
401 Unauthorized - Missing Authorization Header
401 Unauthorized - Missing Authorization Header
403 Forbidden - Expired Key
403 Forbidden - Expired Key
429 Too Many Requests - Rate Limited
429 Too Many Requests - Rate Limited
Security Best Practices
Environment Variables
Store your API key in environment variables:.env
Python
Node.js
Server-Side Only
Always make API calls from server-side code, never from:- Frontend JavaScript
- Mobile app client code
- Browser extensions
- Public-facing code
Monitor Usage
Regularly check your API usage in the dashboard to detect:- Unexpected spikes in usage
- Potential security breaches
- API key misuse