How to configure the url for an embedding batch job?

I’m trying to figure out what I’m doing wrong when uploading my jsonl file for the batch api.

Here’s the content of my .jsonl file:

{"custom_id": "abc", "method": "POST", "url": "v1/embeddings", "body": {"model": "text-embedding-3-small", "input": "lorem ipsum"}}
{"custom_id": "def", "method": "POST", "url": "v1/embeddings", "body": {"model": "text-embedding-3-small", "input": "I'll be back"}}
{"custom_id": "ghi", "method": "POST", "url": "v1/embeddings", "body": {"model": "text-embedding-3-small", "input": "Sweet home alabama"}}

When I upload the file and try and create a batch embedding job with it I get the following error w.r.t. the url field:

This is confusing to me because in the file I’ve set the url to be “v1/embeddings” for each element. This also corresponds to the url in the batch job shown in the screenshot. What am I doing wrong?

Hi there - I was just looking into this is in the context of another post. In case you have not had a chance to solve this yet, the issue seems to be related to the formatting of your JSONL file.

This is the formatting that is required for embeddings. In your case, you are missing the encoding format parameter.

{"custom_id": "request-1", "method": "POST", "url": "/v1/embeddings", "body": {"model": "text-embedding-ada-002", "input": "This is a test.", "encoding_format": "float"}}