Using the API Assistant to document your APIs
You can use the specification enhancements component of the API Assistant to help you improve your API documentation by analyzing your API definition, and generating recommendations for your descriptions and examples. Enhancing your API specification accelerates its adoption by consumers.
The specification enhancement component uses the IBM watsonx Granite LLM models to help you build your APIs faster. Take advantage of the API Assistant to quickly generate clear and concise descriptions and examples for documenting your API definitions.
How to use the API Assistant to generate examples and descriptions for your API
You use the API Assistant while creating or editing an API definition in the API Manager UI. The API Assistant reviews the API definition, and suggests descriptions and examples for fields in the schema. You can then choose which suggestions you want API Connect to incorporate into your API definition.
- Log in to API Connect Enterprise as a Service using a Premium subscription.
- In API Manager, open an OpenAPI 3.0 API that you'd like to edit.
- In the Design tab, click
to work in the Source view. - Click
to open the API Assistant
panel. - Ensure that the Specification enchancements panel is open, and click Generate to request AI suggestions for the API description and examples.
- Click Apply for each suggestion that you want to incorporate into your
API.
To quickly accept all suggestions, click Apply all.
- Click Save to save the updated API definition.
Example: Enhancing the EmployeesApi sample API
In this example we're using an EmployeesApi to show the flow through generating some AI suggestions, reviewing the suggestions, and then applying them to the API. You can follow the steps through with your own API.
- Log in to API Connect Enterprise as a Service using a Premium subscription.
- In API
Manager, click
Develop to open the API development page, and then ensure that the
APIs tab is selected so you can view your APIs.
- Select an API of Type OpenAPI 3.0 (REST), and click its
Title to edit it.

- The Design page opens in Form view.
Notice that the sample API is missing descriptions for some properties.

- Click
to work in the
Source view.API Assistant is easier to use when you can see the source code for your API.

- Click
to open the API Assistant
panel. Ensure that the Specification enhancements tab is selected. - In the Specification enhancements panel, you can click
to learn more about how
the API Assistant uses AI to improve your API definitions.
Click
again to close the
pop-up. - Now click Generate to see if some AI suggestions are recommended for
your API.
In our sample API, the API Assistant analyzes the API definition and returns suggested text for all of the empty descriptions and examples.

Notice the following changes to the display:
- The API Assistant panel displays the name of each field and the suggested description or example. The
corresponding values are also inserted and highlighted in the API source code so you can see them in
place.
While the API Assistant panel is open, the API source code is in read-only mode to prevent accidental updates. When you close the panel, the code becomes editable again.
- If a property already contains a description or an example, the existing value is preserved. For
example, in our sample API, the
employeeNumberproperty already contains a description oftestso a suggestion is not generated for it. - In the Design menu, the
and
icons display for any section of the API definition that received suggestions, so
you can easily jump to, or delete, that suggestion.
- The API Assistant panel displays the name of each field and the suggested description or example. The
corresponding values are also inserted and highlighted in the API source code so you can see them in
place.
- When you are ready to accept or decline the suggestions, take one of the following actions:
- Accept all suggestions:
Click Apply all to quickly accept all suggestions.
- Regenerate all suggestions:
Click
to regenerate all suggestions that were not already
applied. - Accept a suggestion:
Click Apply for each suggestion that you want to accept.
- Delete a suggestion:
Click
for each suggestion that you want to delete.
As you work with the suggestions, note the following behavior:
- Any suggestions that you apply are added to the API definition, but the definition itself is not saved until you click Save in the page header.
- When you click Save, your own changes and all applied suggestions are saved; however, any suggestions that you did not apply are lost.
- If you navigate away from the API Design page before applying a suggestion, that suggestion is lost.
- At any time, you can edit the API again and generate suggestions for any empty descriptions and examples.
- Accept all suggestions:
- Click
to close the API Assistant
panel.
- Return to the Form view by clicking
.In the sample API, you can see that the Description fields for the
EmployeeBodyproperties now contain the suggested descriptions.
- Remember to click Save to save the updated API definition.