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!