Skip to main content

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

  1. Log in to your Dobby AI account at dobby.monleru.fun
  2. Go to your profile page
  3. Navigate to the β€œAPI” section
  4. Click β€œGenerate New Key”
  5. 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:
Python Example:

🧠 Context Management

Creating and Using Contexts

Create a New Context:
Continue a Conversation:

Managing Multiple Contexts

List All Contexts:
Get Specific Context:

πŸ€– Working with Different Models

Model Selection

Available Models:
  • dobby-70b - Default custom model
  • gpt-4 - OpenAI GPT-4
  • gpt-3.5-turbo - OpenAI GPT-3.5 Turbo
Using Different Models:

Model Comparison

Dobby-70B:
  • Best for general conversation
  • Good balance of speed and capability
  • Optimized for coding help
GPT-4:
  • Most capable for complex reasoning
  • Best for analysis and creative tasks
  • Slower but more accurate
GPT-3.5 Turbo:
  • Fastest response times
  • Good for simple tasks
  • Cost-effective option

πŸ“Š Credit System Integration

Checking Credit Status

Get Current Credits:
Handle Credit Errors:

πŸ”„ Error Handling

Common Error Responses

Rate Limiting:
Authentication Errors:

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:
API Service:
React Component:

πŸ”§ 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
Rate Limiting:
  • Implement retry logic with exponential backoff
  • Monitor your request frequency
  • Consider upgrading your plan
Network Issues:
  • Check your internet connection
  • Verify the API endpoint is accessible
  • Handle timeouts appropriately

Debugging Tips

Enable Logging:

πŸ“š Additional Resources


Ready to build with Dobby AI? Start with a simple integration and expand from there!