openai_api_project_Pauline
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
![WARNING] Please play nice and fork this val, so you don't kill my quota
Used in various experiments @hbk-bs seminar basics of digital communication
curl 'https://www.val.town/v/YOUR_USER_NAME/openai_api' \ -H 'Content-Type: application/json' \ -X POST \ -d '{ "messages": [ { "role": "user", "content": "Hello world" } ] }'
or in JS
const response = await fetch('https://www.val.town/v/YOUR_USER_NAME/openai_api', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
messages: [
{
role: 'user',
content: 'Hello world'
}
]
})
});
const data = await response.json();