OpenAI API에서 재사용 가능한 프롬프트 객체는 사용 중단 예정(deprecated)입니다.
2026년 6월 3일부터 프롬프트 생성 기능의 비중이 줄어들며, v1/prompts는 2026년 11월 30일에 종료될 예정입니다.
최신 일정은 사용 중단 안내 페이지에서 확인하세요.
OpenAI API 플랫폼의 Prompts 기능에서 마이그레이션하려면 관리형 prompt 객체에 저장한 프롬프트 내용을 애플리케이션 코드로 옮기세요. 이렇게 하면 프롬프트 검토, 테스트, 배포, 버전 관리를 더 세밀하게 제어할 수 있습니다.
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
17# Replace the illustrative IDs and URLs below with your own resource values.
from openai import OpenAI
client = OpenAI()
prompt_id = "pmpt_123"
response = client.responses.create(
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
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{
Prompt: responses.ResponsePromptParam{
// Replace with your published prompt ID.
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
16
17
18
19
20
21
22
23
24
25
26
27import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.JsonValue;
import com.openai.models.responses.ResponseCreateParams;
import com.openai.models.responses.ResponsePrompt;
String promptId = "pmpt_123";
ResponseCreateParams params =
ResponseCreateParams.builder()
.prompt(
ResponsePrompt.builder()
.id(promptId)
.version("1")
.variables(
ResponsePrompt.Variables.builder()
.putAdditionalProperty("customer_name", JsonValue.from("Acme"))
.putAdditionalProperty("issue", JsonValue.from("billing question"))
.build())
.build())
.build();
client.responses().create(params).output().stream()
.flatMap(item -> item.message().stream())
.flatMap(message -> message.content().stream())
.flatMap(content -> content.outputText().stream())
.forEach(text -> System.out.println(text.text()));
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-6-astra",
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-6-astra",
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-6-astra",
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
19
20
21
22
23
24
25
26
27
28
29
30
31import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.responses.EasyInputMessage;
import com.openai.models.responses.ResponseCreateParams;
import com.openai.models.responses.ResponseInputItem;
import java.util.List;
ResponseCreateParams params =
ResponseCreateParams.builder()
.model("gpt-6-astra")
.inputOfResponse(
List.of(
ResponseInputItem.ofEasyInputMessage(
EasyInputMessage.builder()
.role(EasyInputMessage.Role.SYSTEM)
.content(
"You are a helpful support assistant. Be concise, accurate, and friendly.")
.build()),
ResponseInputItem.ofEasyInputMessage(
EasyInputMessage.builder()
.role(EasyInputMessage.Role.USER)
.content(
"Customer name: Acme. Issue: billing question. Write a response to the customer.")
.build())))
.build();
client.responses().create(params).output().stream()
.flatMap(item -> item.message().stream())
.flatMap(message -> message.content().stream())
.flatMap(content -> content.outputText().stream())
.forEach(text -> System.out.println(text.text()));
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19using OpenAI.Responses;
#pragma warning disable OPENAI001
string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;
ResponsesClient client = new(key);
ResponseResult response = await client.CreateResponseAsync(
"gpt-6-astra",
[
ResponseItem.CreateSystemMessageItem(
"You are a helpful support assistant. Be concise, accurate, and friendly."
),
ResponseItem.CreateUserMessageItem(
"Customer name: Acme. Issue: billing question. Write a response to the customer."
),
]
);
Console.WriteLine(response.GetOutputText());
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-6-astra",
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-6-astra",
"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."
}
]
}'
OpenAI Developers 플러그인과 OpenAI Docs 스킬을 사용하면 마이그레이션을 자동화하고 OpenAI API를 활용한 개발 속도를 높일 수 있습니다.
$openai-docs 프롬프트 객체를 사용하는 대신 프롬프트를 코드에 저장하도록 이 프로젝트를 수정해 주세요
API 요청에서 저장된 프롬프트 객체를 참조하는 대신 프롬프트 텍스트를 코드베이스에 저장하고, Responses API를 호출할 때 생성한 메시지를 input에 직접 전달하세요.
- 프롬프트 내용을 소스 코드로 옮기세요. 프롬프트 변경 사항도 제품 로직과 같은 검토 및 릴리스 절차를 거치게 됩니다.
- 프롬프트 변수를 함수 인자로 바꾸세요. 애플리케이션에서 동적으로 전달하는 값과 그 타입을 명시할 수 있습니다.
- 메시지를
input으로 전달하세요. Responses API를 호출할 때 prompt 객체 대신 이 방식으로 메시지를 전달합니다.
- 레포지토리에서 프롬프트 버전을 관리하세요. Git 커밋, PR 리뷰, 테스트 또는 평가를 활용하세요.
- 고정된 내용은 앞에, 요청마다 달라지는 내용은 뒤에 배치하세요. 프롬프트의 앞부분이 정확히 일치해야 캐시가 적중하므로 이 순서를 지키면 프롬프트 캐싱의 이점을 유지할 수 있습니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25import OpenAI from "openai";
const client = new OpenAI();
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-6-astra",
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-6-astra",
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-6-astra",
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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.responses.EasyInputMessage;
import com.openai.models.responses.ResponseCreateParams;
import com.openai.models.responses.ResponseInputItem;
import java.util.List;
private static List<ResponseInputItem> buildSupportPrompt(String customerName, String issue) {
return List.of(
ResponseInputItem.ofEasyInputMessage(
EasyInputMessage.builder()
.role(EasyInputMessage.Role.SYSTEM)
.content(
"You are a helpful support assistant. Be concise, accurate, and friendly. Do not invent policy details.")
.build()),
ResponseInputItem.ofEasyInputMessage(
EasyInputMessage.builder()
.role(EasyInputMessage.Role.USER)
.content(
"Customer name: "
+ customerName
+ ". Issue: "
+ issue
+ ". Write a response to the customer.")
.build()));
}
ResponseCreateParams params =
ResponseCreateParams.builder()
.model("gpt-6-astra")
.inputOfResponse(buildSupportPrompt("Acme", "billing question"))
.build();
client.responses().create(params).output().stream()
.flatMap(item -> item.message().stream())
.flatMap(message -> message.content().stream())
.flatMap(content -> content.outputText().stream())
.forEach(text -> System.out.println(text.text()));
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21using OpenAI.Responses;
#pragma warning disable OPENAI001
string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;
ResponsesClient client = new(key);
static ResponseItem[] BuildSupportPrompt(string customerName, string issue) =>
[
ResponseItem.CreateSystemMessageItem(
"You are a helpful support assistant. Be concise, accurate, and friendly. Do not invent policy details."
),
ResponseItem.CreateUserMessageItem(
$"Customer name: {customerName}. Issue: {issue}. Write a response to the customer."
),
];
ResponseResult response = await client.CreateResponseAsync(
"gpt-6-astra",
BuildSupportPrompt("Acme", "billing question")
);
Console.WriteLine(response.GetOutputText());
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-6-astra",
input: build_support_prompt("Acme", "billing question")
)
puts(response.output_text)
프롬프트를 제품 코드와 함께 관리하고 PR을 통해 변경 사항을 검토할 수 있습니다. CI에서 테스트와 평가를 실행하고 자체 설정이나 기능 플래그로 배포와 실험을 관리할 수 있어 개발팀이 전체 과정을 더 세밀하게 제어할 수 있습니다.
프롬프트를 코드베이스 곳곳에 흩어 놓지 마세요. 작은 prompts/ 모듈을 만들고 각 프롬프트를 생성하는 함수에 이름을 붙여 관리하세요. 간단한 평가용 픽스처를 추가해 프롬프트 변경 사항도 제품 로직처럼 검토하세요.