Contact Us 1-800-596-4880

Generative AI Examples

Use these examples to help you get started with the generative AI feature and understand how to create messages for your own use cases.

Generative support is currently limited to RAML 1.0 and OAS 3.0 specifications.

Order Management

Your company manages a growing e-commerce platform and needs a way to streamline the handling of customer orders. You want to build an API specification that allows your backend systems to create, retrieve, update, and delete orders, ensuring consistent data models and robust error handling across all operations.

To generate a specification for this task, enter a message like: Generate an API specification for an order management system for an e-commerce platform. The API should include endpoints to create, retrieve, update, and delete orders, along with detailed definitions for request and response payloads, versioning details, and error handling mechanisms.

This message generates an API specification using the same specification language as the file that was in focus:

1 Creates a new order: The POST /orders operation accepts a JSON payload and returns a success or error response.
2 Retrieves a list of all orders: The GET /orders operation returns an array of order objects.
3 Handles operations for a specific order: Includes GET, PUT, and DELETE methods on /orders/{orderId} with path parameter validation.
4 Uses bearer token authentication: The bearerAuth scheme is applied to secure all endpoints.
5 Defines reusable data models: The Order and OrderItem schemas provide consistent structure for request and response payloads.

Inventory Management

Your business needs to track and manage product stock across multiple warehouses and storefronts. To ensure accurate inventory levels and prevent overselling, you want to generate an API specification that supports creating, updating, deleting, and listing products. The specification should include clear data models, input validation rules, and proper security mechanisms.

To generate a specification for this task, enter a message like: Generate an API specification for an inventory management system. The API should expose endpoints to manage products and stock levels, support operations to add, update, delete, and list products, and include clear definitions for data models, input validation rules, and security considerations.

1 Creates a new product: The POST /products operation uses a JSON payload to define the product.
2 Lists all products: The GET /products operation returns an array of products in stock.
3 Manages individual products: Includes operations to retrieve, update, or delete a specific product using its ID.
4 Secures endpoints with bearer authentication: The API uses bearerAuth to protect inventory operations.
5 Includes a validated product schema: The Product schema enforces required fields and validation like minimum: 0 for quantity.

User authentication and management

Your application requires secure and reliable user authentication to protect user data and manage access to services. To support this, you want to generate an API specification that handles user registration, login, token management, and password resets. The specification should include proper input validation, error responses, and security best practices.

To generate a specification for this task, enter a message like:

Generate an API specification for a user authentication and management service. The API should support endpoints for user registration, login, token management, and password resets, including thorough details on input validation, error responses, and necessary security protocols.

This message generates an API specification using the same specification language as the file that was in focus:

1 Registers a new user: POST /register validates input and creates a new user account.
2 Logs in a user: POST /login checks credentials and returns a token on success.
3 Refreshes token: POST /token/refresh issues a new access token using a refresh token.
4 Initiates password reset: POST /reset-password sends a reset email if the user exists.
5 Secures endpoints: All protected routes use JWT bearer authentication.
6 Defines schemas: UserRegistration and UserLogin schemas include input validation like minLength and format: email.