Swagger: Create API from Prompt
swagger_create_api_from_promptCreate and save an API definition from a text prompt, automatically applying governance rules. Choose between OpenAPI and AsyncAPI formats for standards-compliant specs.
Instructions
Generate and save a new API or a new version of an existing API based on a prompt using SmartBear AI. This tool automatically applies organization governance and standardization rules during API generation. The specType parameter determines the format of the generated definition. Use: 'openapi20' for OpenAPI 2.0, 'openapi30x' for OpenAPI 3.0.x, 'openapi31x' for OpenAPI 3.1.x, 'asyncapi2xx' for AsyncAPI 2.x, 'asyncapi30x' for AsyncAPI 3.0.x. Use this tool when creating APIs that comply with governance policies or when generating APIs from natural language descriptions. Use this tool when users ask to create, generate, or design APIs with governance or standardization requirements. Fails with a conflict error if the API version already exists. Returns API details and SwaggerHub URL.
Toolset: Registry API
Parameters:
owner (string) required: API owner (organization or user, case-sensitive)
apiName (string) required: API name
prompt (string) required: The prompt describing the desired API functionality (e.g., 'Create a RESTful API for managing a pet store with endpoints for pets, orders, and inventory')
specType (enum): Specification type for the generated API definition. Use: 'openapi20' for OpenAPI 2.0, 'openapi30x' for OpenAPI 3.0.x (default), 'openapi31x' for OpenAPI 3.1.x, 'asyncapi2xx' for AsyncAPI 2.x, 'asyncapi30x' for AsyncAPI 3.0.x (default: "openapi30x")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | API owner (organization or user, case-sensitive) | |
| prompt | Yes | The prompt describing the desired API functionality (e.g., 'Create a RESTful API for managing a pet store with endpoints for pets, orders, and inventory') | |
| apiName | Yes | API name | |
| specType | No | Specification type for the generated API definition. Use: 'openapi20' for OpenAPI 2.0, 'openapi30x' for OpenAPI 3.0.x (default), 'openapi31x' for OpenAPI 3.1.x, 'asyncapi2xx' for AsyncAPI 2.x, 'asyncapi30x' for AsyncAPI 3.0.x | openapi30x |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| owner | No | ||
| apiName | No | ||
| version | No | ||
| specType | No | ||
| operation | No |