Unveiling My OpenAI API Experience

Getting introduced to OpenAI’s API, I was not able to find any publicly advertised OpenAPI format, something that can be used to generated client code in any language, and plug in well with things like Postman or Swagger.

I wrote a version to share publically if you are having the same problem! https://open-api.getshowcase.io/open-ai.html

Feel free to use this webpage/document if it helps with your development and debugging! As I am not an actual member of OpenAI, it is possible some of the documentation is incorrect. If you notice anything wrong, feel free to open a PR to fix!

2 Likes

This is actually an amazing effort you did! It looks like this is already a few years old, and the website is not live anymore.
@OpenAiSupport why there isn’t an official swagger spec that is available for developers? I am sure internally your backend developers use “a spec”. Could we get access it to as well, please? This would streamline development, because most for many back-end systems you can generate Rest API calls from the spec, mistake free.

UPDATE: I found the spec here after some research. May I suggest putting this somewhere in OpenAI API so that it has more visibility ?

Like this? https://platform.openai.com/docs/api-reference

This from that page

curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

That helped me write Rust code.

This is useful, but having an actual openAPI spec is more useful because you can generate models for any major programming language.

Used AI to make a more specific title as the original was just to general.