Skip to main content
POST

Headers

string
required
API Key of the from Bearer <api_key>, you can get it from here.
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.
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
Tool definitions following OpenAI’s tool calling format.
string | object
Controls which (if any) tool is called by the model.
  • none - Model will not call any tool
  • auto - Model can pick between generating a message or calling tools
  • required - 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.
object
Token usage information.
string
The provider that served the request.