Model Endpoints API
DeepWiki provides a flexible provider-based model selection system that supports multiple LLM providers. This documentation covers the model-related API endpoints and how to work with different model providers.Overview
DeepWiki’s model provider system allows you to choose from various AI model providers including:- Google - Gemini models
- OpenAI - GPT models
- OpenRouter - Access to multiple model providers through a unified API
- Azure OpenAI - Azure-hosted OpenAI models
- Ollama - Locally running open-source models
- AWS Bedrock - Amazon’s managed AI models
- DashScope - Alibaba’s AI models
Authentication
Before using any model provider, you need to configure the appropriate API keys as environment variables:Endpoints
Get Model Configuration
Retrieves the available model providers and their supported models.Response
Example Requests
cURL:Using Models in Chat Completions
The model selection is integrated into the chat completions endpoint. You specify the provider and model when making requests.Request Body
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
repo_url | string | Yes | URL of the repository to analyze |
messages | array | Yes | Array of chat messages |
provider | string | No | Model provider ID (default: “google”) |
model | string | No | Model ID for the specified provider (uses provider’s default if not specified) |
language | string | No | Language for content generation (default: “en”) |
token | string | No | Personal access token for private repositories |
type | string | No | Repository type: “github”, “gitlab”, or “bitbucket” (default: “github”) |
Example Requests
cURL with Google Gemini:Model Provider Details
Google (Gemini)
Default provider with fast and capable models. Available Models:gemini-2.0-flash
- Fast, efficient model (default)gemini-2.5-flash-preview-05-20
- Preview of upcoming flash modelgemini-2.5-pro-preview-03-25
- Preview of pro model
OpenAI
Industry-standard GPT models. Available Models:gpt-4o
- Latest GPT-4 model (default)gpt-4.1
- Updated GPT-4 versiono1
- Reasoning modelo3
- Advanced modelo4-mini
- Smaller, faster model
OpenRouter
Access multiple model providers through a unified API. Available Models:openai/gpt-4o
- OpenAI GPT-4 (default)deepseek/deepseek-r1
- DeepSeek reasoning modelanthropic/claude-3.7-sonnet
- Claude 3.7 Sonnetanthropic/claude-3.5-sonnet
- Claude 3.5 Sonnet- And many more…
Azure OpenAI
Azure-hosted OpenAI models with enterprise features. Available Models:gpt-4o
- GPT-4 on Azure (default)gpt-4
- Standard GPT-4gpt-35-turbo
- GPT-3.5 Turbogpt-4-turbo
- GPT-4 Turbo
Ollama
Run models locally for privacy and cost efficiency. Available Models:qwen3:1.7b
- Small, fast model (default)llama3:8b
- Llama 3 8B modelqwen3:8b
- Qwen 3 8B model
AWS Bedrock
Amazon’s managed AI service. Available Models:anthropic.claude-3-sonnet-20240229-v1:0
- Claude 3 Sonnet (default)anthropic.claude-3-haiku-20240307-v1:0
- Claude 3 Haikuanthropic.claude-3-opus-20240229-v1:0
- Claude 3 Opusamazon.titan-text-express-v1
- Amazon Titancohere.command-r-v1:0
- Cohere Command Rai21.j2-ultra-v1
- AI21 Jurassic
DashScope
Alibaba’s AI models. Available Models:qwen-plus
- Qwen Plus (default)qwen-turbo
- Qwen Turbodeepseek-r1
- DeepSeek R1
Custom Models
Providers that support custom models (wheresupportsCustomModel: true
) allow you to specify model IDs not listed in the predefined options. This is useful for:
- Newly released models
- Fine-tuned models
- Private or custom deployments
Error Handling
The API returns standard HTTP status codes and error messages.Common Errors
400 Bad Request:Error Handling Examples
Python:Rate Limiting
Rate limiting depends on the model provider being used:- Google Gemini: Subject to Google AI Studio quotas
- OpenAI: Based on your OpenAI tier and usage
- OpenRouter: Depends on the specific model and your OpenRouter credits
- Azure OpenAI: Based on your Azure deployment quotas
- Ollama: Limited by local hardware resources
- AWS Bedrock: Subject to AWS service quotas
- DashScope: Based on Alibaba Cloud quotas
Best Practices
-
Model Selection: Choose models based on your specific needs:
- Use faster models (e.g.,
gemini-2.0-flash
,gpt-4o-mini
) for simple queries - Use more capable models (e.g.,
gpt-4o
,claude-3.5-sonnet
) for complex analysis
- Use faster models (e.g.,
- Error Handling: Always implement proper error handling for API calls
- Streaming: The chat endpoint supports streaming responses for better user experience
- Caching: DeepWiki automatically caches wiki generation results to improve performance
- Security: Never expose API keys in client-side code; use environment variables
- Cost Optimization: Monitor usage and costs, especially with premium models
Configuration Files
DeepWiki uses JSON configuration files to manage model settings:api/config/generator.json
- Model provider configurationsapi/config/embedder.json
- Embedding model settingsapi/config/repo.json
- Repository processing settings
DEEPWIKI_CONFIG_DIR
environment variable to specify a custom configuration directory.