Azure Cognitive Services API Reference

Overview

The Azure Cognitive Services APIs enable developers to embed AI capabilities into their applications. These services cover vision, speech, language, decision, and search functionalities.

Authentication

All Cognitive Services APIs use Azure Active Directory (Azure AD) or subscription keys for authentication.

curl -H "Ocp-Apim-Subscription-Key: <your-key>" https://{region}.api.cognitive.microsoft.com

Endpoints

Replace {region} with the region where your resource is deployed (e.g., westus2).

ServiceEndpoint
Computer Visionhttps://{region}.api.cognitive.microsoft.com/vision/v3.2
Text Analyticshttps://{region}.api.cognitive.microsoft.com/text/analytics/v3.1
Translatorhttps://api.cognitive.microsofttranslator.com
Speechhttps://{region}.tts.speech.microsoft.com/cognitiveservices/v1
Facehttps://{region}.api.cognitive.microsoft.com/face/v1.0

Sample Request: Analyze Image

Analyze an image and retrieve description, tags, and objects.

curl -X POST "https://{region}.api.cognitive.microsoft.com/vision/v3.2/analyze?visualFeatures=Description,Tags,Objects" \
-H "Ocp-Apim-Subscription-Key: <your-key>" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/image.jpg"}'

Sample Response

{
  "description": {
    "captions": [
      {
        "text": "a group of people standing on a beach",
        "confidence": 0.85
      }
    ],
    "tags": ["people","beach","outdoor"]
  },
  "objects": [
    {
      "object": "person",
      "confidence": 0.99,
      "rectangle": { "x": 120, "y": 80, "w": 60, "h": 180 }
    }
  ]
}