S-GPT for Shortcuts.
It’s the inaugural week of the second annual edition of Automation April, and to celebrate the occasion, I’ve been working on something special: today, I’m introducing S-GPT, an advanced conversational shortcut for ChatGPT that bridges OpenAI’s assistant to native system features of iOS, iPadOS, macOS, and watchOS.
S-GPT (which stands for Shortcuts-GPT) is free to use for everyone, but it requires an OpenAI account with an associated pay-as-you-go billing plan since it takes advantage of OpenAI’s developer API, which has a cost. S-GPT was built with the latest ChatGPT API, and it can be used both with the existing ChatGPT 3.5 model or – if you have access to it – the ChatGPT 4 API.
While the shortcut is free for MacStories readers, I will be publishing a detailed, in-depth Automation Academy class soon for Club MacStories Plus or Premier members to explain the techniques and strategies I used to build this shortcut. I genuinely think that S-GPT is, from a technical perspective, my best and most advanced work to date; I hope my Academy class will help others learn some useful tips for Shortcuts and, in return, make even better automations for our contest.
With that said, let’s look at what S-GPT is and what you can do with it.
Getting Started with S-GPT
As I noted above, the first thing you should do if you want to use S-GPT is create an OpenAI account and make sure you have billing set up with pay-as-you-go; you’re going to pay very little for what you’re actually using with the ChatGPT API. The shortcut uses the native ChatGPT API, and that costs money for every call to the API; since my shortcut is free to use, you’ll have to provide your own API key.
Setting up S-GPT with your own API key.
Thankfully, since S-GPT was built with the new ChatGPT API, the cost of those API calls is going to be extremely small: the new model used by the ChatGPT API is very cost-efficient, as you can read here. To give you some context, I’ve been testing S-GPT extensively for the past month, and my usage is up to $1.50 so far. (The actual cost for the GPT 3.5 model: $0.002 / 1K tokens.)
My recommendation is to not upgrade to ChatGPT Plus but instead set up a pay-as-you-go billing method with a spending limit. You can do so from the Billing page. Once you’ve done that, head over to the API Keys page, create a new secret key for your account, and copy it. You’ll be asked by S-GPT at setup to paste your API key, and that’s it.
The Billing page on the OpenAI website.
If you get an error from S-GPT without any response, it’s likely that you haven’t set up a billing method or are trying to use an old API key. I strongly recommend generating a new API key from scratch if you just set up a billing method on the OpenAI website.
After pasting in your secret key, you’ll no longer have to see any other ChatGPT code or special syntax. I designed the shortcut to be intuitive, visual, and as native as possible on Apple platforms.
There is one optional setting you can change in S-GPT: if you have access to the ChatGPT 4 API (which is invitation-only at the moment), you can replace the default model used by S-GPT with the updated one.
If you have access to the ChatGPT 4 API, this is where you can replace which model to use in the shortcut.
Toward the beginning of the shortcut, find the ‘Text’ action that contains
gpt-3.5-turbo and replace it with
gpt-4. Again: you should only do this if your account has access to the ChatGPT 4 API. If not, you should continue using the default ChatGPT 3.5 model, which is fast, inexpensive, and accurate. In my tests, I haven’t noticed meaningful performance improvements in the GPT 4 model compared to 3.5.
S-GPT and Conversational Mode
At a high level, S-GPT is a shortcut that lets you ask ChatGPT questions from an input box on your iPhone, iPad, or Mac; answers are returned by ChatGPT and displayed in an alert on your devices. You can ask whatever you want, wait a couple of seconds, and get a response back from the assistant. S-GPT only supports text, and there are no limits in terms of question length.
Conversations with S-GPT.
There are several aspects of S-GPT, however, that set it apart from similar shortcuts you may have seen in recent months. Let me start from the underlying foundation of this shortcut.
S-GPT uses the new chat API released by OpenAI, which is more cost-efficient than the previous text completion API and can produce high-quality results. More importantly, S-GPT supports conversational mode: as you talk to ChatGPT and ask follow-up questions in the same “session”, S-GPT retains the context of your previous questions and the assistant’s series of answers. In fact, you can stop the shortcut at any point and export a full log of an entire conversation as a single transcript.
A full conversation saved to a text file.
The ability to hold a back-and-forth conversation, as we’ll see later, brings some terrific advantages over using, say, Siri for certain tasks. Unlike other shortcuts for ChatGPT, your conversations are only ever sent to the OpenAI API: by default, the shortcut does not keep a log or cache of your chats unless you manually ask it to export a transcript.
S-GPT was designed to provide users with concise and clear answers that can be read in just a few seconds. I did this because S-GPT can be used both as a shortcut launched from the Shortcuts app, an icon on the Home Screen, or a widget, or as a shortcut running inside Siri. When S-GPT runs inside Siri, it’s also running with more memory constraints and I’m guessing you wouldn’t want Siri to speak an answer that takes two minutes to be read in full. So, thanks to the ChatGPT API, I was able to assign a specific “personality” and role to S-GPT. This is the system prompt that controls S-GPT’s default behavior:
You are S-GPT, a fork of ChatGPT created by Federico Viticci. You have all the capabilities of ChatGPT but you run inside Apple’s Shortcuts app and Siri.
Your responses should be informative and clear, but not excessively long. You have to help users quickly.
Users need to be able to listen to your answers in 15 seconds. Never go longer unless I ask you to be more detailed.
At any point, you can ask S-GPT to be more detailed or to tell you more about a specific topic; whenever possible, S-GPT will prioritize brevity and short, informative responses.
You can always ask S-GPT for more detail about any topic.
As I will explain in the Automation Academy class for Club Plus and Premier members, S-GPT requires an additional helper shortcut to be installed. The shortcut, which you can find at the end of this article, is called S-GPT Encoder and it’s a helper utility that runs as a sub-module. The shortcut helps S-GPT properly encode and decode information; it was necessary to offer the ability to ask a single question or have an entire conversation with S-GPT.
The defining feature of S-GPT, however, is its native integration with Apple’s platforms.
With S-GPT, I wanted to start building a bridge between ChatGPT and Apple’s OSes. I know that this is a lofty goal, and there’s only so much I can do with Shortcuts, but I look at how Microsoft is integrating ChatGPT with Windows, and I’m jealous that the same isn’t true on Apple’s platforms (and likely will never be).
So, more than a simple bot to have a conversation with ChatGPT in Shortcuts, I set out to create a tool that would connect ChatGPT responses to native iOS, iPadOS, macOS, and watchOS functionalities. I wanted to create a ChatGPT-based utility that would help you process your data and make things happen on your computer rather than simply answer trivia questions or write poems.
The most powerful aspect of S-GPT is how Shortcuts becomes the glue between ChatGPT and your devices with a local, on-device, privacy-conscious approach. There are several native integrations in S-GPT already, and I have a long list of future ones to add in subsequent updates.
Let’s take a look.
The Native Integrations of S-GPT
In this first version of S-GPT, the shortcut supports the following integrations on iOS, iPadOS, and macOS:
- Safari share sheet. If you share a webpage with S-GPT, it’ll try to summarize it for you;
Clipboard. If you ask S-GPT to do anything with text in the clipboard, ChatGPT will process the contents of your system clipboard. Try asking “Check my clipboard for grammar mistakes” or “Summarize what’s in the clipboard”.
- Trigger word: “clipboard”
Reminders and Calendar. S-GPT can look at your upcoming schedule and tell you which days are too busy with the help of ChatGPT. Try asking “Help me with my schedule”.
- Trigger phrase: “my schedule”
Live Text. You can use S-GPT to summarize text extracted from any image in your photo library via Apple’s Live Text technology. Your photo will not be sent to OpenAI – just the text extracted from it locally, on-device. Try asking “Use Live Text.”
- Trigger phrase: “live text”
- Safari and URLs. If ChatGPT returns web URLs as part of its responses, S-GPT will offer you the ability to open those links – even multiple at once – in Safari as tabs.
- Quick Look, Files, Finder, Translate, and other export actions. When you want to end your conversation with S-GPT and do something with it, you can say “export chat” to be presented with a list of actions. These include the ability to copy the full chat to the clipboard, save it to a text file, and even translate it to a different language using Apple’s own Translate feature. By default, responses exported to text files will be saved in iCloud Drive/Shortcuts.
Music. This is the big one: S-GPT can make a playlist in Apple’s Music app for any list of songs returned by ChatGPT. As long as there’s a list of songs provided by S-GPT, you can ask it to turn it into a playlist and you’ll end up with a brand new, actual playlist in the Music app. Try asking “Make me a playlist with 10 emo songs from the late 2000s” or “I want a playlist with the top 15 songs by the members of boygenius”.
- Trigger word: “playlist”
As you can see from the list above, I tried to come up with a series of features for version 1.0 of this shortcut that would appeal to a wide range of users on different platforms, and I have more planned for future updates. The integrations are triggered by a set of prebuilt words or sentences (which I listed above) and, right now, S-GPT only supports the English language.
Now, allow me to dig a little deeper into a few examples of the integrations supported by S-GPT and what you can do with this shortcut.
By far my favorite feature of S-GPT is the ability to ask ChatGPT for a list of songs and turn that into an actual playlist in the Music app via Shortcuts’ playlist actions. What’s amazing about this is that the command can be issued immediately with details of the kind of playlist you’re looking for or later in a conversation, retaining the context of what was discussed before.
For instance, if you ask S-GPT this:
Make me a playlist with 20 popular songs by Oasis and Blur
ChatGPT will use its intelligence to understand what you mean, it’ll pass back a list of songs to S-GPT, and you’ll be asked to enter a name for the playlist. Wait a few moments, open the Music app, and boom:
Making a playlist with S-GPT.
To me, this is incredible: ChatGPT can turn a moderately complex natural language query into a list of songs; the engine I created in S-GPT translates that into a playlist inside Apple’s Music app. But we can do better than this.
One of the perks of ChatGPT is that it can go multiple levels deep into the meaning of a query. So, imagine this prompt:
I want a playlist with the top 15 songs by the members of boygenius
Ask this, and S-GPT will create a playlist with the top songs by Phoebe Bridgers, Julien Baker, and Lucy Dacus. ChatGPT knows how to search for “the members of boygenius” and it returns songs from the individual artists who are members of this supergroup.
ChatGPT knew what I meant, and S-GPT created the playlist for my query.
Siri, by comparison, has no idea what to do with this query.
This is still the surface. ChatGPT can find and recommend songs by vibe, release date, mood, and more. Imagine this:
I’m feeling nostalgic. Make me a playlist with 25 mellow indie rock songs released between 2000 and 2010 and sort them by release year, from oldest to most recent.
The natural language prompt in S-GPT.
That prompt will take a while to execute (more on why in the Automation Academy), but it’ll work, and it’ll generate this playlist:
You can’t go wrong with Death Cab and Modest Mouse.
The list of mind-blowing music examples could go on forever, and even though ChatGPT isn’t perfect at music recommendations, it’s pretty good, and I just love the ability to quickly and dynamically make a new playlist based on a set of arbitrary commands. This integration reminds me of the never-forgotten Sentence feature from Beats Music.
The last thing I’d point out is that S-GPT can hold the context of the current conversation, which works by asking it to generate a playlist later in the chat too. So, if S-GPT returns a list of songs and you then decide to turn that into a playlist, that flow will also work. Check out the screenshots below for an example of this:
From a conversation to a playlist in the Music app, all thanks to ChatGPT and Shortcuts.
The other integration I’d like to call out is the clipboard one. By simply asking S-GPT to do “something” with the clipboard, the shortcut will be able to access the text contents of your system clipboard and pass that to ChatGPT for processing. For example, this command…
Check the paragraphs of text in my clipboard for grammar mistakes. Provide a list of mistakes, annotate them, and offer suggestions for fixes.
…will allow S-GPT to access multiple paragraphs of text you’ve previously copied to the clipboard, and it’ll ask ChatGPT to process them for grammar mistakes based on its language model.
An example of S-GPT checking text in my clipboard for errors.
The flexibility of this integration is only limited by your imagination. Want to quickly summarize an article from Safari? Open an article’s Safari Reader view, copy all text in it, then ask S-GPT…
Summarize the text in my clipboard
…and you’ll have a summary, ready to be copied or saved somewhere.
As long as the article isn’t too long (don’t try and give 5,000 words to ChatGPT via the API), this will work.
How about asking for a list of adjectives and adverbs contained in your clipboard? Sure thing:
Adverbs and adjectives as scanned from my iPad’s clipboard.
And what about going back to the original text and asking to also translate it to Italian? That also works.
Context retention and translation in S-GPT.
Speaking of copying and saving chat transcripts: S-GPT comes with a series of actions that you can perform to save or export the conversation you had with it. To invoke the list of actions, simply say…
…and you’ll be presented with the following menu:
S-GPT’s list of export actions.
As you can see, S-GPT offers buttons to copy the full chat log to the clipboard, save it as a text file, copy the last response from ChatGPT only, or even translate everything to a different language using Apple’s own Translate feature for iOS, iPadOS, and macOS. At any point during a conversation, you can say “export chat” to launch this menu and choose what you want to do.
Like I said, I don’t want to get too deep into the technicalities of S-GPT: I intentionally designed this shortcut to be intuitive and flexible so that everyone can find their own use cases and have a unique experience with it.
As Apple often likes to say about its products, I can’t wait to see what you make with this shortcut.
Coming Soon for Club Members: More Personalities and an Automation Academy Class
But wait, there’s more!
Coming this Friday in MacStories Weekly for all Club members, I designed a series of special “behavioral” prompts to unlock different personalities in S-GPT. There is one, for example, in which the AI is extremely evil, unkind, and malevolent towards you, which was inspired by CARROT Weather. There is another flavor of S-GPT that talks like Steve Jobs and is obsessed with Apple references and fun facts. In MacStories Weekly, I will share some of these prompts so you can infuse S-GPT with different personalities and have some fun with it.
Additional personalities for S-GPT.
For Club Plus and Premier members, I’ve been working on the grand return of my Automation Academy series (it’s been too long, and I apologize) with a deep dive into the making of S-GPT and how the ChatGPT API works in Shortcuts behind the scenes. S-GPT is the most advanced and complex shortcut I’ve ever created. It employs several high-level techniques for data processing, encoding, exceptions, and system integrations that tap into some of the most esoteric advanced options for Shortcuts power users.
Whether you’re interested in building shortcuts for ChatGPT or just want to learn some advanced Shortcuts techniques that will help you during Automation April, this lesson is for you. I’m working on it now, and it’s going to be ready soon. To get access to it, my recommendation is to sign up for a Club Premier account, which includes everything from the base tier of the Club, plus:
- Discord access
- Extra original content
- More Club web app features, including custom RSS feeds
You can sign up using the buttons below.
Download S-GPT for Free
The 1.0 version of S-GPT I’m releasing today is just the beginning for this shortcut.
In the weeks I’ve spent building S-GPT, it has turned out to be a transformative shortcut that is altering my idea of chatting with an assistant on iOS, iPadOS, and macOS. I’m happy with the system integrations the shortcut has so far, but I’m working on a lot more for future updates – including the ability to run Terminal commands and scripts on macOS or ways to let ChatGPT process the contents of text documents from Files and Finder. Once I realized the potential for a large language model combined with Shortcuts’ native OS integrations, I knew this shortcut could be something special.
I’m only just getting started with S-GPT, and there’s a lot more to come in the near future. If you’re intrigued by the idea of blending Apple’s OSes and ChatGPT using Shortcuts, you can follow me for updates on Mastodon, and get started today with the first version of S-GPT.
S-GPT is a shortcut to have conversations with OpenAI’s ChatGPT assistant on your iPhone, iPad, and Mac. The shortcut supports both text conversations as well as voice interactions when used inside Siri. S-GPT comes with native system integrations on Apple platforms including the ability to process text from your clipboard, summarize text found in photos, export conversations to Files and Finder, and even create playlists in the Music app. The shortcut requires an OpenAI API token and a helper shortcut called S-GPT Encoder that needs to be downloaded separately.
This is a helper shortcut for S-GPT that needs to be downloaded and installed separately. Without this shortcut, S-GPT won’t work.
Support MacStories and Unlock Extras
Founded in 2015, Club MacStories has delivered exclusive content every week for over six years.
In that time, members have enjoyed nearly 400 weekly and monthly newsletters packed with more of your favorite MacStories writing as well as Club-only podcasts, eBooks, discounts on apps, icons, and services. Join today, and you’ll get everything new that we publish every week, plus access to our entire archive of back issues and downloadable perks.
The Club expanded in 2021 with Club MacStories+ and Club Premier. Club MacStories+ members enjoy even more exclusive stories, a vibrant Discord community, a rotating roster of app discounts, and more. And, with Club Premier, you get everything we offer at every Club level plus an extended, ad-free version of our podcast AppStories that is delivered early each week in high-bitrate audio.Join Now