Prompt Buddy logoPrompt Buddy

openai · OpenAI Platform Docs

Code generation | OpenAI API

Best practices and implementation strategies for using OpenAI models to generate functional, accurate, and secure programming code.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Code generation | OpenAI API

Best practices and implementation strategies for using OpenAI models to generate functional, accurate, and secure programming code.

When To Use

Use when you need to implement a workflow for generating code, improving code accuracy through prompting, or mitigating security risks like code injection in LLM-driven development tools.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/generation-openai-api-workflow-guide.mdA guide detailing options and methods for using OpenAI models for writing, reviewing, and editing code.Questions about a guide detailing options and methods for using OpenAI models for writing, reviewing, and editing code.
examples/generation-openai-api-openai-api-generation-nodejs.textA Node.js code snippet demonstrating how to use the OpenAI API to perform code generation tasks with reasoning effort settings.Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to use the OpenAI API to perform code generation tasks with reasoning effort...
examples/generation-openai-api-openai-api-python-generation.textA Python script demonstrating how to use the OpenAI client to perform code generation tasks with reasoning parameters.Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to perform code generation tasks with reasoning parameters.
examples/generation-openai-api-openai-api-generation-curl-request.textA curl command demonstrating a request to the OpenAI API for code generation using a model with reasoning effort.Exact payloads, commands, or snippets shown in A curl command demonstrating a request to the OpenAI API for code generation using a model with reasoning effort.

What This Skill Covers

  • Writing, reviewing, editing, and answering questions about code is one of the primary use cases for OpenAI models today. This guide walks through your option...
  • Main sections: Get started, Use Codex, Integrate with coding models, Frontend development, Next steps.

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/code-generation