Dashboard

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.

The examples below use the enterprise.blackbox.ai endpoint for Enterprise plans.

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"
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";
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);
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

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';

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?

Chat completion costs depend on the model and the number of input and output tokens. Compare available chat models and their token rates on the LLM Pricing page.

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

Next Steps

Now that you've seen how easy it is to get started, explore these resources to build more advanced applications:

Additional Resources

Have questions? Check out our comprehensive API reference documentation for detailed information about all endpoints, parameters, and response formats.