Openai embeddings without third-party modules?

I’m trying to use embeddings with the open ai API call module without success.
Is it possible? Can anyone help me? I would not like to use third-party modules.

I’ve tried several times but I always get an error like: The operation failed with an error. [400] We could not parse the JSON body of your request. (HINT: This likely means you aren’t using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)

I’m trying this way:

You’ve configured the request incorrectly. But heres what you can try. Remove the fields you set for header 2 and 3.

You need to place them in the body like this:
{
“input”: “Your text string goes here”,
“model”: “text-embedding-3-small”
}

I suggest take a look at the Make learning modules on API request. This will be of great help in the future.

Hope this helps!

1 Like

Thank you for taking the time to help, but unfortunately the same error returned.

Any more ideas please?

Input
Bundle 1Collection
URL	v1/embeddings
Body	{“input”: “Your text string goes here”,“model”: “text-embedding-3-small”}
Method	POST
HeadersArray
1Collection
Key	Content-Type
Value	application/json

I also tried removing the “{”, tried with and without line breaks, they all generated the same error. I appreciate any help. Thanks

I managed to solve it with your help.

I manually replaced the characters " with the same character " and miraculously it worked. I don’t know why but it worked. thanks!

2 Likes