Insomnia
A feature-rich desktop API client by Kong for REST, GraphQL, gRPC, and WebSocket development.
Design APIs with OpenAPI, manage environments, write unit tests, and automate
collection runs with the inso CLI.
What is Insomnia?
Insomnia is a desktop API development environment maintained by Kong. It provides a clean, minimal interface for sending HTTP/REST, GraphQL, gRPC, and WebSocket requests. Beyond basic request management, Insomnia includes an OpenAPI design editor, a plugin system for custom behavior, built-in unit testing, and Git-based sync for version-controlled collaboration.
The inso CLI makes Insomnia a CI-friendly tool — you can run test suites, lint OpenAPI specs, and export design documents directly from your pipeline. Combined with Git Sync, Insomnia collections live alongside your codebase and are treated as versioned artifacts.
Key Features
- Multi-protocol requests — REST, GraphQL, gRPC, WebSocket, and Server-Sent Events
- OpenAPI design mode — write or import OpenAPI 3.x specs with live validation and request generation
- Environment management — nested environments (base + override) with template variables and process.env injection for CLI
- Unit testing — write Chai-based tests in the Test tab and run them with inso in CI
- Plugin system — extend Insomnia with request/response hooks, custom themes, and authentication helpers via npm packages
- inso CLI — run tests, lint specs, and export documents from the terminal; integrates with any CI system
- Git Sync — version-control your workspace by committing changes directly to a Git repository
- Authentication helpers — OAuth 2.0, Bearer, Basic, AWS v4, and more — with browser-based OAuth flow support
Installation
# Download Insomnia from the official site # https://insomnia.rest/download # Available for macOS, Windows, and Linux (.deb, .rpm, AppImage) # Install the Insomnia CLI (inso) for CI/CD automation npm install -g insomnia-inso # Verify CLI installation inso --version
Using the inso CLI
The inso CLI reads from an Insomnia workspace export file or a Git-synced workspace directory. Use it to run tests and lint specs as part of your automated pipeline.
# Run unit tests from a collection using inso CLI inso run test "My API Tests" --env "Staging" --reporter junit # Lint an OpenAPI specification file inso lint spec openapi/my-api.yaml # Export a design document to OpenAPI YAML inso export spec "My API" --output openapi/my-api.yaml # Run tests non-interactively in CI inso run test "Regression Suite" --env "CI Environment" --ci --reporter junit --output results/junit.xml
Environment Variables
Insomnia uses a template syntax with double curly braces {{ variable }} to reference environment values anywhere in a request — URL, headers, body, or auth fields.
// Insomnia environment — stored per workspace
// Switch environments via the dropdown in the top bar
{
"base_url": "https://api.example.com",
"api_key": "{{ process.env.API_KEY }}", // injects from process env in inso CLI
"user_id": 42,
"timeout": 5000
}
// Reference in request URL:
// GET {{ base_url }}/users/{{ user_id }}
// Reference in headers:
// Authorization: Bearer {{ api_key }} Writing Unit Tests
Open any request, click the Test tab, and write Chai-style assertions. Tests run in the app UI or via inso run test in CI. Group related tests under named test suites for organized reporting.
// Insomnia unit test — written in the Test tab of a request
const response = await insomnia.send();
expect(response.status).to.equal(200);
expect(response.headers['content-type']).to.include('application/json');
const body = JSON.parse(response.body);
expect(body).to.have.property('id');
expect(body.id).to.be.a('number');
expect(body.name).to.be.a('string').with.length.above(0); Plugin System
Install plugins from npm (insomnia-plugin-*) via Preferences or build your own. Plugins can add request/response lifecycle hooks, custom auth methods, and new themes.
// insomnia-plugin-add-timestamp/index.js
// A simple Insomnia plugin that injects a request timestamp header
module.exports.requestHooks = [
async (context) => {
context.request.setHeader(
'X-Request-Time',
new Date().toISOString()
);
}
];
// package.json for the plugin
{
"name": "insomnia-plugin-add-timestamp",
"version": "1.0.0",
"insomnia": {
"name": "Add Timestamp Header",
"description": "Injects X-Request-Time on every request"
}
} Insomnia vs Postman
| Feature | Insomnia | Postman |
|---|---|---|
| gRPC support | Yes (native) | Limited |
| OpenAPI design mode | Yes (built-in) | Via API Network |
| Git Sync | Yes (built-in) | Partial (paid) |
| Mock server | No | Yes |
| Plugin marketplace | Small (npm) | Large |
| UI cleanliness | Minimal, fast | Feature-dense |
Pros and Cons
Pros
- ✓ Clean, fast interface that stays out of your way
- ✓ First-class gRPC support
- ✓ OpenAPI design mode with live validation
- ✓ Git Sync for version-controlled collaboration
- ✓ inso CLI enables full CI/CD integration
Cons
- ✗ No built-in mock server
- ✗ Smaller plugin ecosystem than Postman
- ✗ E2E encrypted cloud sync requires a paid plan
- ✗ Desktop-only — no web app equivalent
- ✗ Team sharing features require a paid plan
Frequently Asked Questions
What is Insomnia?▼
Insomnia is a desktop API client by Kong that supports REST, GraphQL, gRPC, and WebSocket. It provides a rich GUI for building and organizing HTTP requests, managing environments, writing unit tests, and designing APIs with OpenAPI. The inso CLI enables running collections and linting specs in CI/CD pipelines.
How does Insomnia compare to Postman?▼
Insomnia and Postman are both full-featured desktop API clients. Insomnia is known for its clean, minimal interface and strong gRPC support — an area where Postman has historically been weaker. Postman has a larger plugin marketplace and more mature team collaboration features. Insomnia's design (OpenAPI) mode gives it an advantage for API-first development workflows. Both have free tiers with optional cloud sync.
What is the inso CLI and how do I use it?▼
inso (Insomnia CLI) is a Node.js command-line tool for automating Insomnia operations. You can run unit tests (inso run test), lint OpenAPI specs (inso lint spec), and export design documents (inso export spec). It reads from local Insomnia workspace export files or the cloud-synced workspace and is designed for CI/CD integration with JUnit XML output.
Does Insomnia support OpenAPI / API design?▼
Yes. Insomnia has a Design mode where you can write or import OpenAPI 3.x specifications. The spec editor has live validation, syntax highlighting, and a rendered preview. You can generate request collections directly from the spec and keep the spec in sync as you add requests. The inso CLI can lint and export these specs as part of your pipeline.
How does Insomnia handle authentication?▼
Insomnia supports OAuth 2.0, OAuth 1.0, Bearer Token, Basic Auth, Digest Auth, NTLM, AWS v4 signing, and API Keys as first-class auth types configurable per-request or inherited at the folder level. For OAuth 2.0, it can open a browser to complete the authorization code flow and automatically refresh tokens. Auth configurations can reference environment variables for secrets.
Can Insomnia sync collections across machines?▼
Yes. Insomnia offers cloud sync through your Insomnia account (free tier includes basic sync, paid plans include team sharing and E2E encryption). Alternatively, you can store the workspace export file in a Git repository and use Git Sync, which commits workspace changes directly to a repo — providing version history, branching, and team collaboration without a cloud account.
Related Products
on GumroadAPI Testing Cheatsheet Pack
Quick-reference cheatsheets for REST, GraphQL, and WebSocket testing. Includes Postman collections, shell scripts for smoke tests and load tests, and JWT decoder.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →You Might Also Need
GraphQL Query Builder
Build GraphQL queries visually from your schema SDL. Select root fields, pick sub-fields, add arguments, and generate query/mutation/subscription strings instantly. Supports nested types.
Open free tool →
OpenAPI Validator
Paste your OpenAPI 3.x spec (YAML or JSON) to validate structure, find missing required fields, detect duplicate paths, check for missing operationIds, and get errors and warnings with path references.
Open free tool →
GraphQL Fragment Generator
Paste a GraphQL schema type definition and auto-generate reusable fragments. Supports nested types, interfaces, and unions with optional __typename and nested expansion.
Open free tool →
More Free Tools
Related Articles
curl 深度使用手冊:API 測試從入門到進階
curl 是每位開發者必備的 CLI 工具。本文涵蓋 GET/POST/PUT/DELETE 請求、認證、header 設定、檔案上傳、除錯技巧,以及 REST API 測試的完整實戰範例。
GraphQL Federation vs REST Microservices: Which Architecture in 2026?
Compare GraphQL Federation vs REST microservices — Apollo Federation, schema stitching, performance, team scaling, migration paths, and when to choose each in 2026.
GraphQL vs REST vs gRPC: A 2026 API Design Comparison
A practical guide comparing GraphQL vs REST vs gRPC for modern API development. Covers performance, type safety, tooling, use cases, and a decision framework for 2026.
tRPC vs GraphQL vs REST: Type-Safe APIs in 2026
Compare tRPC, GraphQL, and REST for building type-safe APIs in 2026. Covers DX, performance, bundle size, schema management, and when to use each approach.
API Testing Best Practices 2026: Postman vs Insomnia vs Bruno
Complete guide to API testing in 2026. Compare Postman, Insomnia, and Bruno, learn best practices for REST and GraphQL testing, and build automation pipelines that catch regressions before production.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →