API Integration Guide
Learn how to integrate Dobby AI into your applications using our comprehensive API.๐ฏ What Youโll Learn
By the end of this guide, youโll know how to:- Set up API authentication
- Send messages and receive responses
- Manage contexts and conversations
- Handle errors and rate limits
- Build applications with Dobby AI
๐ Getting Started with the API
Step 1: Get Your API Key
- Log in to your Dobby AI account at dobby.monleru.fun
- Go to your profile page
- Navigate to the โAPIโ section
- Click โGenerate New Keyโ
- Copy and store your key securely
Step 2: Test Your API Key
Test your API key with a simple request:Step 3: Understand the Response
๐ Basic API Usage
Sending Your First Message
JavaScript Example:๐ง Context Management
Creating and Using Contexts
Create a New Context:Managing Multiple Contexts
List All Contexts:๐ค Working with Different Models
Model Selection
Available Models:dobby-70b- Default custom modelgpt-4- OpenAI GPT-4gpt-3.5-turbo- OpenAI GPT-3.5 Turbo
Model Comparison
Dobby-70B:- Best for general conversation
- Good balance of speed and capability
- Optimized for coding help
- Most capable for complex reasoning
- Best for analysis and creative tasks
- Slower but more accurate
- Fastest response times
- Good for simple tasks
- Cost-effective option
๐ Credit System Integration
Checking Credit Status
Get Current Credits:๐ Error Handling
Common Error Responses
Rate Limiting:Retry Logic
Implementing Retry Logic:๐๏ธ Building Applications
Simple Chat Application
HTML Structure:Node.js Server Application
Express.js Example:๐ฑ Mobile App Integration
React Native Example
Install Dependencies:๐ง Advanced Features
Streaming Responses
Implementing Streaming:Batch Processing
Processing Multiple Messages:๐ Troubleshooting
Common Issues
API Key Issues:- Verify your API key is correct
- Check if the key has expired
- Ensure youโre using the right header format
- Implement retry logic with exponential backoff
- Monitor your request frequency
- Consider upgrading your plan
- Check your internet connection
- Verify the API endpoint is accessible
- Handle timeouts appropriately
Debugging Tips
Enable Logging:๐ Additional Resources
- API Reference - Complete API documentation
- FAQ - Common questions and answers
- Getting Started - Basic setup guide
- Context Management - Managing conversations
Ready to build with Dobby AI? Start with a simple integration and expand from there!