API HeroGit-first API development for VS Code Author
Website · Marketplace · npm CLI · Documentation · Changelog · Support
Install from the Marketplace, open a folder workspace, create a Why API HeroMost API clients pull you into a separate app and opaque storage. API Hero keeps requests as plain files in your repo and UI where you already work.
No context switching. No binary collections. Same workflow as the rest of your codebase. API Requests as Code
Define Structure
Directives
Request EditorCustom editor view type:
Open via API Hero: Open Request Editor when the text editor is active.
Collections & WorkflowsLayout:
Collection Runner executes many requests in a collection, folder, or selection. Live progress appears in the Execution view.
ScenariosA Scenario automates one multi-step API workflow (steps, connections, shared data). That is distinct from Collection Runner, which runs many requests in a collection, folder, or selection.
CLI scenario → Collections · Collection Runner · Scenarios Variables & EnvironmentsUse Scopes and precedence (highest → lowest)
Environments are workspace-level named variable sets — they are not bound to a collection. Collection variables apply only to requests in that collection. OS Where values live
Auth secrets use VS Code Secret Storage via Manage Authentication — that is distinct from sensitive variables (masked in UI as
AuthenticationProviders only: Profiles live in API Hero: Manage Authentication. Attach with OAuth2 Account Login is not available. Authentication Login API (session login against your API) is included — that is separate from Account Login. → Variables · Environments · Authentication Dependencies & ExtractionChain requests so producers run before consumers. Collection Runner analyzes
Collection Runner honors dependencies. A single Run Request from the editor does not auto-run upstream producers — ensure required variables already exist in a persisted scope (e.g. Scenarios are separate from
|
| Source | Support |
|---|---|
| OpenAPI | 3.0.x and 3.1.x, JSON or YAML, from a local file or HTTP(S) URL |
| Postman | Collection v2 / v2.1 JSON (local file) |
| Insomnia | Resource-based export v3 / v4 JSON (local file) |
| cURL | Single command → one .api file; parsed in-process (no shell execution) |
- API Hero: Import OpenAPI Specification — wizard → Collections +
.apifiles - API Hero: Import Postman Collection — preserves folders, methods, URLs,
{{variables}}, headers/query/body, and bearer/basic/apiKey auth; scripts are warnings only - API Hero: Import Insomnia Export — preserves nested folders, methods, URLs, environments, and bearer/basic/apiKey auth; Insomnia-only resource types are not migrated
- API Hero: Import cURL — paste, editor selection, or text file → masked preview → save one
.apifile (round trip with Copy as cURL).@filebodies are not read from disk - Imported environments are created and selectable; an existing active environment is preserved
- Size limit:
apiHero.import.maxFileBytes(default 5 MiB) for OpenAPI/Postman/Insomnia; cURL paste capped at 256 KiB
Not supported: Swagger 2.0, Insomnia Document / YAML v5, HAR, GraphQL (best-effort stub only from Postman/Insomnia), remote $ref, OAuth2 as a live auth flow, authenticated specification URLs, Postman/Insomnia script execution, gRPC / WebSocket request resources from Insomnia.
Debugging & Reports
Response Viewer
Inspect status, timing, pretty/raw/JSON body, headers, and assertions. Copy or save the body, search within it, and create variables from the response (Extract Variable… / Save as Variable).
Failure Diagnostics
When a request fails, API Hero can show Possible causes next to recorded facts (status, URL, timing, transport error). Guidance covers common HTTP statuses and network/timeout failures. It is structured context to help you investigate — not a guaranteed root-cause diagnosis. Secrets stay redacted.
The same explanations appear in Run Report Details and in MCP diagnostic fields.
Request/Response Diff
Compare results within the current run/session:
- Compare with Previous Run — Previous vs Current for the same request in this session (status, headers, JSON paths, text lines) over already-redacted presentations
- Compare Runs — from Collection Run Manager / Report Details when a prior recent collection-run presentation exists for that request
This is not persistent History body comparison. History stores metadata only.
Run Reports & Variable Trace
After a collection/folder/selection run:
- Compact summary counts (total / passed / failed / skipped / cancelled)
- Per-request rows with outcome / method / search filters
- Variable Trace — produced and consumed names (expand for unresolved names)
- Details — Response, Headers, Assertions (Expected/Actual), Variables, Execution Details, Dependencies, and Possible causes when applicable
The Collection Run Debugger holds the last run in memory — it is not Request History.
Request History
Storage: VS Code extension globalStorageUri file request-history.json.
- Metadata only — no response bodies
- Cap via
apiHero.history.maxEntries(default 1000) - Actions: re-run, reveal original request, filter, clear, copy summary
TypeScript Generation
Generate TypeScript types/interfaces from a successful JSON response body (Response Viewer or API Hero: Generate TypeScript).
- Inference from this one observed body — not a complete API schema
- Copy to the clipboard or Create .ts
- Type names come from JSON keys only (never from sensitive string values)
This is type generation, not arbitrary application code generation.
MCP
API Hero includes a Model Context Protocol server so AI clients can inspect and run the same API workflows you keep in Git.
AI Client
↓
API Hero MCP (standalone Node stdio)
↓
Collection Runner / Execution Orchestrator
↓
Existing HTTP execution pipeline
- MCP is not a second HTTP client — it reuses discovery, Collection Runner, ScenarioEngine, and Execution Orchestrator
- Runs as an independent Node stdio process (not inside the VS Code extension host)
- Tools for listing collections/requests, running a request or collection, running a scenario (optional MCP
inputs), and reading redacted run results - Headless hosts load filesystem collections and
.apiheroProject Store environments / auth profiles. VS Code settings globals and VS Code Secret Storage are not available — supply secrets via process environment (APIHERO_SECRET_*or exact Secret Storage keys) - Installing the VS Code extension does not register MCP with Codex, Cursor, Claude, or any other client. Configuration is client-owned.
Bin: api-hero-mcp (also node ./dist/mcp/server.js). Workspace priority: --workspace → APIHERO_WORKSPACE → cwd. Requires Node.js 18+.
After installing @ankitsemwal007/api-hero from npm, clients can spawn api-hero-mcp. From a repo checkout, compile first (npm run compile).
→ Full guide: docs/user/mcp.md
CLI
The apihero CLI is public and shipped on npm. It runs the same Orchestrator / Collection Runner / ScenarioEngine as the extension and MCP — without VS Code.
npm package: @ankitsemwal007/api-hero (binary: apihero).
Marketplace extension id remains ankitsemwal.api-hero. Installing the VS Code extension does not put apihero on PATH.
npm install -g @ankitsemwal007/api-hero
apihero --help
apihero run request Login --workspace . --environment local
apihero run collection Demo --workspace . --json
apihero run scenario checkout --workspace . --quiet
Use --json in CI for a redacted machine-readable envelope on stdout.
Not included: --var, OS process.env → {{variable}}, scenario --inputs, parent-directory workspace discovery, Docker, watch mode, or parallel execution.
→ CLI guide · npm package
Installation
VS Code
Install API Hero from the Visual Studio Marketplace (ankitsemwal.api-hero). Requires VS Code 1.90+.
- Open a folder workspace (Collections need a folder root).
- Activity Bar → API Hero → Collections → New Collection / New Request, or create a
.apifile. - Run — Ctrl+Alt+R / Cmd+Alt+R, the editor Run button, or CodeLens Run Request.
- Inspect the Response Viewer.
From a local build:
npm install
npm run package
code --install-extension release/api-hero-2.10.0.vsix
Open API Hero: Open Overview anytime for quick actions.
CLI
npm install -g @ankitsemwal007/api-hero
apihero --version
apihero --help
Requires Node.js 18+. See CLI.
Documentation
| Topic | Link |
|---|---|
| Website | apihero.in |
| Docs home | docs/README.md |
| Getting started | getting-started.md |
| CLI | cli.md |
| MCP for AI agents | mcp.md |
| Configuration | configuration.md |
| Release notes 2.10.0 | v2.10.0-release-notes.md |
Listing media (hero, screenshots, banner, social preview, workflow GIF) is hosted on Cloudinary so the VSIX stays small. Extension icons still ship in-package.
Also used for listing / social: banner, social preview.
Development
npm install
npm run check
npm run lint
npm test
npm run compile
npm run package
npm run mcp— compile and start the MCP server on stdio- See CONTRIBUTING.md and development docs