Connect to OpenAI API With Postman

This OpenAI article will show how to connect to the Open API platform using Postman.

Postman is an API development tool that helps developers connect to services using REST API calls using a user-friendly interface.

The OpenAI API platform is accessible via API using the official Python library, PowerShell and other libraries. To connect to the OpenAI platform, you will need a payment plan to access the API and an API key to authenticate to the service.

API Key

Before you start, head to the OpenAI portal, and generate an API key from the account management section,

Postman Configuration

Once you have the key, Open Postman and create a new collection called OpenAI. Click on the Variables tab and add a new variable called baseurl with the value of https://api.openai.com/v1

Click on the Authorization tab, select Bearer Token, and paste the OpenAI API Key.

REST API Request

Let’s create our first API request for the platform that will list all the OpenAI models. Please make a new request and name me a list of models.

Type {{baseurl}}/models in the request bar and click send.

After you click send, you will see the result in the display panel of Postman, as shown in the screenshot below.

For more OpenAI articles, please visit the OpenAI category page.


Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.