Skip to content

Interface: OpenAIResponsesParams

@providerprotocol/ai


@providerprotocol/ai / openai / OpenAIResponsesParams

Defined in: src/providers/openai/types.ts:287

Parameters for the OpenAI Responses API.

These parameters are passed directly to the /v1/responses endpoint. The Responses API is the modern, recommended API that supports built-in tools like web search, image generation, file search, and code interpreter.

const params: OpenAIResponsesParams = {
max_output_tokens: 1000,
temperature: 0.7,
reasoning: { effort: 'medium' }
};
import { tools } from './types';
const params: OpenAIResponsesParams = {
max_output_tokens: 2000,
tools: [tools.webSearch(), tools.imageGeneration()]
};

OpenAICompletionsParams for the legacy Chat Completions API parameters

optional background: boolean

Defined in: src/providers/openai/types.ts:330

Background processing - run response asynchronously


optional conversation: string | OpenAIConversation

Defined in: src/providers/openai/types.ts:339

Conversation context - items prepended to input_items Cannot be used with previous_response_id


optional include: string[]

Defined in: src/providers/openai/types.ts:327

Fields to include in output Supported values:

  • ‘web_search_call.action.sources’: Include web search sources
  • ‘code_interpreter_call.outputs’: Include code execution outputs
  • ‘computer_call_output.output.image_url’: Include computer call images
  • ‘file_search_call.results’: Include file search results
  • ‘message.input_image.image_url’: Include input image URLs
  • ‘message.output_text.logprobs’: Include logprobs with messages
  • ‘reasoning.encrypted_content’: Include encrypted reasoning tokens

optional max_output_tokens: number

Defined in: src/providers/openai/types.ts:289

Maximum output tokens


optional max_tool_calls: number

Defined in: src/providers/openai/types.ts:351

Maximum total calls to built-in tools in a response Applies across all built-in tool calls, not per tool


optional metadata: Record<string, string>

Defined in: src/providers/openai/types.ts:345

Metadata key-value pairs (max 16, keys max 64 chars, values max 512 chars)


optional parallel_tool_calls: boolean

Defined in: src/providers/openai/types.ts:301

Whether to enable parallel tool calls


optional previous_response_id: string

Defined in: src/providers/openai/types.ts:333

Continue from a previous response (cannot use with conversation)


optional prompt: OpenAIPromptTemplate

Defined in: src/providers/openai/types.ts:356

Reference to a prompt template and its variables


optional prompt_cache_key: string

Defined in: src/providers/openai/types.ts:362

Stable identifier for caching similar requests Used to optimize cache hit rates (replaces user field)


optional prompt_cache_retention: "in-memory" | "24h"

Defined in: src/providers/openai/types.ts:368

Retention policy for prompt cache Set to “24h” to enable extended prompt caching up to 24 hours


optional reasoning: object

Defined in: src/providers/openai/types.ts:304

Reasoning configuration (for gpt-5 and o-series models)

optional effort: "none" | "low" | "medium" | "high" | "minimal" | "xhigh"

optional summary: "auto" | "detailed" | "concise"

Include summary of reasoning


optional safety_identifier: string

Defined in: src/providers/openai/types.ts:374

Stable identifier for abuse detection Recommend hashing username or email address


optional service_tier: "default" | "priority" | "auto" | "flex" | "scale"

Defined in: src/providers/openai/types.ts:311

Service tier


optional store: boolean

Defined in: src/providers/openai/types.ts:342

Store response for continuation


optional temperature: number

Defined in: src/providers/openai/types.ts:292

Temperature for randomness (0.0 - 2.0)


optional tools: OpenAIBuiltInTool[]

Defined in: src/providers/openai/types.ts:398

Built-in tools for the Responses API Use the tool helper constructors: tools.webSearch(), tools.imageGeneration(), etc.

import { tools } from 'provider-protocol/openai';
const model = llm({
model: openai('gpt-4o'),
params: {
tools: [
tools.webSearch(),
tools.imageGeneration({ quality: 'high' }),
],
},
});

optional top_logprobs: number

Defined in: src/providers/openai/types.ts:298

Number of top logprobs to return (0-20)


optional top_p: number

Defined in: src/providers/openai/types.ts:295

Top-p (nucleus) sampling (0.0 - 1.0)


optional truncation: "auto" | "disabled"

Defined in: src/providers/openai/types.ts:314

Truncation strategy


optional user: string

Defined in: src/providers/openai/types.ts:377

User identifier (deprecated, use safety_identifier or prompt_cache_key)