Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/completions-api-workflow-guide.mdA 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.textA 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.textA 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.textA 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.pythonA 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.nodejsA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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