Share via

Get error 500 when sending requet to cohere-rerank v4.0-fast

David Gayerie 35 Reputation points
2026-02-10T14:17:32.7433333+00:00

We deployed the model cohere-rerank v4.0-fast on Azure Foundry in France Central.

But any request returns an error 500.

What did we miss to make it work?

Here is a sample python progam using the cohere client

import cohere

co = cohere.ClientV2(
    api_key="XXXXX",
    base_url="https://XXXXX.services.ai.azure.com/providers/cohere/v2/rerank",
)

documents = [
    {
        "Title": "Incorrect Password",
        "Content": "Hello, I have been trying to access my account for the past hour and it keeps saying my password is incorrect. Can you please help me?",
    },
    {
        "Title": "Confirmation Email Missed",
        "Content": "Hi, I recently purchased a product from your website but I never received a confirmation email. Can you please look into this for me?",
    },
]


query = "What emails have been about refunds?"

results = co.rerank(
    model="model",
    documents=documents,
    query=query,
    top_n=3,
)

Azure AI services
Azure AI services

A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.

0 comments No comments
{count} votes

Answer accepted by question author
  1. Q&A Assist
    2026-02-10T14:17:53.97+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error 500 you are encountering when sending requests to the cohere-rerank v4.0-fast model may be due to several factors. Here are some troubleshooting steps you can take:

    1. Check the Model Name: Ensure that the model name you are using in the request (model="model") is correct. It should match the deployment name of the model you have set up in Azure.
    2. Verify API Key and Endpoint: Confirm that the API key and the base URL you are using are correct and that they correspond to the Azure deployment of the model.
    3. Inspect Document Format: Make sure that the documents you are sending in the request are formatted correctly and meet any requirements specified by the API.
    4. Reduce Query Complexity: Sometimes, simplifying the query can help in identifying if the issue is related to the complexity of the input.
    5. Check for Service Availability: Ensure that the Azure service is operational and not experiencing any outages or issues that could affect the model's performance.
    6. Implement Retry Logic: Since 500 errors can be transient, implementing retry logic in your code might help. You can retry the request after a short delay.

    If you continue to face issues, consider reaching out to Azure support for more specific assistance regarding your deployment.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. David Gayerie 35 Reputation points
    2026-02-10T14:48:31.77+00:00

    Changing the name of the model fixed the error 500.
    Unfortunately, it still does not work but now with an error 404

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.