API Setup

Learn to set up the API to use Microsoft Computer Vision services.

Getting the subscription key and endpoint

Go to the computer vision resource that we made in the last lesson. Then, select the “Keys and Endpoint” tab from the “Resource Management” section in the left panel.

Here, we’ll see two subscription keys and one endpoint as shown below. Choose any one subscription key.

Saving the keys

Let’s save the API key and the associated endpoint to use throughout the course. The following is the procedure to save the API key and endpoint:

  1. Click the “Edit” button in the following widget.
  2. Type the chosen subscription key and endpoint in the SUBSCRIPTION_KEY and ENDPOINT fields, respectively.
  3. Click the “Save” button.

As soon as you save the values, the values will be replaced in the code. You can print these values by pressing the “Run” button.

print("Subscription key:","{{SUBSCRIPTION_KEY}}")
print("Endpoint:","{{ENDPOINT}}")