ChatGPT, if you haven’t already seen for yourself, is pretty impressive. It’s been super fun asking the AI random questions, and getting back some pleasantly surprising answers for the most part. For example, here is a response when I asked for some story driven co-op game concepts.

One thing that has got me really excited about ChatGPT is the thought that hopefully soon, Siri, and/or other digital assistants might be able to take advantage of this technology, and we could have access to ChatGPT at a moments notice. Then I thought, why wait?! Let’s do it right now! So I jumped onto OpenAI’s API docs, and got to work.
Prerequisites
Before jumping into the steps I took, I guess it’s important to note some prerequisites. First, I am using iOS/macOS. I’m sure there are similar solutions for other platforms, but I unfortunately don’t know much about them. Second, the following steps require you to set up an account with OpenAI to create an API key. And that’s pretty much it!
Hey Siri
In order to get ChatGPT to work with Siri, we’ll be using iOS’s Shortcuts alongside OpenAI’s completions API. Let’s go over what we’ll be doing before jumping into each step in detail. The create completion
endpoint allows us to send an HTTP POST
request containing a text prompt and returns a ChatGPT reply. We’ll be using Shortcuts to have Siri ask us for a prompt, send off a request to OpenAI via this endpoint, and finally read back to us whatever ChatGPT has to say about it. Let’s get to it!
Step 1
First, things first, let’s create our shortcut. In the Shortcuts app, select the plus symbol to create a new shortcut, and name it whatever you want to say when you want to activate it. In my case, I chose, “I have a question”.

Step 2
Next, we need to set up our prompt for ChatGPT. To do that, we’ll use the Ask for Input
and Set Variable
actions. First search for and select the Ask for Input
action. Set the action prompt to whatever you want Siri to say once you activate the shortcut. In my case, saying “I have a question” triggers the shortcut, so I’ve set my prompt to “What is it?”
Next search for and select the Set Variable
action. Give a name to the variable which will be used in a later step. I chose the word query
. Shortcuts will use this variable to store your response to Siri after she asks “What is it?”

Step 3
Now that we have our prompt stored as a variable, we’re ready to make our API call. We can use the Get Contents of URL
action to do this. Go ahead and select this action. We’re going to want to hit the create completions endpoint, so replace whatever is populated as the URL with https://api.openai.com/v1/completions
. Note, this may change in the future, so be sure to double check the docs for this endpoint before continuing.
For this next part, you’re going to need the API key you created at the start of all of this. Select the show more
link to the right of this action and fill in the following key/value’s for the request Header:
- Authorization: Bearer [YOUR-API-KEY]
- Content-Type: application/json
You’ll also need to fill in the following key/type/value’s for the request Body:
- model: text: text-davinci-003 (Or any GPT-3 model)
- prompt: text:
[YOUR-VARIABLE]
- max_tokens: number: 2048
Make sure you are using your own API key in place of [YOUR-API-KEY]
in the Authorization header, and you’ve selected your variable in place of [YOUR-VARIABLE]
for the prompt in the request body. If you’re unsure about what values you need to provide here, you can always visit the API docs. Here is what my request looks like in Shortcuts.

Step 4
The final piece of the puzzle is to retrieve ChatGPT’s reply from the response and spit it back out at us. To do that, we will use the Get Dictionary Value
and Speak Text
actions. Looking at the response example in the API docs, we can see ChatGPT’s reply will be contained in the choices
field in the response object.
{
"id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
"object": "text_completion",
"created": 1589478378,
"model": "text-davinci-003",
"choices": [
{
"text": "\n\nThis is indeed a test",
"index": 0,
"logprobs": null,
"finish_reason": "length"
}
],
"usage": {
"prompt_tokens": 5,
"completion_tokens": 7,
"total_tokens": 12
}
}
To fetch this value, go ahead and add the Get Dictionary Value
action, and enter choices
as the key.
Again, referring to the example response, we see that the actual text ChatGPT returns is contained in the text
field of the choices
object, so go ahead and use another Get Dictionary Value
action to fetch that, this time entering text
as the key.
Note, the format of the response may or may not change in the future, so again, be sure to double check with the API docs before continuing.
Finally, all we have to do is get Siri to tell us what ChatGPT has to say about our prompt. Search for and add the Speak Text
action.

Hey Siri, I Have a Question
Your shortcut should be all set! You can test it by running it from within the Shortcuts app, or by telling Siri you have a question. You will have to allow Shortcuts to send HTTP requests to OpenAI the first time the shortcut runs, so be sure to select allow when prompted.
Once it’s working, you should be able to trigger the shortcut by saying something like, “Hey Siri, I have a question.” When activated, Siri should request a prompt with something like, “What is it?”. Once you speak your prompt for ChatGPT, Shortcuts will send it to OpenAI, which will process the request, and send back a ChatGPT response. Finally, Siri should read it all out to you, while the text appears on screen for your convenience.
Here is what Siri had to say when I asked for a cat based role playing game idea.

And just like that, you now have access to ChatGPT right in your pocket. I hope this has been helpful and happy chatting!