Create Agent Response
Generate a response for the provided input with optional web search and reasoning.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Input content - either a string or array of input items
System instructions for the model
ISO 639-1 language code for response language
Maximum tokens to generate. This is a shared optional Agent API request parameter, but it is required when using anthropic/* models. If omitted for an Anthropic model, the API returns HTTP 400 with: validation failed: max_output_tokens is required when using Anthropic models.
x >= 1Maximum number of research loop steps. If provided, overrides the preset's max_steps value. Must be >= 1 if specified. Maximum allowed is 10.
1 <= x <= 10Model ID in provider/model format (e.g., "openai/gpt-5", "anthropic/claude-sonnet-4-6"). If models is also provided, models takes precedence. Required if neither models nor preset is provided.
Model fallback chain. Each model is in provider/model format. Models are tried in order until one succeeds. Max 5 models allowed. If set, takes precedence over single model field. The response.model will reflect the model that actually succeeded.
1 - 5 elementsPreset configuration name (e.g., "fast", "low", "medium", "high", "xhigh"). Pre-configured model with system prompt and search parameters. Required if model is not provided.
OpenAI-compatible previous response id for multi-turn response chains. When set, the new response continues from the completed prior response's saved state. The prior response must belong to the same account and have completed.
Specifies the desired output format for the model response
OpenAI-compatible storage toggle. When false, the response is hidden from later retrieve calls, and the echoed response reports store: false. It can still be used as a previous_response_id continuation source.
If true, returns SSE stream instead of JSON
Tools available to the model
Web search tool configuration for the Responses API
- WebSearchTool
- FinanceSearchTool
- PeopleSearchTool
- FetchUrlTool
- FunctionTool
- SandboxTool
- McpTool
Response
Successful response. Content type depends on stream parameter:
stream: false(default):application/jsonwith Responsestream: true:text/event-streamwith SSE events
Non-streaming response returned when stream is false
Unix timestamp when the response was created
Unique identifier for the response
Model used for generation
Object type identifier
response Array of output items (messages, search results, tool calls)
- MessageOutputItem
- SearchResultsOutputItem
- FetchUrlResultsOutputItem
- FinanceResultsOutputItem
- PeopleSearchResultsOutputItem
- FunctionCallOutputItem
- SandboxResultsOutputItem
- McpListToolsOutputItem
- McpCallOutputItem
Status of the response
completed, failed, in_progress, requires_action Error details if the response failed
Token usage and cost information