Error: 410 - {"error":{"code":"Gone","message":"Computer Vision 2023-02-01-preview has been deprecated. Please upgrade to the latest Computer Vision GA service - https://azure.microsoft.com/en-us/updates?id=475779 "}}

Bhaskar Turkar 30 Reputation points
2025-06-06T14:03:36.2166667+00:00

api_version=AI_VISION_VERSION
acv_endpoint=AI_VISION_ENDPOINT
acv_key=AI_VISION_KEY
def text_embedding(prompt):
    """
    Text embedding using Azure Computer Vision 4.0
    """
    version = "?api-version=" + api_version + "&modelVersion=latest"
    vec_txt_url = f"{acv_endpoint}/computervision/retrieval:vectorizeText{version}"
    headers = {"Content-type": "application/json",
               "Ocp-Apim-Subscription-Key": acv_key}

    payload = {"text": prompt}
    response = requests.post(vec_txt_url, json=payload, headers=headers)

    if response.status_code == 200:
        text_emb = response.json().get("vector")
        return text_emb

    else:
        print(f"Error: {response.status_code} - {response.text}")
        return None

Error: 410 - {"error":{"code":"Gone","message":"Computer Vision 2023-02-01-preview has been deprecated. Please upgrade to the latest Computer Vision GA service - https://azure.microsoft.com/en-us/updates?id=475779 "}}

Computer Vision
Computer Vision
An Azure artificial intelligence service that analyzes content in images and video.
415 questions
{count} votes

Accepted answer
  1. Manas Mohanty 5,700 Reputation points Microsoft External Staff Moderator
    2025-06-09T19:34:28.82+00:00

    Hi Bhaskar Turkar

    Please include model version-2023-04-15 in above commands. Attached working command tested at myside.

    
    import requests
    
    
    endpoint = "<computervision"  # Replace with your actual endpoint
    subscription_key = "<apikey"  # Replace with your actual key
    url = f"{endpoint}/computervision/retrieval:vectorizeText?api-version=2024-02-01&model-version=2023-04-15"
    
    headers = {
        "Content-Type": "application/json",
        "Ocp-Apim-Subscription-Key": subscription_key
    }
    
    data = {
        "text": "cat jumping"
    }
    
    response = requests.post(url, headers=headers, json=data)
    
    print(response.status_code)
    print(response.json())
    
    
    

    Reference used - https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/how-to/image-retrieval?tabs=csharp#call-the-vectorize-text-api

    Hope It helps fix your issue.

    Thank you.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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