openai · OpenAI Platform Docs
Text generation
Teaches how to generate text using OpenAI models, including prompt engineering techniques, model selection strategies, message role implementation, and handling structured JSON outputs.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Text generation
Teaches how to generate text using OpenAI models, including prompt engineering techniques, model selection strategies, message role implementation, and handling structured JSON outputs.
When To Use
Use when you need to implement text generation, optimize prompt performance through engineering techniques, or select the appropriate model for specific reasoning or chat tasks.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/text-generation-workflow-guide.md | A guide covering prompt engineering, model selection, message roles, and reusable prompts for text generation using the OpenAI API. | Questions about a guide covering prompt engineering, model selection, message roles, and reusable prompts for text generation using t... |
examples/text-generation-openai-text-generation.json | A JSON object representing a text generation response containing an assistant message and content output. | Exact payloads, commands, or snippets shown in A JSON object representing a text generation response containing an assistant message and content output. |
examples/text-generation-openai-text-generation-javascript-client-request.javascript | A JavaScript code example demonstrating how to use the OpenAI client to create a text generation response with reasoning parameters. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the OpenAI client to create a text generation response with reason... |
examples/text-generation-openai-text-generation-python-client.python | A Python script demonstrating how to use the OpenAI client to generate text using the responses.create method with reasoning parameters. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to generate text using the responses.create method with re... |
examples/text-generation-openai-text-generation-curl-request.bash | A bash curl command demonstrating a text generation API request to the OpenAI platform using a specified model and reasoning effort. | Exact payloads, commands, or snippets shown in A bash curl command demonstrating a text generation API request to the OpenAI platform using a specified model and re... |
examples/text-generation-openai-text-generation-javascript-quickstart.javascript | A JavaScript code example demonstrating how to use the OpenAI client to create a text generation response with reasoning effort settings. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the OpenAI client to create a text generation response with reason... |
examples/text-generation-openai-text-generation-python-client-2.python | A Python script demonstrating how to use the OpenAI client to generate text using the responses.create method with reasoning parameters. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to generate text using the responses.create method with re... |
examples/text-generation-openai-text-generation-curl-request-2.bash | A bash curl command demonstrating a text generation API request to the OpenAI platform using a specified model and reasoning effort. | Exact payloads, commands, or snippets shown in A bash curl command demonstrating a text generation API request to the OpenAI platform using a specified model and re... |
examples/text-generation-openai-text-generation-javascript-quickstart-2.javascript | A JavaScript code example demonstrating how to use the OpenAI client to create a text generation response using a prompt ID and variables. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the OpenAI client to create a text generation response using a pro... |
examples/text-generation-openai-text-generation-python-client-3.python | A Python script demonstrating how to use the OpenAI client to generate text using a specific model and prompt variables. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to generate text using a specific model and prompt variables. |
examples/text-generation-openai-text-generation-curl-request-3.bash | A bash curl command demonstrating a text generation API request to the OpenAI platform using a model and prompt variables. | Exact payloads, commands, or snippets shown in A bash curl command demonstrating a text generation API request to the OpenAI platform using a model and prompt varia... |
examples/text-generation-openai-text-generation-javascript-upload-prompt-variable.javascript | A JavaScript example demonstrating how to upload a PDF file and reference it as a variable within a text generation prompt using the OpenAI client. | Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to upload a PDF file and reference it as a variable within a text generation p... |
examples/text-generation-openai-text-generation-python-pdf-variable-input.python | A Python script demonstrating how to upload a PDF and reference it as an input file variable within a text generation request using the OpenAI client. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to upload a PDF and reference it as an input file variable within a text generation... |
examples/text-generation-openai-text-generation-bash-curl-request.bash | A bash curl command demonstrating how to send a text generation request to the OpenAI API using a pre-uploaded file ID. | Exact payloads, commands, or snippets shown in A bash curl command demonstrating how to send a text generation request to the OpenAI API using a pre-uploaded file ID. |
What This Skill Covers
- With the OpenAI API, you can use a large language model to generate text from a prompt, as you might using ChatGPT. Models can generate almost any kind of te...
- Main sections:
Prompt engineering,Choosing models and APIs,Message roles and instruction following,Reusable prompts,Next steps.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.openai.com/api/docs/guides/text.md
