Generate a model response
Creates a Responses API response through the inference gateway.
Body ParametersJSON
Hosted model identifier, or stack/<slug> to call one of your inference stacks (stack:<slug> is still accepted). A stack supplies its model and default tools; explicitly requested MCP tools must be enabled on the stack, while file_search can name any of the caller’s authorized adapted datasets.
Use agentic memory for this request: relevant memories from earlier turns with this stack are added to the model instructions, and the turn may be used to build new memories. Omitted or null uses the stack’s agentic memory setting; requests that do not name a stack default to false.
Enable self-improvement for this request. Omitted or null uses the stack’s setting. Only stack models accept true.
Maximum number of first-party and MCP tool calls to run for this response. Once reached, the model is asked to answer without calling more tools.
Whether Adaption should retain this response for later use with previous_response_id. Adaption defaults to false, unlike OpenAI, so retention requires explicitly setting store to true. A stored response is kept for 30 days from its creation, then deleted. When an ancestor was deleted, previous_response_id still works, but the replayed history starts at the oldest response still stored. To keep the full context, resend it with previous_response_id set to null.
A previously stored response whose input and output should precede this turn.
Generate a model response
curl https://api.prod.adaptionlabs.ai/api/v1/responses \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ADAPTION_API_KEY" \
-d '{
"model": "qwen3.5-397b",
"instructions": "Answer clearly and concisely.",
"agentic_memory": true,
"self_improvement": true,
"max_output_tokens": 1024,
"temperature": 0.7,
"max_tool_calls": 8,
"tool_choice": "auto"
}'{
"id": "resp_123",
"object": "response",
"created_at": 1750000000,
"status": "completed",
"model": "qwen3.5-397b",
"output": [
{
"type": "message",
"id": "id",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Once upon a time, a unicorn drifted to sleep on a cloud.",
"refusal": "refusal",
"annotations": [
{
"foo": "bar"
}
]
}
],
"name": "get_weather",
"arguments": "{\"city\":\"Paris\"}",
"call_id": "call_123",
"server_label": "docs",
"execution": "server",
"approval_request_id": "approval_request_id",
"output": "output",
"error": "error",
"tools": [
{
"foo": "bar"
}
],
"summary": [
{
"foo": "bar"
}
],
"encrypted_content": "encrypted_content",
"queries": [
"string"
],
"action": {
"foo": "bar"
},
"results": [
{
"foo": "bar"
}
],
"session_id": "session_id",
"execution_id": "execution_id",
"language": "python",
"code": "code",
"exit_code": 0,
"stdout": "stdout",
"stderr": "stderr",
"stdout_truncated": true,
"stderr_truncated": true,
"sandbox_reused": true,
"timing": {
"foo": "bar"
}
}
],
"output_text": "Once upon a time, a unicorn drifted to sleep on a cloud.",
"error": {
"code": "server_error",
"message": "The model provider could not complete the request."
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"usage": {
"input_tokens": 36,
"output_tokens": 87,
"total_tokens": 123,
"input_tokens_details": {
"cached_tokens": "bar"
},
"output_tokens_details": {
"reasoning_tokens": "bar"
},
"cost": 0.0012
},
"previous_response_id": "previous_response_id",
"store": true,
"metadata": {
"foo": "string"
}
}Returns Examples
{
"id": "resp_123",
"object": "response",
"created_at": 1750000000,
"status": "completed",
"model": "qwen3.5-397b",
"output": [
{
"type": "message",
"id": "id",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Once upon a time, a unicorn drifted to sleep on a cloud.",
"refusal": "refusal",
"annotations": [
{
"foo": "bar"
}
]
}
],
"name": "get_weather",
"arguments": "{\"city\":\"Paris\"}",
"call_id": "call_123",
"server_label": "docs",
"execution": "server",
"approval_request_id": "approval_request_id",
"output": "output",
"error": "error",
"tools": [
{
"foo": "bar"
}
],
"summary": [
{
"foo": "bar"
}
],
"encrypted_content": "encrypted_content",
"queries": [
"string"
],
"action": {
"foo": "bar"
},
"results": [
{
"foo": "bar"
}
],
"session_id": "session_id",
"execution_id": "execution_id",
"language": "python",
"code": "code",
"exit_code": 0,
"stdout": "stdout",
"stderr": "stderr",
"stdout_truncated": true,
"stderr_truncated": true,
"sandbox_reused": true,
"timing": {
"foo": "bar"
}
}
],
"output_text": "Once upon a time, a unicorn drifted to sleep on a cloud.",
"error": {
"code": "server_error",
"message": "The model provider could not complete the request."
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"usage": {
"input_tokens": 36,
"output_tokens": 87,
"total_tokens": 123,
"input_tokens_details": {
"cached_tokens": "bar"
},
"output_tokens_details": {
"reasoning_tokens": "bar"
},
"cost": 0.0012
},
"previous_response_id": "previous_response_id",
"store": true,
"metadata": {
"foo": "string"
}
}