# 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 the capital of France?"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": false
}'
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 the capital of France?"
}
],
"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);
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 the capital of France?"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": False
}
response = requests.post(API_URL, headers=headers, json=data)
print(response.json())
{
"id":"gen-...",
"created":1757140020,
"model":"blackboxai/openai/gpt-5.5",
"object":"chat.completion",
"system_fingerprint":"None",
"choices":[
{
"finish_reason":"stop",
"index":0,
"message":{
"content":"The capital of France is Paris.",
"role":"assistant",
"tool_calls":"None",
"function_call":"None"
},
"provider_specific_fields":{
"native_finish_reason":"stop"
}
}
],
"usage":{
"completion_tokens":7,
"prompt_tokens":14,
"total_tokens":21,
"completion_tokens_details":{
"accepted_prediction_tokens":"None",
"audio_tokens":"None",
"reasoning_tokens":0,
"rejected_prediction_tokens":"None"
},
"prompt_tokens_details":{
"audio_tokens":0,
"cached_tokens":0
}
},
"provider":"OpenAI"
}
Chat Completion
Create Chat Completion
Send a chat completion request. Find your API Key.
POST
/
chat
/
completions
# 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 the capital of France?"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": false
}'
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 the capital of France?"
}
],
"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);
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 the capital of France?"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": False
}
response = requests.post(API_URL, headers=headers, json=data)
print(response.json())
{
"id":"gen-...",
"created":1757140020,
"model":"blackboxai/openai/gpt-5.5",
"object":"chat.completion",
"system_fingerprint":"None",
"choices":[
{
"finish_reason":"stop",
"index":0,
"message":{
"content":"The capital of France is Paris.",
"role":"assistant",
"tool_calls":"None",
"function_call":"None"
},
"provider_specific_fields":{
"native_finish_reason":"stop"
}
}
],
"usage":{
"completion_tokens":7,
"prompt_tokens":14,
"total_tokens":21,
"completion_tokens_details":{
"accepted_prediction_tokens":"None",
"audio_tokens":"None",
"reasoning_tokens":0,
"rejected_prediction_tokens":"None"
},
"prompt_tokens_details":{
"audio_tokens":0,
"cached_tokens":0
}
},
"provider":"OpenAI"
}
Headers
On an Enterprise plan? Just use
enterprise.blackbox.ai instead of api.blackbox.ai for your endpoint.Request
string
required
The model ID to use. See the Chat Models page
array
required
Array of message objects containing the conversation history.
Show Message Object
Show Message Object
string
required
The role of the message author. One of
system, user, assistant, or tool.string | array
The content of the message. Can be a string or array of content parts for multimodal inputs.
string
An optional name for the participant. Provides the model information to differentiate between participants of the same role.
string
For tool messages, the ID of the tool call this message is responding to.
array
Alternate list of models for routing overrides.
object
Preferences for provider routing.
boolean
Enable streaming of results via Server-Sent Events.
integer
Maximum number of tokens to generate (range: [1, context_length)).
number
Sampling temperature (range: [0, 2]).
integer
Seed for deterministic outputs.
number
Top-p sampling value (range: (0, 1]).
integer
Top-k sampling value (range: [1, Infinity)).
number
Frequency penalty (range: [-2, 2]).
number
Presence penalty (range: [-2, 2]).
number
Repetition penalty (range: (0, 2]).
object
Mapping of token IDs to bias values.
integer
Number of top log probabilities to return.
number
Minimum probability threshold (range: [0, 1]).
number
Alternate top sampling parameter (range: [0, 1]).
array
Stop sequences - generation will stop if any of these strings are encountered.
array
string | object
Controls which (if any) tool is called by the model.
none- Model will not call any toolauto- Model can pick between generating a message or calling toolsrequired- Model must call one or more tools- Or specify a particular tool via
{"type": "function", "function": {"name": "function_name"}}
object
Enforce structured output format.
string
A stable identifier for your end-users. Used to help detect and prevent abuse.
Response
string
Unique identifier for the chat completion.
integer
Unix timestamp when the completion was created.
string
The model used for the completion.
string
Object type, always
chat.completion or chat.completion.chunk for streaming.string | null
System fingerprint for the model configuration.
array
Array of completion choices.
Show Choice Object
Show Choice Object
string
Reason the generation stopped. Options:
stop, length, content_filter, tool_calls, error.integer
Index of the choice in the list.
object
The generated message.
Show Message Object
Show Message Object
string | null
The generated content.
string
Role of the message author, typically
assistant.string | null
Raw reasoning text when reasoning tokens are enabled and not excluded. Contains the model’s step-by-step thinking process.
array | null
Structured reasoning information containing detailed reasoning blocks. Used for preserving reasoning context across multiple API calls.
Show Reasoning Detail Object
Show Reasoning Detail Object
string
Type of reasoning detail. Options:
reasoning.summary, reasoning.encrypted, reasoning.text.string | null
Unique identifier for the reasoning detail.
string
Format of the reasoning detail. Options:
unknown, openai-responses-v1, xai-responses-v1, anthropic-claude-v1.number
Sequential index of the reasoning detail.
string
High-level summary of reasoning process (for
reasoning.summary type).string
Raw reasoning text (for
reasoning.text type).string
Encrypted reasoning data (for
reasoning.encrypted type).string | null
Optional signature for verification (for
reasoning.text type).array | null
array | null
Annotations containing source citations and references. Available when using models with web search capabilities like
blackbox-search.Show Annotation Object
Show Annotation Object
string
Type of annotation. Currently supports
url_citation.object
Citation information for web sources.
Show URL Citation Object
Show URL Citation Object
string
The URL of the cited source.
string
The title of the web page or article.
string
Excerpt or summary of the content from the source (if available).
integer
The character index where the citation begins in the message content.
integer
The character index where the citation ends in the message content.
object | null
Deprecated function call field (use
tool_calls instead).object
Token usage information.
Show Usage Object
Show Usage Object
integer
Number of tokens in the completion.
integer
Number of tokens in the prompt.
integer
Total number of tokens used (prompt + completion).
object
string
The provider that served the request.
# 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 the capital of France?"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": false
}'
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 the capital of France?"
}
],
"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);
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 the capital of France?"
}
],
"temperature": 0.7,
"max_tokens": 256,
"stream": False
}
response = requests.post(API_URL, headers=headers, json=data)
print(response.json())
{
"id":"gen-...",
"created":1757140020,
"model":"blackboxai/openai/gpt-5.5",
"object":"chat.completion",
"system_fingerprint":"None",
"choices":[
{
"finish_reason":"stop",
"index":0,
"message":{
"content":"The capital of France is Paris.",
"role":"assistant",
"tool_calls":"None",
"function_call":"None"
},
"provider_specific_fields":{
"native_finish_reason":"stop"
}
}
],
"usage":{
"completion_tokens":7,
"prompt_tokens":14,
"total_tokens":21,
"completion_tokens_details":{
"accepted_prediction_tokens":"None",
"audio_tokens":"None",
"reasoning_tokens":0,
"rejected_prediction_tokens":"None"
},
"prompt_tokens_details":{
"audio_tokens":0,
"cached_tokens":0
}
},
"provider":"OpenAI"
}