Introduction
Start building powerful applications with easy access to the state-of-the-art AI models.
The BLACKBOX AI API provides programmatic access to a wide range of advanced generative models.
This documentation will guide you through authenticating, understanding the AI models, and making your first API calls. Get started with just a few lines of code using your preferred programming language or framework.
New to BLACKBOX AI? Check out our Authentication guide to get your API key and start making requests.
If you're on an Enterprise plan, simply replace api.blackbox.ai with enterprise.blackbox.ai in the examples below.
Quick Start
Get up and running with the BLACKBOX AI API in minutes. The examples below show you how to make your first chat completion request using different approaches.
Using Direct API Calls
You can use our interactive Chat API documentation to explore all available parameters and test requests directly.
import requests
API_KEY = "YOUR_API_KEY"
# Public api users: use "https://api.blackbox.ai/chat/completions"
API_URL = "https://enterprise.blackbox.ai/chat/completions"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
data = {
"model": "blackboxai/openai/gpt-5.5",
"messages": [
{
"role": "user",
"content": "What is async and await in JS?"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": False
}
response = requests.post(API_URL, headers=headers, json=data)
print(response.json())const API_KEY = "YOUR_API_KEY";
// Public api users: use "https://api.blackbox.ai/chat/completions"
const API_URL = "https://enterprise.blackbox.ai/chat/completions";
const data = {
"model": "blackboxai/openai/gpt-5.5",
"messages": [
{
"role": "user",
"content": "What is async and await in JS?"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": false
};
const response = await fetch(API_URL, {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
});
const responseData = await response.json();
console.log(responseData);# Public api users: use https://api.blackbox.ai/chat/completions
curl -X POST https://enterprise.blackbox.ai/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "blackboxai/openai/gpt-5.5",
"messages": [
{
"role": "user",
"content": "What is async and await in JS?"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": false
}'Using OpenAI-Compatible SDKs
Since BLACKBOX AI is compatible with the OpenAI API format, you can use existing OpenAI SDKs by simply changing the base URL:
from openai import OpenAI
# Public api users: use base_url="https://api.blackbox.ai"
client = OpenAI(
base_url="https://enterprise.blackbox.ai",
api_key="YOUR_API_KEY",
)
completion = client.chat.completions.create(
model="blackboxai/openai/gpt-5.5",
messages=[
{
"role": "user",
"content": "What is async and await in JS?"
}
]
)
print(completion.choices[0].message.content)import OpenAI from 'openai';
// Public api users: use baseURL: 'https://api.blackbox.ai'
const openai = new OpenAI({
baseURL: 'https://enterprise.blackbox.ai',
apiKey: 'YOUR_API_KEY',
});
async function main() {
const completion = await openai.chat.completions.create({
model: 'blackboxai/openai/gpt-5.5',
messages: [
{
role: 'user',
content: 'What is async and await in JS?',
},
],
});
console.log(completion.choices[0].message.content);
}
main();Which Model to Choose?
Through BLACKBOX AI API you have access to a wide range of chat, image and video generation models. For each of these models the user will be charged differently based on the tokens the user uses and size of the model.
You can have a look at the list of different models that BLACKBOX AI API supports below:
- LLM Pricing: Explore available chat completion models and pricing for conversational AI.
Key Features
- Multiple AI Models: Access to a wide variety of state-of-the-art models including GPT-4, Claude, and more
- OpenAI Compatibility: Use existing OpenAI SDKs and tools with minimal changes
- Streaming Support: Real-time response streaming for better user experience
- Tool Calling: Advanced function calling capabilities for building AI agents
- Image Generation: Create images from text descriptions
- Video Generation: Generate videos from prompts
Next Steps
Now that you've seen how easy it is to get started, explore these resources to build more advanced applications:
Learn how to securely authenticate your requests and manage API keys
Dive deep into chat completion parameters, streaming, and advanced options
Explore all available chat models and their unique capabilities
Build AI agents that can call functions and use external tools
Additional Resources
Create stunning images from text descriptions using AI models
Generate videos from prompts with our video API
Learn how to handle API errors gracefully in your applications
Master all available parameters for fine-tuning model behavior
Have questions? Check out our comprehensive API reference documentation for detailed information about all endpoints, parameters, and response formats.