Skip to content

Quick Start

1. Get Your API Key πŸ—οΈ

  1. Visit RapidAPI Hub
    Go to RapidAPI AIBoox Page and click β€œSubscribe”, choose your plan. We have free tier available.

  2. Locate Your Credentials
    After subscribing:

    1. Go to RapidAPI AIBoox Page Endpoints - Code Snippets, or My Apps
    2. In the code snippet provided, locate X-RapidAPI-Host and X-RapidAPI-Key
    3. Combine them into a single string separated by a slash (e.g., xxx.p.rapidapi.com/your_key)

2. SDK Configuration πŸ› οΈ

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", # Recommended model
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 and X-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 πŸ”„

Terminal window
# 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 [email protected]


Last updated: March 8, 2025