OpenAI Postman collection

Hey everyone :wave:

TL;DR: If you use Postman to test the OpenAI API, check out this public workspace: Postman

Building up on @JacobLey’s thread about creating an OpenAPI schema for OpenAI, I looked into updating it, making it consumable, and opening it to contributions.

It all starts with a schema…

To start with, I’ve re-written the API schema based on the current state of the API today (12th of Aug), the schema can be found either on my GitHub or on Postman. If you’d like to contribute to it, you can fork the GitHub repository and create a Pull Request there, any changes to it will also be made to the one on Postman and vice-versa.

Consuming the API

There are a few ways to get started with the OpenAI API, including some known ones:

  1. Using the OpenAI Playground which is the best way to get started with OpenAI.
  2. Using Postman to build more complex workflows, or integrate with other APIs/services without having to build an entire app, fork/import the collection by using this button:
    Run in Postman
  3. Using code, if you dont’ want to re-invent the wheel, you can get client code generated for you in Python, Ruby, Javascript, Go, PHP etc on this page (switch the langage in the top dropdown.).

Friendly reminder that there are also community libraries available here.

Contributing

I’ll try to stay on top of the changes, but considering the schema doesn’t originate from OpenAI I might already be missing some things, so if you’d like to let me know what’s missing, or contribute back, check out openai-openapi/contributing.md at main · arlemi/openai-openapi · GitHub. :pray:

If you’ve read that far, I’m also interested in common worfklows you’ve been doing (or you’ve seen people do) with the API, I’d like to start building collections for typical workflows instead of for the whole API. Any suggestions appreciated!

6 Likes

This is really cool, thanks for sharing.

Content Filter API might be a good addition. You can find about it in the Going Live Documentation.

Workflow for this would like this.

  • Call Completions endpoint → get the response → Call Content Filter endpoint with response from completions as input → Check for toxicity → Display response or display standard message.
3 Likes

@Harish Glad you like it! Thanks fo the suggestion, that looks like a simple enough worflow, I’ll try to put it together and will update here when it’s done. :slightly_smiling_face:

@m-a.schenk I can only agree with you on that, I’ve been looking for an official OpenAPI schema for a while but couldn’t find one anywhere so ended up creating that. Ideally the OpenAI team eventually takes ownership of this and automates the updates etc.
The default parameters being set to a high value is an issue whichever way you consume the API, I’ll have a look at the collections to make sure I don’t have any parameters pre-set to random values

Edit: That was a good call, I had parameters set to random integers/strings/numbers, I’ve now changed that to represent the type required instead. I’ve also disabled the optional parameters by default. Thanks!

3 Likes

Thanks very much @arlemi. FYI the link in #3 above (“on this page”) appears to be broken.

1 Like

@lmccallum Are you getting a specific error? Might have been temporary down, I can still access it. :thinking:

Works now. I didn’t get any error message, it just took me to a home screen, but all god now. Thanks.

1 Like