Skip to content

Commit c08048e

Browse files
authored
Merge pull request #15 from lindazqli/patch-51
Update quickstart-rest.md
2 parents 8ea5e7e + afcc524 commit c08048e

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

articles/ai-services/agents/includes/quickstart-rest.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,30 @@ az login
3333

3434
Next, you will need to fetch the Entra ID token to provide as authorization to the API calls. Fetch the token using the CLI command:
3535
```azurecli
36-
az account get-access-token --resource 'https://ml.azure.com/' | jq -r .accessToken | tr -d '"'
36+
az account get-access-token --resource 'https://ai.azure.com' | jq -r .accessToken | tr -d '"'
3737
```
3838
Set the access token as an environment variable named `AZURE_AI_AGENTS_TOKEN`.
3939

40-
To successfully make REST API calls to Azure AI Agents Service, you will need to use the endpoint as below:
40+
To successfully make REST API calls to Azure AI Foundry Agent Service, you will need to use the endpoint as below:
4141

42-
`https://<HostName>/agents/v1.0/subscriptions/<AzureSubscriptionId>/resourceGroups/<ResourceGroup>/providers/Microsoft.MachineLearningServices/workspaces/<ProjectName>`
43-
44-
`HostName` can be found by navigating to your `discovery_url` and removing the leading `https://` and trailing `/discovery`. To find your `discovery_url`, run this CLI command:
45-
46-
```azurecli
47-
az ml workspace show -n {project_name} --subscription {subscription_name} --resource-group {resource_group_name} --query discovery_url
48-
```
42+
`https://<your_ai_service_name>.services.ai.azure.com/api/projects/<your_project_name>`
4943

5044
For example, your endpoint may look something like:
5145

52-
`https://eastus.api.azureml.ms/agents/v1.0/subscriptions/12345678-abcd-1234-abcd-123456789000/resourceGroups/my-resource-group/providers/Microsoft.MachineLearningServices/workspaces/my-project-name`
46+
`https://exampleaiservice.services.ai.azure.com/api/projects/project`
47+
48+
Set this endpoint as an environment variable named `AZURE_AI_FOUNDRY_PROJECT_ENDPOINT`.
5349

54-
Set this endpoint as an environment variable named `AZURE_AI_AGENTS_ENDPOINT`.
50+
For `API_VERSION`, the GA API version is `2025-05-01` and the latest Preview API version is `2025-05-15-preview`.
5551

5652
### Create an agent
5753

5854
> [!NOTE]
5955
> With Azure AI Agents Service the `model` parameter requires model deployment name. If your model deployment name is different than the underlying model name then you would adjust your code to ` "model": "{your-custom-model-deployment-name}"`.
6056
6157
```console
62-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=2025-05-01 \
58+
curl --request POST \
59+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=2025-05-01 \
6360
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
6461
-H "Content-Type: application/json" \
6562
-d '{
@@ -73,7 +70,8 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=2025-05-01 \
7370
### Create a thread
7471

7572
```console
76-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads?api-version=2025-05-01 \
73+
curl --request POST \
74+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads?api-version=2025-05-01 \
7775
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
7876
-H "Content-Type: application/json" \
7977
-d ''
@@ -82,7 +80,8 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads?api-version=2025-05-01 \
8280
### Add a user question to the thread
8381

8482
```console
85-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=2025-05-01 \
83+
curl --request POST \
84+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=2025-05-01 \
8685
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
8786
-H "Content-Type: application/json" \
8887
-d '{
@@ -94,7 +93,8 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-versi
9493
### Run the thread
9594

9695
```console
97-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=2025-05-01 \
96+
curl --request POST \
97+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=2025-05-01 \
9898
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
9999
-H "Content-Type: application/json" \
100100
-d '{
@@ -105,13 +105,15 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=2
105105
### Retrieve the status of the run
106106

107107
```console
108-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs/run_abc123?api-version=2025-05-01 \
108+
curl --request GET \
109+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs/run_abc123?api-version=2025-05-01 \
109110
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN"
110111
```
111112

112113
### Retrieve the agent response
113114

114115
```console
115-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=2025-05-01 \
116+
curl --request GET \
117+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=2025-05-01 \
116118
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN"
117119
```

0 commit comments

Comments
 (0)