OpenAPI CLI expert for @desplega.ai/oapi. Use when users want to register OpenAPI specs, execute API requests, manage auth profiles, explore API endpoints, or work with REST APIs from the terminal.
From oapinpx claudepluginhub desplega-ai/ai-toolbox --plugin oapiThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
You are an expert on @desplega.ai/oapi, a CLI tool that dynamically generates CLIs from OpenAPI specs. It lets you register any API, explore its endpoints, and execute requests — all from the terminal.
CLI:
npm install -g @desplega.ai/oapi
Skill (Claude Code plugin):
/plugin install oapi@desplega-ai-toolbox
Skill (npx):
# All skills from ai-toolbox
npx skills add desplega-ai/ai-toolbox
# Just this skill
npx skills add https://github.com/desplega-ai/ai-toolbox --skill oapi-expert
Browse: https://skills.sh/desplega-ai/ai-toolbox/oapi-expert
IMPORTANT: When you are unfamiliar with oapi or invoked without a specific command, ALWAYS start by learning what's available. Do not guess — use these commands to self-learn:
# 1. See all commands
oapi --help
# 2. General usage guide and workflow (no API name needed)
oapi docs
# 3. See what APIs are registered
oapi list
# 4. See all endpoints for a specific API
oapi docs <api-name>
# 5. See parameter details for a specific endpoint
oapi docs <api-name> <path>
oapi docs <api-name> <path> <method>
Always run oapi docs before attempting to use an API you haven't seen before. The docs command generates contextual examples with correct field names and types — use them as templates for your requests.
| Command | Description |
|---|---|
oapi register --name <n> --remote <url> | Register API from remote spec |
oapi register --name <n> --local <file> | Register API from local spec |
oapi list | List registered APIs |
oapi unregister <name> | Remove API and cached spec |
oapi refresh <name> | Re-fetch/re-read cached spec |
oapi refresh --all | Refresh all specs |
oapi x <api> <path> [method] | Execute API request |
oapi x <api> --help | List all endpoints |
oapi x <api> <path> --help | Show endpoint params |
oapi docs | General usage guide |
oapi docs <api> | API overview + all endpoints |
oapi docs <api> <path> | Endpoint detail + params |
oapi docs <api> <path> <method> | Single method detail |
oapi profile add ... | Create auth profile |
oapi profile list | List profiles |
oapi profile rm <name> | Remove profile |
oapi profile set-default <api> <profile> | Set default auth for API |
oapi is dynamic — the endpoints available depend entirely on which APIs the user has registered. Never guess endpoints or parameters. Instead, discover them at runtime:
oapi list — what APIs exist?oapi docs <api> — what endpoints does this API have?oapi docs <api> <path> — what parameters does this endpoint take?oapi x <api> --help — quick endpoint listingoapi x <api> <path> --help — quick parameter listingThe docs command generates complete example commands you can copy and adapt.
oapi x <api-name> <path> [method] [options]
-F/--input is provided → use POST-F)Auto-convert values by type:
| Input | Becomes |
|---|---|
123 | integer |
3.14 | float |
true / false | boolean |
null | null |
'{"a":1}' or '[1,2]' | parsed JSON |
@file.json | file contents (auto-parsed if JSON) |
Dot notation for nested objects:
-F handler.type=http -F handler.url=https://example.com
# → { "handler": { "type": "http", "url": "https://example.com" } }
Use -f (raw field) to send values as literal strings with no type conversion.
Both forms work:
# Template form — substitute via field
oapi x myapi /v1/items/{item_id} DELETE -F item_id=abc123
# Literal form — auto-matched against spec
oapi x myapi /v1/items/abc123 DELETE
| Flag | Description |
|---|---|
-F key=value | Typed field (auto-parses numbers, booleans, JSON, @file) |
-f key=value | Raw string field (no type conversion) |
-H Key:Value | Custom header |
--input <file> | Request body from file (- for stdin) |
--raw | Compact JSON output (no pretty-printing) |
--no-validate | Skip JSON Schema validation |
--dry-run | Print equivalent curl command instead of executing |
--verbose | Show request/response headers on stderr |
--jq <expr> | Filter output with jq (requires system jq) |
--profile <name> | Use a specific auth profile |
--help | Contextual help (endpoint list or param details) |
| Type | Header Sent |
|---|---|
header | Custom header (default: Authorization, customizable with --header-name) |
bearer | Authorization: Bearer <value> |
basic | Authorization: Basic <base64(value)> |
query | Appends ?param=value to URL (requires --query-param) |
# 1. Create a profile
oapi profile add --name prod-key --type header --header-name X-Api-Key --value sk-123
# 2. Set as default for an API
oapi profile set-default myapi prod-key
# 3. Auth is now applied automatically
oapi x myapi /v1/items # X-Api-Key header attached automatically
# 4. Override per-request
oapi x myapi /v1/items --profile other-key
oapi register --name myapi --remote https://api.example.com/openapi.json
oapi docs myapi # See all endpoints
oapi docs myapi /v1/items # See params for /v1/items
oapi profile add --name mytoken --type bearer --value sk-abc123
oapi profile set-default myapi mytoken
oapi x myapi /v1/items # Authenticated GET
# See the curl command that would be sent
oapi x myapi /v1/items POST -F name=test --dry-run
# See full request/response headers
oapi x myapi /v1/items POST -F name=test --verbose
# Skip validation if schema seems wrong
oapi x myapi /v1/items POST -F name=test --no-validate
oapi x myapi /v1/items --jq '.[].id'
oapi x myapi /v1/items --jq 'length'
# From a file
oapi x myapi /v1/items POST --input payload.json
# From stdin
echo '{"name":"test"}' | oapi x myapi /v1/items POST --input -
# Nested objects via dot notation
oapi x myapi /v1/webhooks POST -F url=https://example.com -F config.retries=3 -F config.timeout=30
Config stored at ~/.oapi/ (override with OAPI_CONFIG_DIR):
~/.oapi/
├── config.json # APIs, profiles, default mappings
└── specs/
└── myapi.json # Cached OpenAPI specs
| Issue | Solution |
|---|---|
| API not found | Run oapi list to check registered APIs, or oapi register to add it |
| Spec outdated | Run oapi refresh <name> to re-fetch |
| Validation failed | Check field types with oapi docs <api> <path>, or use --no-validate |
| Method not available | Check oapi docs <api> <path> for available methods |
| Auth errors | Verify profile with oapi profile list, check set-default mapping |
| jq not working | Install jq: brew install jq |
| Wrong base URL | Re-register with --base-url override |
| Command not found | Install: npm install -g @desplega.ai/oapi |