openai · OpenAI Platform Docs
Completions API
Explains how to use the legacy completions endpoint using freeform text prompts and suffixes to guide model generation, including best practices for token limits and resampling to ensure successful text insertion.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Completions API
Explains how to use the legacy completions endpoint using freeform text prompts and suffixes to guide model generation, including best practices for token limits and resampling to ensure successful text insertion.
When To Use
Use when you need to insert text into the middle of a document, function, or file by providing both a prefix and a suffix to steer the model's completion.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/completions-api-workflow-guide.md | A guide explaining the interface, input prompt structure, and differences between the legacy Completions API and the Chat Completions endpoint. | Questions about a guide explaining the interface, input prompt structure, and differences between the legacy Completions API and the... |
examples/completions-api-openai-completions-api-response.text | A sample JSON response object from the OpenAI Completions API showing text completion fields and usage statistics. | Exact payloads, commands, or snippets shown in A sample JSON response object from the OpenAI Completions API showing text completion fields and usage statistics. |
examples/completions-api-openai-completions-api-text-translation-prompt.text | A text prompt demonstrating how to use the Completions API to translate English text into French. | Exact payloads, commands, or snippets shown in A text prompt demonstrating how to use the Completions API to translate English text into French. |
examples/completions-api-openai-completions-api-text-prompt.text | A text-based prompt example demonstrating the structure of a request to the OpenAI Completions API. | Exact payloads, commands, or snippets shown in A text-based prompt example demonstrating the structure of a request to the OpenAI Completions API. |
examples/completions-api-openai-completions-api-python-quickstart.python | A Python script demonstrating how to use the OpenAI client to generate text using the completions create method. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to generate text using the completions create method. |
examples/completions-api-openai-completions-api-nodejs-quickstart.nodejs | A Node.js code example demonstrating how to use the OpenAI Completions API to generate text using the gpt-3.5-turbo-instruct model. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the OpenAI Completions API to generate text using the gpt-3.5-turbo-i... |
What This Skill Covers
- The completions API endpoint received its final update in July 2023 and has a different interface than the new Chat Completions endpoint. Instead of the inpu...
- Main sections:
Inserting text,Completions response format,Inserting text,Chat Completions vs. Completions.
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/completions.md
