
AIBoox
Spotlights
API Overview
AIBoox - Fast & Affordable LLM API (Deepseek Chat V3 & Deepseek R1). Optimize AI costs by 50%+ with global routing to best-priced regions. OpenAI compatible API with competitive performance and 99.9% uptime.
1. Get Your API Key 🗝️
- Go to Endpoints - Code Snippets, or My Apps
- In the code snippet provided, locate
X-RapidAPI-Host
andX-RapidAPI-Key
- Combine them into a single string separated by a slash (e.g.,
xxx.p.rapidapi.com/your_key
)
2. SDK Configuration 🛠️
- Requirements:
pip install openai
- https://github.com/openai/openai-python
from openai import OpenAI
# Initialize client with your credentials
client = OpenAI(
base_url="https://llm.aiboox.com/v1", # API endpoint
api_key="xxx.p.rapidapi.com/your_rapidapi_key" # APIKey format: Host/Key
)
# Create chat completion with streaming
response = client.chat.completions.create(
model="deepseek-v3", # https://www.aiboox.com/doc/models/
messages=[{
"role": "user",
"content": "Hello!" # Your prompt
}],
stream=True # Enable real-time streaming
)
# Handle streaming response
for chunk in response:
content = chunk.choices[0].delta.content
if content:
print(content, end="")
📝 Important Notes:
We recommend avoiding use the API Code Snippets provided by RapidAPI, as they do not support streaming functionality.
Instead, utilize our dedicated API Endpoint and adhere to our API Key format, which is fully compatible with the OpenAI SDK. Here's how:
- Check RapidAPI code snippets to gather both
X-RapidAPI-Host
andX-RapidAPI-Key
. Combine them into a single string for the API key parameter. - API Endpoint:
https://llm.aiboox.com/v1
- API Key:
X-RapidAPI-Host/X-RapidAPI-Key
(e.g.,xxx.p.rapidapi.com/your_key
)
Key Features:
✅ Full OpenAI SDK compatibility
🚀 Streaming response support
🔧 Customizable parameters:
temperature
(0=strict, 1=creative)max_tokens
(response length control)top_p
(response diversity)
3. cURL Example 🔄
# Basic API Request with Streaming
curl "https://llm.aiboox.com/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxx.p.rapidapi.com/your_rapidapi_key" \
-d '{
"model": "deepseek-v3",
"messages": [{
"role": "user",
"content": "Hello!"
}],
"stream": true
}'
View Usage Analytics
To monitor your API usage, navigate to the Usage Analytics page.
Input your API key credentials to access detailed statistics, including daily token usage.
Best Practices
- Use RapidAPI code snippets to retrieve both Host and Key values
- Enable streaming for real-time responses
- Handle errors using standard OpenAI SDK patterns
Need help? Contact hi@aiboox.com