Skip to main content
The DeepWiki-Open API supports multiple authentication methods to secure your documentation generation service. This guide covers all authentication options, security configurations, and best practices.

Authentication Overview

DeepWiki-Open uses a multi-layered authentication approach:

Environment-Based Auth

API provider keys configured via environment variables

Authorization Mode

Optional secret code protection for wiki generation

Repository Tokens

Personal access tokens for private repository access

Request Validation

Input validation and rate limiting protection

Environment-Based Authentication

API Provider Authentication

The API automatically validates configured AI provider credentials:
string
Uses GOOGLE_API_KEY from environment automatically
Validation endpoint:
Response:

Authentication Status

Check overall authentication status:

Authorization Mode

Optional access control requiring a secret code for wiki generation.

Enabling Authorization Mode

1

Configure Environment

Set authorization environment variables:
Choose a strong, unique authorization code. This provides basic access control.
2

Restart API Server

Authorization mode requires a server restart:
Server logs should show: “Authorization mode: ENABLED”
3

Verify Configuration

Should show:

Using Authorization Mode

When authorization is enabled, all wiki generation requests must include the auth code:

Authorization Validation

Test authorization codes before use:

Repository Access Tokens

For accessing private repositories, provide personal access tokens.

Supported Platforms

Token creation:
  1. Go to GitHub Settings → Developer settings → Personal access tokens
  2. Generate new token (classic or fine-grained)
  3. Select scopes: repo (full repository access)
Token format: ghp_xxxxxxxxxxxxxxxxxxxx (classic) or github_pat_xxxx (fine-grained)Usage in requests:

Token Validation

Validate repository access tokens:

Security Best Practices

Environment Security

Secure storage:
Key rotation:
Monitoring:
HTTPS configuration:
Firewall rules:
Input sanitization:
Rate limiting:

Production Security

1

Authentication Hardening

2

Access Control

3

Monitoring & Alerting

Error Handling

Authentication Errors

Token Validation Errors

Resolution:
  1. Generate new personal access token
  2. Update request with new token
  3. Consider using longer-lived tokens for automation
Resolution:
  1. Create new token with correct scopes
  2. For GitHub: include repo scope for private repositories
  3. For GitLab: include read_repository scope

Integration Examples

Middleware Authentication

Client-Side Authentication

Next Steps

Wiki Endpoints

Learn about wiki generation and management endpoints

Security Guide

Implement comprehensive security measures

Production Setup

Deploy with proper authentication in production

Monitoring

Set up authentication monitoring and alerts