The Wayback Machine - https://web.archive.org/web/20230326223440/http://github.com/openai/openai-openapi
Skip to content

openai/openai-openapi

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
January 19, 2022 09:44
January 19, 2022 09:44
January 19, 2022 09:44
March 1, 2023 14:00
January 21, 2023 13:20

OpenAPI spec for the OpenAI API

This repository contains an OpenAPI specification for the OpenAI API, as well as a script that uses OpenAPI Generator to auto-generate client SDKs from the specification.

OpenAPI Generator uses mustache templates to generate code — the files in the sdk-template-overrides folder override the corresponding built-in template files with small edits required for the OpenAI SDKs. More detail on each currently generated SDK is provided below.

Node.js

Example command to generate the SDK

$ python scripts/generate_sdk.py -s node -o ~/openai-node

Node.js specific details

  • The operationId of each operation is used as the function name for that operation
  • The tag determines the name of the Javascript class that contains that operation
  • schema names map to Typescript type names