# Prompt engineering | OpenAI API
## 描述
Log in [Sign up](https://platform.openai.com/signup)
# Prompt engineering
Enhance results with prompt engineering strategies.
Copy page
With the OpenAI API, you can use a [large language model](https://platform.openai.com/docs/models) to generate text from a prompt, as you might using [ChatGPT](https://chatgpt.com/). Models can generate almost any kind of text response—like code, mathematical equations, structured JSON data, or human-like prose.
Here's a simple example using the [Responses ...
## 来源
- 平台: firecrawl
- 原始链接: https://platform.openai.com/docs/guides/prompt-engineering
- 类型: Text Prompt
- 质量分数: 0
## Prompt
```
Log in [Sign up](https://platform.openai.com/signup)
# Prompt engineering
Enhance results with prompt engineering strategies.
Copy page
With the OpenAI API, you can use a [large language model](https://platform.openai.com/docs/models) to generate text from a prompt, as you might using [ChatGPT](https://chatgpt.com/). Models can generate almost any kind of text response—like code, mathematical equations, structured JSON data, or human-like prose.
Here's a simple example using the [Responses API](https://platform.openai.com/docs/api-reference/responses).
Generate text from a simple prompt
javascript
```
1
2
3
4
5
6
7
8
9
import OpenAI from "openai";
const client = new OpenAI();
const response = await client.responses.create({
model: "gpt-5.2",
input: "Write a one-sentence bedtime story about a unicorn."
});
console.log(response.output_text);
```
```
1
2
3
4
5
6
7
8
9
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5.2",
...
```
---
## 标签
- AI
- Text Prompt
- prompt
- 生成
- clawdbot
---
*Skill generated by Clawdbot*