OpenAI is deprecating reusable prompt objects in the API. Prompt creation will
be de-emphasized beginning June 3, 2026, and v1/prompts is scheduled to shut
down on November 30, 2026. See the deprecations
page for the current
timeline.
To migrate away from Prompts in the OpenAI API platform, move the prompt content out of the managed prompt object and into your application code. This gives you more control over review, testing, deployment, and versioning.
1
2
3
4
5
6
7
8
9
10
11
12
13
14import OpenAI from "openai";
const client = new OpenAI();
const response = await client.responses.create({
prompt: {
id: "pmpt_123",
version: "1",
variables: {
customer_name: "Acme",
issue: "billing question",
},
},
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17import os
from openai import OpenAI
client = OpenAI()
prompt_id = os.environ["OPENAI_PROMPT_ID"]
response = client.responses.create(
prompt={
"prompt_id": prompt_id,
"version": "1",
"variables": {
"customer_name": "Acme",
"issue": "billing question",
},
}
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/responses"
)
func main() {
client := openai.NewClient()
response, err := client.Responses.New(context.Background(), responses.ResponseNewParams{
Prompt: responses.ResponsePromptParam{
ID: "pmpt_123",
Version: openai.String("1"),
Variables: map[string]responses.ResponsePromptVariableUnionParam{
"customer_name": {OfString: openai.String("Acme")},
"issue": {OfString: openai.String("billing question")},
},
},
})
if err != nil {
panic(err)
}
fmt.Println(response.OutputText())
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16require "openai"
client = OpenAI::Client.new
response = client.responses.create(
prompt: {
id: "pmpt_123",
version: "1",
variables: {
customer_name: "Acme",
issue: "billing question"
}
}
)
puts(response.output_text)
1
2
3
4
5
6
7
8
9
10
11
12
13curl https://api.openai.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"prompt": {
"prompt_id": "pmpt_123",
"version": "1",
"variables": {
"customer_name": "Acme",
"issue": "billing question"
}
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21import OpenAI from "openai";
const client = new OpenAI();
const response = await client.responses.create({
model: "gpt-5.6",
input: [
{
role: "system",
content:
"You are a helpful support assistant. Be concise, accurate, and friendly.",
},
{
role: "user",
content:
"Customer name: Acme. Issue: billing question. Write a response to the customer.",
},
],
});
console.log(response.output_text);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5.6",
input=[
{
"role": "system",
"content": "You are a helpful support assistant. Be concise, accurate, and friendly.",
},
{
"role": "user",
"content": "Customer name: Acme. Issue: billing question. Write a response to the customer.",
},
],
)
print(response.output_text)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/responses"
)
func main() {
client := openai.NewClient()
response, err := client.Responses.New(context.Background(), responses.ResponseNewParams{
Model: "gpt-5.6",
Input: responses.ResponseNewParamsInputUnion{OfInputItemList: responses.ResponseInputParam{
responses.ResponseInputItemParamOfMessage("You are a helpful support assistant. Be concise, accurate, and friendly.", responses.EasyInputMessageRoleSystem),
responses.ResponseInputItemParamOfMessage("Customer name: Acme. Issue: billing question. Write a response to the customer.", responses.EasyInputMessageRoleUser),
}},
})
if err != nil {
panic(err)
}
fmt.Println(response.OutputText())
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19require "openai"
client = OpenAI::Client.new
response = client.responses.create(
model: "gpt-5.6",
input: [
{
role: :system,
content: "You are a helpful support assistant. Be concise, accurate, and friendly."
},
{
role: :user,
content: "Customer name: Acme. Issue: billing question. Write a response to the customer."
}
]
)
puts(response.output_text)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16curl https://api.openai.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-5.6",
"input": [
{
"role": "system",
"content": "You are a helpful support assistant. Be concise, accurate, and friendly."
},
{
"role": "user",
"content": "Customer name: Acme. Issue: billing question. Write a response to the customer."
}
]
}'
Use the OpenAI Developers plugin and OpenAI Docs skill to automate your migration and accelerate building with the OpenAI API.
$openai-docs update this project to store prompts in code instead of using a prompts object
Instead of referencing a saved prompt object from an API request, store the prompt text in your codebase and pass the generated messages directly as input in the Responses API call.
- Move prompt content into source code so prompt changes go through the same review and release process as product logic.
- Replace prompt variables with function arguments so dynamic values are explicit and typed in your application.
- Pass messages through
input in the Responses API call instead of using the prompt object.
- Move versioning to your repo using git commits, PR review, and tests or evals.
- Keep static content first and dynamic content later to preserve prompt caching benefits, since cache hits depend on exact prefix matches.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26import OpenAI from "openai";
const client = new OpenAI();
/** @returns {OpenAI.Responses.ResponseInput} */
function buildSupportPrompt({ customerName, issue }) {
return [
{
role: "system",
content:
"You are a helpful support assistant. Be concise, accurate, and friendly. Do not invent policy details.",
},
{
role: "user",
content: `Customer name: ${customerName}. Issue: ${issue}. Write a response to the customer.`,
},
];
}
const response = await client.responses.create({
model: "gpt-5.6",
input: buildSupportPrompt({
customerName: "Acme",
issue: "billing question",
}),
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25from openai import OpenAI
client = OpenAI()
def build_support_prompt(customer_name, issue):
return [
{
"role": "system",
"content": "You are a helpful support assistant. Be concise, accurate, and friendly. Do not invent policy details.",
},
{
"role": "user",
"content": f"Customer name: {customer_name}. Issue: {issue}. Write a response to the customer.",
},
]
response = client.responses.create(
model="gpt-5.6",
input=build_support_prompt(
customer_name="Acme",
issue="billing question",
),
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/responses"
)
func main() {
client := openai.NewClient()
response, err := client.Responses.New(context.Background(), responses.ResponseNewParams{
Model: "gpt-5.6",
Input: responses.ResponseNewParamsInputUnion{OfInputItemList: buildSupportPrompt("Acme", "billing question")},
})
if err != nil {
panic(err)
}
fmt.Println(response.OutputText())
}
func buildSupportPrompt(customerName string, issue string) responses.ResponseInputParam {
return responses.ResponseInputParam{
responses.ResponseInputItemParamOfMessage("You are a helpful support assistant. Be concise, accurate, and friendly. Do not invent policy details.", responses.EasyInputMessageRoleSystem),
responses.ResponseInputItemParamOfMessage(fmt.Sprintf("Customer name: %s. Issue: %s. Write a response to the customer.", customerName, issue), responses.EasyInputMessageRoleUser),
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23require "openai"
def build_support_prompt(customer_name, issue)
[
{
role: :system,
content: "You are a helpful support assistant. Be concise, accurate, and friendly. Do not invent policy details."
},
{
role: :user,
content: "Customer name: #{customer_name}. Issue: #{issue}. Write a response to the customer."
}
]
end
client = OpenAI::Client.new
response = client.responses.create(
model: "gpt-5.6",
input: build_support_prompt("Acme", "billing question")
)
puts(response.output_text)
You get tighter engineering control: prompts live with the product code, changes go through PRs, tests and evals can run in CI, and rollout or experimentation can be managed through your own config or feature flags.
Don’t scatter prompts inline across the codebase. Create a small prompts/ module, keep each prompt as a named builder function, and add lightweight eval fixtures so prompt changes are reviewed like product logic.