Using API Agent in IBM API Studio

Use the API Agent chat interface to run prompts and automate API tasks such as generating specifications, reviewing security, and managing artifacts.

Before you begin

About this task

Use the API Agent chat interface to automate API development tasks with natural language prompts. Use prompts to generate OpenAPI specifications, create DataPower assemblies, policies, and reduce manual effort.

The API Agent chat interface is available in the following form factors:

  • Web-based or API Manager UI
  • Visual Studio Code
  • IBM API Studio desktop version

These form factors differ in functionality:

  • Visual Studio Code supports command-based automation, file-level operations by using @filename, and MCP server setup.
  • IBM API Studio focuses on project-based workflows with a richer UI for managing projects and artifacts. It does not support Visual Studio Code-specific commands such as MCP server.

To know more details about which platform supports which tools, see Tools compatibility.

Procedure

  1. Log in to API Manager or open IBM API Studio desktop version.
  2. To use IBM API Studio in API Manager UI, click the API Studio icon in the left panel.
  3. On the top right corner of the window, click to open the API Agent chat interface.
  4. In the chat interface, select the instances from Select an API Manager.
  5. From the Provider organization options, select the provider organization, and then click Continue.
    Note: Steps 4 and 5 apply only when you use the IBM API Studio desktop version. In step 5, API Agent shows the list of provider organizations for the instance that you selected in step 4. If you use IBM API Studio within API Manager, you do not need to select a provider organization because you are already in a provider organization within an instance.
  6. Optional: In the API Agent chat interface, use the Main menu to view the list of sample prompts.
  7. To create a new project, click New API project +.
  8. Enter a project name in the Project name field and click Create.
    Note: You can create project from repository or local folder or native storage. You can also import a file.
  9. Click the project that you created, and click .
  10. In the API Agent chat interface, enter the prompts to receive a response from API Agent.
    For example, in the Type something field, enter the following prompts, and then click Send:

    To create a YAML file and generate an API inside a project.

    Generate an OpenAPI spec for a user
    Note: The API Agent in API Manager offers a similar experience to Visual Studio Code. For example, it generates an OpenAPI document that you can download and use. However, to complete studio-specific actions such as opening the generated API within a project you must provide prompts in IBM API Studio.
  11. In the displayed plan, click Start. The API Agent generates an API inside the project.
  12. Click the source view to see the specification file that is generated by API Agent and the kind file that is generated by IBM API Studio. Both files are linked for your reference.
  13. If you are not inside the project, the API Agent displays the API location options to select a project.
  14. From the API Location list, select the project, and click Continue.
  15. To create a DataPower assembly that is linked to an API file, enter the following prompt, and click Send:
    Create a datapower assembly with a log policy for the API <api name>
    Note: If you face any issues when trying to enter prompts from one UI page to another, see Troubleshooting.
  16. On the displayed plan, click Start.
  17. Click the source view to see the DataPower assembly file generated by API Agent.
  18. To publish the project, enter the following prompt, and then click Send:
    publish project <project name>