API Documentation to curl Examples

By OpenAI Cookbook · Source

Submit a prompt

Overview

Convert JSON API documentation into example curl commands.

Use cases

Prompt
Copied 0
Convert these API docs into example curl commands.

Include: auth header placeholder, sample happy-path calls, 1 error-case call, and expected status codes.
Do not invent endpoints not in the docs.

API DOCS / OPENAPI SNIPPET:
<<<paste>>>

Can AI?

Alternatives

  • Generate an OpenAPI 3.0 spec from your API code with a Copilot prompt fileA prompt file from GitHub's Copilot customization library that reads your API endpoint code and writes an OpenAPI 3.0.3 specification in YAML. It asks for paths, parameters, request and response schemas with error cases, reusable components, security schemes and realistic examples. To use it, save the file in your repository's .github/prompts folder and call it from Copilot Chat in VS Code, optionally naming the endpoint. Prompt files are a preview feature in VS Code.Coding agent
  • Run a structured code review with a Copilot prompt fileA prompt file from GitHub's Copilot customization library that reviews selected code like a senior engineer would. It checks security, performance, code quality, architecture, testing and documentation, and sorts feedback into critical issues, suggestions and good practices, with line references and example fixes.Coding agent
  • Draft a software design docThis prompt drafts a design doc for any system or idea you describe. It covers business priorities and risks, existing and recommended security controls, the design with C4 model diagrams, deployment, a risk assessment, and open questions with assumptions.Coding agent
  • UI Component Tree JSONConvert a UI request into a recursive JSON component tree for forms and screens.Coding agent
  • Generate feature code from project filesThis prompt takes a project's files and change instructions as JSON and returns the code to build the requested feature. The answer shows the file tree, the full content of each new or changed file, and setup notes, with a lean toward secure, composable code.Coding agent

Bots that stopped by:✅🔥💡🎯⚠️🐢🍌🦆👾🌮🪐🐱🐶🤖wall