Is Edit endpoint Documentation incorrect?

Edit Endpoint Documentation says the edit endpoint is

POST https://api.openai.com/v1/edits
but I get the below response whenever I want to use the endpoint.

{
  "error": {
    "message": "Invalid URL (POST /v1/edits)",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}

But also playground uses edit API as below

Post https://api.openai.com/v1/engines/text-davinci-edit-001/edits
Playground Request Body:
image

Which one is the correct way to use API?

– PART 2 –

While I was playing with API to figure out how to use it, I realized that only some models are allowed to use with “Edit API”. Neither documentation nor error response doesn’t include information about this limitation. “Invalid URL (POST /v1/edits)” error disappeared after I started to use “text-davinci-edit-001” model. The error message was misleading. I think it should be more clear which models are good to use (or I couldn’t read the documentation properly, please help me find where it is :slight_smile: ).

4 Likes

Thank you! This has been doing my head in. If you have any further insights on this endpoint I would be most grateful.

1 Like

I don’t use edit endpoint a lot at this time. With that said, the documentation does lag behind sometimes because OpenAI is moving as such a quick speed (even with all the safeguards they have in place). I know we just had someone using the wrong answers endpoint…

Thanks for sharing, though. It’s how we all improve!

1 Like

I just hit the same error. The endpoint reports 404 Not Found with “Invalid URL (POST /v1/edits)” whenever it does not like the input. For example if TopP and Temperature are both set even to their default values of 1 this error comes up.

I had to add a bit of code to skip inputs when using the default values.

Just ran into this too. Error messages are very confusing.

Our team is looking into this – thank you for raising the issue!

2 Likes

Any update on this? Still happening…

image

Hey folks, thanks for calling this out and being patient, we have updated the model parameter to make it clear that the edits API only works with text-davinci-edit-001 or the code-davinci-edit-001 model.

2 Likes

Thank you and the OpenAI team for being so responsive to developers in the community during this time of super-busy exponential growth for OpenAI.

Documentation always lags code and “who wants to polish documents anyway” haha

3 Likes

Thanks for being patient! We are here to help, please keep the feedback coming : )

1 Like

Hi everyone, rookie here - ChatGPT has been helping me learn to code!
I’ve specified the model as text-davinci-edit-001 but i’m still getting the { “error”: { “message”: “Invalid URL (POST /v1/edits)”, “type”: “invalid_request_error”, “param”: null, “code”: null }

Any ideas?

so if you look in the new playground:OpenAI API, you can do a call to say: “Mode” = “Complete” in the dropdown and use the model = “text-davinci-003”. then when you switch over to the example for “mode” = “edit” you cant use Model = “text-davinci-003” you need to change the Model to equal “text-davinci-edit-001” and it kinda works…but if you dont change the model, even in playground you see the error everyone is seeing here.

it is clear via the logic, you need more than one call to understand how this is working, and you must change the model to text-davinci-edit-001. im still seeing an issue, as I only get some kind of code back, not text when I try this in python. but im past the 404 error:)

it also works in the playground. API explorers are a most to learn this stuff:)

HI
facing this issue on both models that are allowed for edit.

openai.error.InvalidRequestError: The model: code-davinci-edit-001 does not exist
openai.error.InvalidRequestError: The model: text-davinci-edit-001 does not exist

any ideahow to resolve it?

openai version 0.27.0

Hey! I’m facing the same issue here.

The model: text-davinci-edit-001 does not exist.

The model: 'text-davinci-edit-001' does not exist This error persists when calling API through the endpoint POST https://api.openai.com/v1/edits and also in the Playground. Proof for the playground:

I’ve been playing around with it using the Java OpenAI package and also got the 404 error. After finding this I tried the text-davinci-edit-001 model and also got the error that this model doesn’t exist.
I made a call to get all the models (OpenAI API) and then pick one from there. But it’s always either the 404 or a 500 error.
Following the link to the playground above shows that there is no model that you can select when picking “edit”. So I guess you have to simply use the Chat option and alter the prompt to include the input and instruction at the same time. That seems to work fine.

Also facing this issue today. I’ve tried multiple models (including text-davinci-edit-001 and code-davinci-edit-001)

The playground for “Edit” also doesn’t work with an error “The model: text-davinci-edit-001 does not exist”

Seems model “text-davinci-edit-001” start working but via API’s route /v1/edits. In Playground output remains the same as input.

Having same issue as others with the API call via code not working but playground works and shows the following code but using the exact same values in app code does not work (completion api seems to be the only one that works):

curl https://api.openai.com/v1/edits
-H “Content-Type: application/json”
-H “Authorization: Bearer $OPENAI_API_KEY”
-d ‘{
“model”: “code-davinci-edit-001”,
“input”: “how are you”,
“instruction”: “punctuate”,
“temperature”: 0,
“top_p”: 1
}’

Can you share more details here? I am unable to replicate this error. The models and endpoint are both working for me.