Skip to content
SupportLogin
Generate a model response

Generate a model response

responses.create(ResponseCreateParams**kwargs) -> ResponseCreateResponse
POST/api/v1/responses

Creates a Responses API response through the inference gateway.

ParametersExpand Collapse
x_organization_id: Optional[str]
traceparent: Optional[str]
model: str

Hosted model identifier, or stack:<slug> to call one of your inference stacks. A stack supplies its model and authorizes explicitly requested MCP/file_search tools against its configured connections and datasets.

input: Optional[Union[str, Iterable[InputUnionMember1]]]

Text input, or an ordered array of messages and items replayed from earlier responses. May be omitted when previous_response_id supplies stored conversation history.

One of the following:
str
Iterable[InputUnionMember1]
One of the following:
class InputUnionMember1ResponseInputMessageDto: …
role: Literal["user", "assistant", "system", "developer"]
One of the following:
"user"
"assistant"
"system"
"developer"
content: str
Dict[str, object]

An item replayed from an earlier response: message, reasoning, mcp_list_tools, mcp_call, mcp_approval_request, or mcp_approval_response.

instructions: Optional[str]

System-level instructions for the model.

max_output_tokens: Optional[int]

Maximum number of tokens the model may generate.

minimum1
temperature: Optional[float]

Sampling temperature.

minimum0
maximum2
stream: Optional[bool]

Whether to stream semantic response events using server-sent events.

tools: Optional[Iterable[Tool]]

Responses API tools. Catalog MCP entries are hosted by Adaption; MCP entries with server_url are called by Adaption with caller-owned authorization; file_search runs over authorized adapted datasets. With model: stack:<id>, omitted or empty tools means no tools; requested hosted MCP labels must be enabled on the stack, and file_search uses the stack dataset scope when dataset_ids is omitted. connector_id MCP tools are not supported.

One of the following:
class ToolMcpRequestToolDto: …
type: Literal["mcp"]
server_label: str

Label used to identify this MCP server in tool calls. For hosted tools, use a catalog id from GET /tools.

authorization: Optional[str]

Authorization for this request. For server_url tools, this exact value is forwarded as the Authorization header. For hosted tools, it is the connector credential used instead of the stored connection. Never stored, logged or echoed back.

server_url: Optional[str]

Caller-provided public HTTPS MCP endpoint. Adaption calls it directly.

server_description: Optional[str]

Description of a caller-provided remote MCP server.

maxLength4096
allowed_tools: Optional[ToolMcpRequestToolDtoAllowedTools]

Narrow the connector’s tools: an array of tool names, or { tool_names?, read_only? }. Every name must be a tool the connector exposes.

One of the following:
Sequence[str]
class ToolMcpRequestToolDtoAllowedToolsUnionMember1: …
tool_names: Optional[Sequence[str]]
read_only: Optional[bool]
require_approval: Optional[ToolMcpRequestToolDtoRequireApproval]

Which calls wait for your approval: ‘always’, ‘never’, or { always?, never? } tool filters. Unset uses the tool’s default_require_approval from GET /tools. A call that needs approval ends the response with an mcp_approval_request item; replay the output with an mcp_approval_response input item to continue.

One of the following:
Literal["always", "never"]
One of the following:
"always"
"never"
class ToolMcpRequestToolDtoRequireApprovalUnionMember1: …
always: Optional[ToolMcpRequestToolDtoRequireApprovalUnionMember1Always]
tool_names: Optional[Sequence[str]]
read_only: Optional[bool]
never: Optional[ToolMcpRequestToolDtoRequireApprovalUnionMember1Never]
tool_names: Optional[Sequence[str]]
read_only: Optional[bool]
class ToolFileSearchToolDto: …
type: Literal["file_search"]
dataset_ids: Optional[Sequence[str]]

Adapted dataset identifiers to search. Omit with model: stack:<id> to use the datasets configured on that stack.

class ToolType: …

Another OpenAI-compatible Responses tool forwarded to the model provider.

type: str
max_tool_calls: Optional[int]

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.

minimum1
maximum64
store: Optional[bool]

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.

previous_response_id: Optional[str]

A previously stored response whose input and output should precede this turn.

background: Optional[bool]

Background execution is incompatible with the hosted-tool loop. Only false is accepted.

tool_choice: Optional[ToolChoice]

How the model may use the attached tools. Omitted or auto, the model decides whether to search and how to word the query. none forbids tools entirely. Naming a function demands that call: use { "type": "function", "name": "file_search" } when an answer must be grounded in the attached datasets, and the response fails rather than answering unsearched.

One of the following:
Literal["auto", "none"]
One of the following:
"auto"
"none"
class ToolChoiceUnionMember1: …
type: Literal["function"]
name: str
ReturnsExpand Collapse
Dict[str, object]

Generate a model response

import os
from adaption import Adaption

client = Adaption(
    api_key=os.environ.get("ADAPTION_API_KEY"),  # This is the default and can be omitted
)
response = client.responses.create(
    model="qwen3.5-397b",
)
print(response)
{
  "foo": "bar"
}
Returns Examples
{
  "foo": "bar"
}