Overview
This guide covers setting up your development environment for integrating with the SundayPyjamas AI Suite API, including local testing, documentation preview, and development best practices.This documentation can be run locally for contributions and updates.
API Development Setup
Environment Configuration
1
Get Your API Key
Generate an API key from your SundayPyjamas workspace:
- Navigate to Settings → API tab
- Click “Generate API Key”
- Save the key securely
2
Set Environment Variables
Create a
.env file in your project:3
Install Dependencies
Choose your preferred language and install required packages:
- JavaScript/Node.js
- Python
- Go
Local Documentation Development
If you want to contribute to this documentation or run it locally:1
Prerequisites
- Node.js version 19 or higher
- Git for version control
2
Install Documentation CLI
3
Clone and Preview
http://localhost:3000.Custom Ports
Testing Your Integration
Basic Connection Test
Integration Testing
Create a comprehensive test suite:Development Tools
Recommended Extensions
VS Code Extensions
- MDX extension for documentation
- Prettier for code formatting
- REST Client for API testing
- dotenv for environment variables
API Testing Tools
- Postman for interactive testing
- Insomnia for REST API testing
- HTTPie for command-line testing
- Thunder Client for VS Code
Environment Validation
Create a validation script to check your setup:Documentation Tools
Link Validation
Building for Production
Troubleshooting
API Connection Issues
API Connection Issues
Common solutions:
- Verify API key format (
spj_ai_[64-characters]) - Check environment variable loading
- Ensure HTTPS is used for API URL
- Verify workspace permissions
Documentation Build Errors
Documentation Build Errors
Common solutions:
- Update documentation CLI:
npm update -g mint - Clear cache:
rm -rf ~/.mintlify && mint dev - Check MDX syntax in files
- Validate JSON configuration
Environment Variable Issues
Environment Variable Issues
Common solutions:
- Check
.envfile location (project root) - Verify no extra spaces in variable assignments
- Ensure proper dotenv loading in code
- Check for conflicting environment variables
Next Steps
API Quickstart
Start making your first API calls with example code
Code Examples
Explore complete implementation examples
Authentication
Learn about API key management and security
Rate Limits
Understand usage optimization and monitoring