# QAPI Agent

QAPI Agent is a powerful Visual Studio Code extension for API testing and development, featuring AI-powered assertion generation and an intelligent agentic assistant to streamline your API testing workflow.

### Features <a href="#features" id="features"></a>

#### 🚀 Core API Testing <a href="#core-api-testing" id="core-api-testing"></a>

* **Interactive API Testing**: Send HTTP requests directly from VS Code with a beautiful, intuitive interface
* **Complete Request Builder**: Configure headers, parameters, body, form data, and authentication with ease
* **Response Viewer**: View and analyze API responses with syntax highlighting and formatting
* **Method Color Coding**: Instantly recognize HTTP methods with color-coded badges (GET/POST/PUT/DELETE/PATCH)

#### 🤖 AI-Powered Features <a href="#ai-powered-features" id="ai-powered-features"></a>

* **AI Assertion Generation**: Automatically generate intelligent test assertions from API responses
* **Agentic Chat**: Real-time conversational AI assistant for API testing guidance and code analysis
* **Code Selection Context**: Select code to directly create tests, mocks, or audits with full context sent to the agent

#### 📥 Import Capabilities <a href="#import-capabilities" id="import-capabilities"></a>

* **cURL Import**: Import existing cURL commands to quickly create API tests (auto-saved)
* **Swagger/OpenAPI Import**: Import API collections from OpenAPI specification URLs or files
* **Postman Collection Import**: Import directly from Postman Collection URLs or JSON files
* **Drag-and-Drop Upload**: Simply drag your API specification files to import

#### ✅ Assertions & Validation <a href="#assertions-validation" id="assertions-validation"></a>

* **Multiple Assertion Types**:
  * Header assertions
  * Body content assertions (contains/does not contain)
  * JSON Path assertions with 8 operators (equal to, contains, greater than, etc.)
  * JSON Schema validation
* **Live Editing**: All assertions are editable with inline controls
* **AI-Suggested Assertions**: Review, accept, or modify AI-generated assertions

#### 🎨 Developer Experience <a href="#developer-experience" id="developer-experience"></a>

* **CodeLens Integration**: See route information inline in your code (supports Express.js, C#, Python Flask/FastAPI)
* **Code Actions**: Quick access to QAPI actions via the lightbulb menu (Quick Fix)
* **Theme Support**: Full light and dark mode support matching your VS Code theme
* **Workspace Management**: Organize your API tests into projects and workspaces

### Getting Started <a href="#getting-started" id="getting-started"></a>

1. Install the QAPI Agent extension from the VS Code Marketplace
2. Open the QAPI sidebar from the activity bar (QAPI icon)
3. Login with your QAPI Cloud credentials
4. Select a workspace to start testing
5. Create or import API tests and start sending requests

### Usage <a href="#usage" id="usage"></a>

#### Creating API Tests <a href="#creating-api-tests" id="creating-api-tests"></a>

1. Click the **"+"** button in the sidebar
2. Choose from:

* **Create Manually** - Build a new request from scratch
* **Import cURL** - Paste a cURL command
* **Import Collection** - Import from Swagger, Postman, or OpenAPI

3. Configure your request URL, method, headers, and body
4. Click **"Send"** to execute the request
5. View the response in the built-in response viewer

#### Importing API Collections <a href="#importing-api-collections" id="importing-api-collections"></a>

1. Click **"+"** → **"Import Collection"**
2. Select source type: **Swagger / OpenAPI** or **Postman Collection**
3. Choose import method:

* **Import from URL**: Paste your public API specification URL
* **Upload File**: Drag & drop or browse for JSON/YAML files

4. Select which endpoints to import (all selected by default)
5. Click **"Import Selected"** to add to your workspace

#### Using Agentic Chat <a href="#using-agentic-chat" id="using-agentic-chat"></a>

1. Switch to the **"Agentic"** tab in the sidebar
2. Type your question or request (e.g., "Create a test for this login endpoint")
3. Optionally, select code in your editor first to provide context
4. The AI assistant will respond with guidance, code, or test suggestions

#### Generating Assertions <a href="#generating-assertions" id="generating-assertions"></a>

1. Send a successful API request (2xx response)
2. Click **"Generate Assertions"** in the response panel
3. Review the AI-generated assertions in the modal
4. Select/deselect individual assertions as needed
5. Click **"Accept Selected"** to add them to your test

#### Managing Assertions <a href="#managing-assertions" id="managing-assertions"></a>

* Toggle assertions on/off using checkboxes
* Edit assertion values inline
* Add new assertions with the "+" buttons in each category
* Delete assertions with the trash icon (appears on hover)

### Requirements <a href="#requirements" id="requirements"></a>

* Visual Studio Code 1.85.0 or higher
* [QAPI](https://qapi.qyrus.com/) Cloud account for full functionality

### Keyboard Shortcuts <a href="#keyboard-shortcuts" id="keyboard-shortcuts"></a>

* `Ctrl/Cmd + S` - Save current test
* `Ctrl/Cmd + Enter` - Send request
* `Escape` - Close panels

<br>

{% file src="<https://3172693194-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNlYXD6rzxR0H9Hysr40v%2Fuploads%2Fuiu4l7NeA8FJOFU6lXFm%2FQAPI%20Agent%20v0.1.7.vsix?alt=media&token=41c4373a-ff81-4500-9aa1-47799fa38901>" %}
