| title | Discover APIs - VS Code extension |
|---|---|
| description | API developers can use the Azure API Center extension for Visual Studio Code to discover APIs in their organization's API center. |
| ms.service | azure-api-center |
| ms.topic | how-to |
| ms.date | 05/27/2025 |
| ms.custom |
API developers in your organization can discover and consume APIs in your API center by using the Azure API Center extension for Visual Studio Code. The extension provides the following features:
-
Discover APIs - Browse the APIs in your API center, and view their details and documentation.
-
Consume APIs - Generate API SDK clients in their favorite language including JavaScript, TypeScript, .NET, Python, and Java, using the Microsoft Kiota engine that generates SDKs for Microsoft Graph, GitHub, and more.
API developers can also take advantage of features in the extension to register APIs in the API center and ensure API governance.
Tip
If you want enterprise app developers to discover your APIs in a centralized location, optionally enable the read-only API Center portal view in Visual Studio Code.
[!INCLUDE vscode-extension-basic-prerequisites]
- REST client extension - to send HTTP requests and view the responses in Visual Studio Code directly
- Microsoft Kiota extension - to generate API clients
- Microsoft 365 Agents Toolkit - to create Microsoft 365 declarative agents
[!INCLUDE vscode-extension-setup]
API center resources appear in the tree view on the left-hand side. Expand an API center resource to see APIs, versions, definitions, environments, and deployments.
:::image type="content" source="media/discover-apis-vscode-extension/explore-api-centers.png" alt-text="Screenshot of API Center tree view in Visual Studio Code." lightbox="media/discover-apis-vscode-extension/explore-api-centers.png":::
Search for APIs within an API Center by using the search icon shown in the APIs tree view item.
You can view the documentation for an API definition in your API center and try API operations. This feature is only available for OpenAPI-based APIs in your API center.
-
Expand the API Center tree view to show an API definition.
-
Right-click on the definition, and select Open API Documentation. A new tab appears with the Swagger UI for the API definition.
:::image type="content" source="media/discover-apis-vscode-extension/view-api-documentation.png" alt-text="Screenshot of API documentation in Visual Studio Code." lightbox="media/discover-apis-vscode-extension/view-api-documentation.png":::
-
To try the API, select an endpoint, select Try it out, enter required parameters, and select Execute.
[!NOTE] Depending on the API, you might need to provide authorization credentials or an API key to try the API.
[!TIP] You can generate API documentation in Markdown, a format that's easy to maintain and share with end users. Right-click on the definition, and select Generate Markdown.
You can view a .http file based on the API definition in your API center. If the REST Client extension is installed, you can make requests directory from the Visual Studio Code editor. This feature is only available for OpenAPI-based APIs in your API center.
-
Expand the API Center tree view to show an API definition.
-
Right-click on the definition, and select Generate HTTP File. A new tab appears that renders a .http document populated by the API specification.
:::image type="content" source="media/discover-apis-vscode-extension/generate-http-file.png" alt-text="Screenshot of generating a .http file in Visual Studio Code." lightbox="media/discover-apis-vscode-extension/generate-http-file.png":::
-
To make a request, select an endpoint, and select Send Request.
[!NOTE] Depending on the API, you might need to provide authorization credentials or an API key to make the request.
Use the Microsoft Kiota extension to generate an API client for your favorite language. This feature is only available for OpenAPI-based APIs in your API center.
- Expand the API Center tree view to show an API definition.
- Right-click on the definition, and select Generate API Client. The Kiota OpenAPI Generator pane appears.
- Select the API endpoints and HTTP operations you wish to include in your SDKs.
- Select Generate API client.
-
Enter configuration details about the SDK name, namespace, and output directory.
-
Select the language for the generated SDK.
:::image type="content" source="media/discover-apis-vscode-extension/generate-api-client.png" alt-text="Screenshot of Kiota OpenAPI Explorer in Visual Studio Code." lightbox="media/discover-apis-vscode-extension/generate-api-client.png":::
-
The client is generated.
For details on using the Kiota extension, see Microsoft Kiota extension for Visual Studio Code.
You can export an API specification from a definition and then download it as a file.
To export a specification in the extension's tree view:
-
Expand the API Center tree view to show an API definition.
-
Right-click on the definition, and select Export API Specification Document. A new tab appears that renders an API specification document.
:::image type="content" source="media/discover-apis-vscode-extension/export-specification.png" alt-text="Screenshot of exporting API specification in Visual Studio Code." lightbox="media/discover-apis-vscode-extension/export-specification.png":::
You can also export a specification using the Command Palette:
- Type the Ctrl+Shift+P keyboard shortcut to open the Command Palette.
- Select Azure API Center: Export API Specification Document.
- Make selections to navigate to an API definition. A new tab appears that renders an API specification document.
You can create a declarative agent for Microsoft 365 Copilot from an OpenAPI definition in your API center. With a declarative agent, you customize Microsoft 365 Copilot to help you meet the unique business needs of your users. When you build a declarative agent, you provide the instructions, actions, and knowledge to tailor Copilot for your business scenarios.
To export a declarative agent in the extension's tree view:
- Expand the API Center tree view to show an OpenAPI definition.
- Right-click on the definition, and select Export M365 Declarative Agent.
- When prompted:
- Select one or more API operations that Copilot can interact with.
- Select a workspace folder.
- Enter an application name.
The declarative agent is created in the selected workspace folder. Use the Microsoft 365 Agents Toolkit to further customize and deploy the agent.