Open Responses

Configuration reference for OpenResponses, the base class for providers implementing the Open Responses API specification.

Base class for interacting with providers that implement the Open Responses API specification. This provides a foundation for multi-provider, interoperable LLM interfaces based on the OpenAI Responses API.

Providers that implement this spec include Ollama (v0.13.3+) and OpenRouter. Provider reference pages document only their own defaults and additions. These constructor parameters are inherited; each adapter and provider determines which are forwarded and supported. Check the provider reference before using structured output, background processing, or response storage.

Key Differences from OpenAI Responses

  • Configurable base_url for pointing to different API endpoints
  • Stateless by default (no previous_response_id chaining)
  • Flexible api_key handling for providers that don't require authentication

Parameters

ParameterTypeDefaultDescription
idstr"not-provided"The ID of the model to use
namestr"OpenResponses"The name of the model
providerstr"OpenResponses"The provider of the model
model_typeModelTypeModelType.MODELFunctional role of the model (e.g. MODEL, OUTPUT_MODEL, PARSER_MODEL, MEMORY_MODEL). Set by the agent during initialization
supports_native_structured_outputsboolTrueWhether the model supports native structured outputs
supports_json_schema_outputsboolFalseWhether the model requires a JSON schema for structured outputs
system_promptOptional[str]NoneSystem prompt from the model, added to the Agent
instructionsOptional[List[str]]NoneInstructions from the model, added to the Agent
tool_message_rolestr"tool"Role assigned to tool messages
assistant_message_rolestr"assistant"Role assigned to assistant messages
role_mapDict[str, str]{"system": "developer", "user": "user", "assistant": "assistant", "tool": "tool"}Mapping of message roles to provider roles
vector_store_namestr"knowledge_base"Name of the vector store used by the file search built-in tool

Request parameters

ParameterTypeDefaultDescription
includeOptional[List[str]]NoneAdditional output data to include in the response (e.g. "reasoning.encrypted_content")
max_output_tokensOptional[int]NoneMaximum number of output tokens to generate, including reasoning tokens
max_tool_callsOptional[int]NoneMaximum number of built-in tool calls during the response
metadataOptional[Dict[str, Any]]NoneDeveloper-defined metadata to associate with the response
parallel_tool_callsOptional[bool]NoneWhether the model can run tool calls in parallel
reasoningOptional[Dict[str, Any]]NoneReasoning configuration (e.g. {"enabled": True})
verbosityOptional[Verbosity]NoneVerbosity level of the model response
reasoning_effortOptional[ReasoningEffort]NoneModel-dependent reasoning effort; use values supported by the selected provider and model.
reasoning_summaryOptional[ReasoningSummary]NoneLevel of detail for reasoning summaries
storeOptional[bool]FalseWhether to store the response on the provider side. Disabled by default for compatible providers
temperatureOptional[float]NoneControls randomness in the model's output
top_pOptional[float]NoneControls diversity via nucleus sampling
truncationOptional[Literal["auto", "disabled"]]NoneTruncation strategy when the context window is exceeded
userOptional[str]NoneA unique identifier representing your end-user
service_tierOptional[ServiceTier]NoneProcessing tier for the request
strict_outputboolTrueRequests strict schema handling when a supported structured-output path is used; provider and model support still apply.
backgroundOptional[bool]NoneEnables background mode for long-running tasks. The API returns immediately and the response is polled until completion. Not supported for streaming
background_poll_intervalfloat2.0Interval in seconds between polling attempts in background mode
background_max_waitfloat600.0Maximum time in seconds to wait for a background response before cancelling it and raising an error
extra_headersOptional[Any]NoneAdditional headers to include in requests
extra_queryOptional[Any]NoneAdditional query parameters to include in requests
extra_bodyOptional[Any]NoneAdditional body parameters to include in requests
request_paramsOptional[Dict[str, Any]]NoneAdditional parameters merged into the request

Client parameters

ParameterTypeDefaultDescription
api_keyOptional[str]"not-provided"The API key for authentication
organizationOptional[str]NoneThe organization ID to use for requests
base_urlOptional[Union[str, httpx.URL]]NoneThe base URL of the Responses API endpoint
timeoutOptional[float]NoneRequest timeout in seconds
max_retriesOptional[int]NoneMaximum number of client-level retries for failed requests
default_headersOptional[Dict[str, str]]NoneDefault headers to include in all requests
default_queryOptional[Dict[str, str]]NoneDefault query parameters to include in all requests
http_clientOptional[Union[httpx.Client, httpx.AsyncClient]]NoneHTTP client instance for making requests
client_paramsOptional[Dict[str, Any]]NoneAdditional parameters for client configuration
clientOptional[OpenAI]NonePre-configured sync OpenAI client, reused across requests
async_clientOptional[AsyncOpenAI]NonePre-configured async OpenAI client, reused across requests

Caching parameters

ParameterTypeDefaultDescription
cache_responseboolFalseCache model responses to avoid redundant API calls during development
cache_ttlOptional[int]NoneTime-to-live for cached responses, in seconds. None keeps cached entries forever
cache_dirOptional[str]NoneDirectory for cached responses. Defaults to ~/.agno/cache/model_responses

Retry parameters

ParameterTypeDefaultDescription
retriesint0Number of retries to attempt before raising a ModelProviderError
delay_between_retriesint1Delay between retries, in seconds
exponential_backoffboolFalseIf True, the delay between retries is doubled each time
retry_with_guidanceboolTrueRetry a failed invocation with a guidance message appended, for known errors avoidable with extra instructions
retry_with_guidance_limitint1Maximum number of retries with guidance

Usage

For most use cases, prefer the provider-specific classes:

from agno.agent import Agent
from agno.models.openai import OpenResponses

agent = Agent(
    model=OpenResponses(
        id="your-model-id",
        base_url="https://your-provider.com/v1",
        api_key="your-api-key",
    ),
)

agent.print_response("Hello!")

The string-compatible types ReasoningEffort, ReasoningSummary, ServiceTier, and Verbosity are defined in agno.models.openai.types. Accepted API values depend on the selected model; see the provider's API reference.