Interactions API
Build with Gemini models using the unified Interactions API format
The Interactions API (/v1/interactions) is the unified interface for calling Gemini
models — single-turn text generation, multimodal understanding, streaming, tool
orchestration, and reasoning all share one endpoint and one request shape. Unlike the
Chat Completion or Responses endpoints, it accepts the native Interactions format:
the request is passed through to the model unchanged, and you receive the native
response (or native SSE stream) back.
The Interactions API is best supported on the Enterprise plan. Use
https://enterprise.blackbox.ai as the base URL for full model availability and
production reliability.
Basic Request
The simplest request passes a string as input:
const response = await fetch('https://enterprise.blackbox.ai/v1/interactions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${process.env.BLACKBOX_API_KEY}`,
},
body: JSON.stringify({
model: 'gemini-3.8-flash',
input: 'Why do developers prefer dark mode?',
store: false,
}),
});
const result = await response.json();
console.log(result);import os
import requests
response = requests.post(
'https://enterprise.blackbox.ai/v1/interactions',
headers={
'Content-Type': 'application/json',
'Authorization': f"Bearer {os.environ['BLACKBOX_API_KEY']}",
},
json={
'model': 'gemini-3.8-flash',
'input': 'Why do developers prefer dark mode?',
'store': False,
},
)
print(response.json())curl https://enterprise.blackbox.ai/v1/interactions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $BLACKBOX_API_KEY" \
-d '{
"model": "gemini-3.8-flash",
"input": "Why do developers prefer dark mode?",
"store": false
}'Response Format
The model returns an interaction object. The visible answer lives in the steps
array as a model_output step; token usage is reported under usage.
{
"id": "eSzEati8NNGE9LsPl_298QI",
"object": "interaction",
"model": "gemini-3.8-flash",
"status": "completed",
"role": "model",
"steps": [
{ "type": "thought", "signature": "AY89a1+..." },
{
"type": "model_output",
"content": [
{ "type": "text", "text": "Contrast and eye-strain ergonomics are the main drivers." }
]
}
],
"usage": {
"total_input_tokens": 6,
"total_output_tokens": 12,
"total_thought_tokens": 65,
"total_tokens": 83
}
}Request Parameters
modelstringrequiredThe model identifier to use. Example: gemini-3.8-flash.
inputstring | arrayrequiredThe prompt. Either a plain string (single-turn) or an array of steps for multi-turn, tool results, and multimodal content. See Text Generation.
storebooleandefault: falseWhether the model persists conversation state server-side. This gateway enforces
false for Zero Data Retention.
streambooleandefault: falseStream the response as Server-Sent Events. See Streaming.
toolsarrayFunction definitions the model may call. See Tool Calling.
Response Fields
idstringUnique identifier for this interaction.
objectstringAlways interaction.
statusstringcompleted when the model finished, or requires_action when it emitted a
function call that needs a result.
stepsarrayOrdered execution steps. Common types: thought (internal reasoning),
model_output (visible text), and function_call.
usageobjectToken counts: total_input_tokens, total_output_tokens, total_thought_tokens,
and total_tokens.