vercel / vercel/ai

Unexpected mapping of AI SDK `system` param with the OpenAI Responses API

Open
#8,331 6 comments 0 reactions 1 assignee View on GitHub

@gr2m is already working on this.

Since Aug 28, 2025.

ai/provider provider/openai support task-identify-issue-type-done
Dominant language
TypeScript
Stars
26.9k
Forks
5.2k
Avg merge
17h 48m
Merged PRs (30d)
516

Description

Description

When using the AI SDK with the OpenAI Responses API, the AI SDK maps the system param into a system message instead of the instructions field. this is different from the behavior i'd expect. since AI SDK system is so similar to the Responses API instructions, i'd expect the mapping to work.

example:

const result = streamText({
  model: client.responses("some-model"),
  system: "You are a helpful assistant.",
  messages: [{ role: "user", content: "hello, how are you?" }],
});

This is equivalent to:

openai.responses.create({
  model: "some-model"
  input: [
    { role: "system", content: "You are a helpful assistant."},
    { role: "user", content: "hello, how are you?" }],
  instructions: undefined // i'd expect this to be the system message
})

I'd expect the streamText() call to map to:

openai.responses.create({
  model: "some-model"
  input: [
    // only user message here
    { role: "user", content: "hello, how are you?" }],
  instructions: "You are a helpful assistant." // expected
})
AI SDK Version

ai: 5.0.26
@ai-sdk/openai: 5.0.22

Code of Conduct
  • I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.