Has anyone managed to create a web service connection to ChatGPT?
I'm trying by using 'no authentication' and typing this as the endpoint - https://api.openai.com/v1 - but getting a 401 return code.
Question
Question
chatgpt
Replies
I get a json response accessing this with a browser, but that is a get request. You must make a post request and authenticate with your API key if you want to call any methods based on all the documentation that I see. I don't know of any method to talk to gpt anonymously, they want everyone to have accounts and limitations.
Hey Chad, thanks for your response,
Yeah I have an account and a token, I just don't know how to authenticate properly. I've tried using the token in the header but I'm not sure how to make the request work, i.e. is it OAuth 2.0 or No Authentication or what.
Looks correct. You can leave it at No Authentication, OAuth 2.0 allows you to automate using a secret which it looks like they don't require.
So what happens when you try to execute a method? For example something like this:
https://youtu.be/bgQXSjk18mg?t=153
I can't execute a method unless I create a web service connection first, so that's the bit I'm still stuck at. I can execute a method using postman so there is nothing wrong with the token, it's obviously just the syntax of my attempt to create the connection in Laserfiche. I've looked at this but it's not really helping me > https://platform.openai.com/docs/plugins/authentication
Which model are you trying to use? The endpoint can vary depending on the model. For example:
- The endpoint for completions is https://api.openai.com/v1/completions
- The endpoint for chat completions is https://api.openai.com/v1/chat/completions
If you are using chat completions, the request body must have 2 sections: 1 defines the role and content, the other defines the body parameters. For completions, the request body only needs 1 section that defines the body parameters and the prompt.
The link you posted is for plugin authentication. You are not creating a plugin — this is purely an API call. You should focus on following this documentation: API Reference - OpenAI API
Hi Kevin,
Thanks for your feedback.
Where I was getting hung up was when trying to create a web service connection, it wasn't returning a 200 code (returning 404), so I was concerned that without that being 200, the web request rules wouldn't work.
But ended up putting the whole endpoint in there (even though it didn't return a 200 code), then created the rule with all the json, and it worked.
So the web service connection not returning a valid result is irrelevant, something I found out in this exercise.
Works for me with this config for web service and web request rule
Web Request Rule
Hey Chad, cheers, see my post above.
Oh yes I see, I get a 404 when I test too, that is because your not supposed to call the base URL without a method (URI and parameters), so you really can not test until you create your web request rule.