Quickstart Guide
Get the WispHub API running locally in just a few steps. This guide will have you making your first API request in under 5 minutes.Prerequisites
Before you begin, ensure you have:- Docker installed on your system
- A WispHub Net API key
- Basic familiarity with REST APIs
Step 1: Configure Environment Variables
Create a.env file in your project root with your WispHub credentials:
.env
Step 2: Build the Docker Image
Clone the repository and build the Docker image:- Use Python 3.12-slim base image
- Install all dependencies from requirements.txt
- Create a non-root user for security
- Configure health checks
Step 3: Run the Container
Start the API server using Docker:http://localhost:8000
The container runs Gunicorn with 4 Uvicorn workers by default, providing async request handling and automatic worker restart on failures.
Step 4: Verify Installation
Test the health check endpoint to confirm the API is running:Step 5: Explore the API
Visit the interactive API documentation to explore all available endpoints:- Complete endpoint documentation
- Request/response schemas
- Interactive API testing
- Authentication configuration
Make Your First Request
Step 1: Obtain a JWT Token
All API endpoints (except/health) require a JWT Bearer token. Obtain one first:
Step 2: Call a Protected Endpoint
Use the token in theAuthorization header:
Example Response
Example Response
Next Steps
Now that you have the API running, explore these topics:Architecture
Learn about the caching system and middleware design
API Reference
Explore all available endpoints and schemas
Authentication
Understand API key configuration and security
Deployment
Deploy to production with advanced Docker configurations
Common Issues
Port 8000 is already in use
Port 8000 is already in use
Change the host port mapping:Access the API at
http://localhost:8001Container fails to start
Container fails to start
Check the logs:Common causes:
- Missing or invalid environment variables
- Port conflicts
- Insufficient Docker resources
API returns authentication errors
API returns authentication errors
There are two possible causes:
- 401 from the API itself: Your JWT token is missing, expired, or invalid. Obtain a new one with
POST /api/v1/auth/token. - Error communicating with WispHub Net: Verify your
WISPHUB_NET_KEYin the.envfile is correct and has the necessary permissions.
