I'm currently facing an issue while integrating OpenAI with UiPath using the LLM model

I’m facing an issue while connecting the API—it throws an error stating that a valid API key is not being passed. I’ve generated API keys from Open AI, Fireworks, and Hugging Face, but I’m encountering the same issue with each of them. Has anyone faced a similar problem or knows how to resolve this? I can share the error message and screenshots for better clarity.

Error message-“{\n "error": {\n "message": "You didn’t provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you’re accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.\”,\n "type": "invalid_request_error",\n "param": null,\n "code": null\n }\n}\n"

this one i got from response

these are the screenshot i created API

New Dictionary(Of String, String) From {
{“Authorization”, "Bearer " + API_Key},
{“Content-Type”, “application/json”}
}

these is syntax i passed in header

can any one know this please help me.

Regards
Melbin

Open AI

Hugging face

@Melbin_Antu3

may I know where did you provide them?

cheers

http request activity

@Melbin_Antu3

Did you first try with postman?

As that is better for debug and then you can import curl here directly

Cheers

Another way is to use dummy data for the API key value with a service that can visually display your request, such as https://webhook.site.

This way you will immediately see what is wrong, and will be able to adapt it.

From the information provided above, we can’t tell what the issue is with the activity configuration. A screenshot of the HTTP Request activity and how you configured it might help.