Skip to content

Models - OpenAI - Responses API #551

@pgrayy

Description

@pgrayy

Summary

Extend the OpenAI model provider to support the Responses API, which is OpenAI's successor to the Chat Completions API. The current OpenAIModel implementation uses the Chat Completions API exclusively. The Responses API introduces built-in tool use, streaming improvements, and a simplified conversation state model. We should determine whether to add Responses API support alongside the existing Chat Completions path or as a separate provider.

Usage

⚠️ Agent-generated example - This is a preliminary API sketch and has not been finalized.

import { Agent } from '@strands-agents/sdk'
import { OpenAIModel } from '@strands-agents/openai'

const agent = new Agent({
  model: new OpenAIModel({
    modelId: 'gpt-4o',
    apiType: 'responses', // opt into Responses API
  }),
})

const result = await agent.invoke('What is the weather in Seattle?')

Documentation

N/A

Reference

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:modelsItems associated with model providers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions