Using OpenAI-ChatGPT with Drafts

Thanks for your reply! I finally figured it out. I got a plus account on OpenAI but I didn’t realize that separately I’d have to pay for API usage. So confusing. Sorry to bug you!

1 Like

I installed this gpt-4 action item but it did not work. However, the gpt-3 version works.
I deleted (forget) the gpt-3 entry in the Drafts Credential setting and used a new gpt-4 API code, as I have access to the paid gpt-4 version. It’s still not working. What am I not doing right?

What is showing in the log (as per troubleshooting section detailed in the first post in this topic)?

Here is what shows on the action log. What steps should I take to correct it:
OpenAI: 404, Invalid path. Check that your request is for a valid endpoint and model in the OpenAI API.
Script step completed.

That most likely means the API key you are using does not have access to the gpt-4 model. Are you sure it is enabled on the account you are using to generate keys?

So the main difference (to enable gpt4) is this part?

let answer = ai.quickChatResponse(chatPrompt, {
		"model": "gpt-4"
	})

Using this script: OpenAI: Correct Spelling in Selection | Drafts Directory I’m getting

OpenAI: 404, Invalid path. Check that your request is for a valid endpoint and model in the OpenAI API.
undefined
Script step completed.

Looks like quickTextEdit is not a valid endpoint anymore…

The edits endpoint ws being deprecated last month, which is what that is using according to the Drafts scripting docs,

Deprecation of the Edits API
Users of the Edits API and its associated models (e.g., text-davinci-edit-001 or code-davinci-edit-001) will need to migrate to GPT-3.5 Turbo by January 4, 2024. The Edits API beta was an early exploratory API, meant to enable developers to return an edited version of the prompt based on instructions. We took the feedback from the Edits API into account when developing gpt-3.5-turbo and the Chat Completions API, which can now be used for the same purpose:

I am now getting this result when I run the action ( version 3 I think) (now version 4?) on Drafts iOS but if use the same query directly on the ChatGTP app I get a normal response. I’ve tried adding the action again but no change. I am still using the free ChatGTP subscription. Any suggestions?

Thanks, Dale

As mentioned in the article at the top of this thread, you are not likely to get far with the “free” plan and API usage. You will need to setup billing at OpenAI.

Hello everyone,

I’ve been using the chatbot conversation feature for a while, but in the last few days, it has been encountering an error. I checked my credits, I used a new API Key, but nothing helps.

What else can I do?

What is the error you are getting?

just the red error flag,
is there a possibility to read the logfiles ?
Because there is an error-catching mechanism in the script using a write logfile function for the error.

Yes.

1 Like

Hello world,

thats the output of the script error logfile:HTTP.request Failed: 429, Unknown error
Chat failed: 429, Unknown error
undefined
any ideas?

429 is the quota limit. It is mentioned on this thread and others.

Details from OpenAI on cause and resolution.

https://help.openai.com/en/articles/6891831-error-code-429-you-exceeded-your-current-quota-please-check-your-plan-and-billing-details

Thx Sylumer, that was the solution