Documentation Index
Fetch the complete documentation index at: https://docs.electronhub.ai/llms.txt
Use this file to discover all available pages before exploring further.
Make Your First Request
import requests
response = requests.post(
'https://api.electronhub.ai/v1/chat/completions',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'model': 'gpt-3.5-turbo',
'messages': [
{'role': 'user', 'content': 'Hello! How are you?'}
]
}
)
print(response.json()['choices'][0]['message']['content'])
Explore Different Models
Chat Models
Perfect for conversations and text generation:
- GPT-4: Most capable, best for complex tasks
- GPT-3.5-turbo: Fast and cost-effective
- Claude 3: Great for analysis and reasoning
Example: Using GPT-4
response = requests.post(
'https://api.electronhub.ai/v1/chat/completions',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'model': 'gpt-4',
'messages': [
{'role': 'user', 'content': 'Explain quantum computing in simple terms'}
]
}
)
Try Image Generation
Generate images from text descriptions:response = requests.post(
'https://api.electronhub.ai/v1/images/generations',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'prompt': 'A futuristic cityscape at sunset',
'model': 'dall-e-3',
'size': '1024x1024'
}
)
image_url = response.json()['data'][0]['url']
print(f"Generated image: {image_url}")
Text Embeddings
Convert text to vectors for semantic search:response = requests.post(
'https://api.electronhub.ai/v1/embeddings',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'input': 'Your text to embed',
'model': 'text-embedding-3-small'
}
)
embedding = response.json()['data'][0]['embedding']
Next Steps
Authentication Guide
Learn about API keys and security best practices
Rate Limits
Understand rate limits and optimization strategies
API Reference
Explore all available endpoints and parameters
Examples
See practical examples and use cases
Best Practices
Learn optimization and production tips
Contact Support
Get help from our support team
Troubleshooting
Common Issues
401 Unauthorized
- Check that your API key is correct
- Ensure you’re using the
Bearer prefix
- Verify your key hasn’t expired
429 Rate Limited
- Slow down your request rate
- Check your usage limits in the dashboard
- Consider upgrading your plan
400 Bad Request
- Verify all required parameters are included
- Check parameter types and formats
- Review the API reference for correct syntax
Need more help? Join our Discord community or check the troubleshooting guide.