3 ms·
You can access the GPT backends with straight forward curl commands. curl https://api.openai.com/v1/completions \ -H "Content-Type: application/json"
by shagie 4y ago
You can access the GPT backends with straight forward curl commands.
curl https://api.openai.com/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "code-davinci-002",
"prompt": "# Python 3 \ndef remove_common_prefix(x, prefix, ws_prefix): \n x[\"completion\"] = x[\"completion\"].str[len(prefix) :] \n if ws_prefix: \n # keep the single whitespace as prefix \n x[\"completion\"] = \" \" + x[\"completion\"] \nreturn x \n\n# Explanation of what the code does\n\n#",
"temperature": 0,
"max_tokens": 64,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0
}'
Access to the systems doesn't need to be done through the ChatGPT front end - that's a neat technology demo.
- sylware 4y agoYou cannot get a OPEN_API_KEY with a noscript/basic (x)html browser as far as I know.
- shagie 4y agoSign up for an account, go to https://platform.openai.com/account/api-keys https://platform.openai.com/account/api-keys and create an API key. The raw curl (or python, or node.js - or other those are just the samples) are browserless.
- sylware 4y ago"You need to enable JavaScript to run this app.", I am using links2. Any "anonymous", public and severely rate limited keys?
- shagie 4y agoYou could spin up a VM that has a browser in it and use that to create the account and destroy the VM afterwards. You could use selenium with headless chrome. If you have a smart phone running any browser there, you could use that. There are some auth checks to make sure that a single person isn't signing up multiple accounts to get the free credits and if that sort of thing is a deterrent to you using it you may find it difficult to use.
- sylware 4y agoNot "difficult" : impossible. Well, I'll wait for those anonymous/public rate limited keys or a noscript/basic (x)html registering process, or www sites which will propose basic (x)html form based prompts.
- sylware 4y agoActually, best-effort, temporary, public keys would be more appropriate for their web API waiting for them to do a proper job at working with noscript/basic (x)html browsers.