ChatGPT API Guide

Previously I described using ChatGPT from the command line, but the open source project I was using at the time did not use the official API which is often invalid. Even though the project has been updated several times, trying to use it depends entirely on the availability of a “trail API”, which can be quite difficult.

The good news is that on March 1, 2023, OpenAI released an official ChatGPT API based on the gpt-3.5-turbo model, which is identical to the ChatGPT web version, but has the obvious advantages of being much more responsive, with almost no accidental disconnections, and the API has very few restrictions on users logging into the network.

ChatGPT API is priced at $0.002 per 1000 tokens, and according to OpenAI, 1 token is equal to 4 English letters or 0.75 words, in other words, 1 English word is equal to 1.33 tokens. You can generate your own API key here after registering or logging into your OpenAI account.

There is no doubt that enterprise users will be the main customers of ChatGPT API, and it is foreseeable that a large number of applications based on ChatGPT API will appear rapidly, and the application scenario of ChatGPT is coming everywhere in the future.

So for individual users, how should they use the ChatGPT API to improve their learning and productivity, other than using these ChatGPT applications packaged by third-party applications? In this article, we’ll share some personal ways to use the ChatGPT API, mainly on the macOS platform.

Since news about ChatGPT changes too quickly to guarantee the effectiveness of the content, please go to the original link for information if it has been changed or updated.

Open Source

OpenAI provides a Playground to visually learn how to use the gpt-3.5-turbo interface, the ChatGPT API, which has four modes: Complete, Chat, Insert and Edit, and you can adjust each parameter by dragging the mouse, which is very intuitive and convenient. However, unfortunately, you need to login to use this page, and you need to have a balance in your account.

ChatGPT API

In addition to the official OpenAI example, some users have used their own ChatGPT API to create a proprietary web version that can be used directly in the browser like the ChatGPT preview version, such as this one. Compared with the official ChatGPT page, it has the advantages of being completely free, no login required, super fast, and ready to use.

Keyboard Maestro

The previous article describes three ways to use the ChatGPT API from the command line, all of which have in common the need to open a terminal and then execute it, which is a bit cumbersome. To make it easier to use, we can rewrite it and put it in an automated application on macOS, such as Alfred, LaunchBar, Keyboard Maestro, etc. To do this, we need to modify the previous code a little bit, and take Keyboard Maestro as an example.

PopClip
PopClip is a tool to quickly perform clipboard manipulation, text processing, searching and other tasks with a simple mouse click or gesture. It automatically pops up a small toolbar when text is selected and provides a series of optional actions such as copy, paste, search, translate, share, etc. In addition, it supports many third-party plugins.

A few days ago, PopClip developer Nick Moore created a ChatGPT plugin that allows you to select text, click on the ChatGPT icon, paste its reply below, and hold down the Shift key to copy the reply to the clipboard.

Besides, some users have also created PopClip plugins for proofreading and touching up selected text, such as ChatGPT Grammar Check Extension, ChatGPT Proofreader Extension.

Bob
Bob is an OCR software for macOS that also supports plug-ins. In addition to shortcuts, Bob can also be invoked via PopClip.

Shortcuts
Apple’s Shortcuts can also be used to call the ChatGPT API, which is very easy to use. For example, Bingru Wu has created a simple Shortcuts to use ChatGPT with shortcuts. In addition, some users have created a shortcut command for conversations between Siri and ChatGPT, which is very interesting and turns the original voice-deaf assistant into an artificial intelligence assistant.

Summary

The ChatGPT API, with better model and lower price, has been launched and quickly exploded on the Internet. In this article, I share some of the ways that individual users can use ChatGPT API based on what I’ve seen in the past two days surfing the Internet. I hope you can try it and quickly experience the charm of ChatGPT in your daily study and work.

If the preview version of ChatGPT in early December last year opened a small door to show its great potential in natural language processing and let people get a glimpse of the amazement of the artificial intelligence era, the introduction of ChatGPT API is more like moving the door to ordinary people, so that we can easily use it without walking to the door. In the face of ChatGPT, which is quietly changing the way we live, let’s all look forward to and actively embrace the coming of a new era.