#Error 400

1 messages Β· Page 1 of 1 (latest)

tawdry timber
#

Hi I am very eager to use this API with my project , im new in javascript and its about to be my first proejct, however I encountered error code 400, what am I doing wrong?

#

please note the key is correct, and my IP address has not reset

boreal talon
#

/key

wise lotusBOT
tawdry timber
tawdry timber
#

Did u even read the code to see theyre there?

#

@umbral acorn

zenith lodge
tawdry timber
#

Well the github saying it was free was misleading then

zenith lodge
#

where i said gpt-3.5-turbo for free?

tawdry timber
#

it is not stated which one is free in the docs thats why I am confused

zenith lodge
# tawdry timber

i wrote accessing our hosted API, i didn't mention OpenAI models

#

our models are free, if you spend 2 mins reading the models channel, you will understand which models you can use

tawdry timber
#

Response body:

{
    "status": false,
    "error": {
        "message": "Incorrect API Endpoint, Please check https://discord.pawan.krd for more information.",
        "type": "invalid_request_error"
    },
    "support": "https://discord.pawan.krd"
}
#

What I forward to the API:

async function forwardToApi(message) {
        const apiUrl = 'https://api.pawan.krd/gpt-3.5-unfiltered/v1';
        const payload = {
            model: 'gpt-3.5-unfiltered',
            messages: [{ role: 'user', content: message }]
        };

        try {
            const response = await fetch(apiUrl, {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                    'Authorization': `Bearer ${ApiKey}`
                },
                body: JSON.stringify(payload)
            });
zenith lodge
#

you have to know base URL and the full endpoint are 2 different things

#

when you use the OpenAI lib you need the base URL

#

but when you send the requests directly you have to write the full endpoint

tawdry timber
#

is it not the correct endpoint?

zenith lodge
tawdry timber
#

so what do I do to fix my issue im still learning javascript sorry

zenith lodge
#

you have to learn more about how API and OpenAI API works

tawdry timber
#

Thank you

#

I finally got it working now my project is almost complete

#

Its a project im doing for my university, where it will use an exploit where when u chat withurself on the university websites that u take the exams on u will be talking to chatgpt

#

u can write full prompts and stuff, now its finally giving responses

zenith lodge
tawdry timber
#

why does it say stream-disabled?
@zenith lodge