Create Agent Response
Generate a response for the provided input with optional web search and reasoning.
Documentation Index
Fetch the complete documentation index at: https://docs.perplexity.ai/llms.txt
Use this file to discover all available pages before exploring further.
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
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-search", "pro-search", "deep-research"). Pre-configured model with system prompt and search parameters. Required if model is not provided.
Specifies the desired output format for the model response
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
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
- FunctionCallOutputItem
Status of the response
completed, failed, in_progress, requires_action Error details if the response failed
Token usage and cost information