Openapi® CLI
The official command-line interface to interact with Openapi® APIs directly from your terminal.
openapi provides structured access to the Openapi Marketplace, including OAuth token management, scope aliases, sandbox support, and service-specific commands.
Overview
Openapi® CLI allows you to:
- Authenticate and manage OAuth tokens
- Call Openapi® services from the terminal
- Automate workflows in scripts and CI/CD pipelines
- Work with sandbox and production environments
- Use scope aliases for simplified token creation
It is designed to be predictable, script-friendly, and consistent across services.
Pre-requisites
Before using the CLI, you need:
- An active account at https://console.openapi.com/
- An API key for sandbox and/or production
- Valid credentials configured via environment variables
Installation
Install from crates.io:
Or add it to your project:
Configuration
The CLI relies on environment variables. There are two credential types depending on the command.
1️⃣ OAuth Credentials (Token Management)
Used by openapi token commands.
# optional
These credentials are used for Basic authentication when creating or managing tokens.
2️⃣ Bearer Tokens (Service Commands)
Used by service commands like sms, company, risk, etc.
# optional
Tokens are generated using:
Verify Configuration
To check your environment setup:
This displays:
- All required environment variables
- Their configured status
- Token scopes (if available)
Sandbox Mode
Use -S or --sandbox to target sandbox environments:
Token Management
# List active tokens
# List all available scopes
# Create a new token
# Filter by HTTP method
# Check credit
# Revoke a token
Supported HTTP method filters:
GET, POST, PUT, PATCH, DELETE
Aliases and method prefixes are case insensitive.
If a scope does not match an alias, it is passed through as a literal scope.
Available Services
The CLI provides commands for services including:
aiautomotivecadastrecertified-emailchamber-of-commercecompanydocuenginedomainsesignatureexchange-rategeocodinginvoicemassive-rempaying-billspdfpostal-servicereal-estaterisksdismstime-stampingtrustvisenginezip-codes
Run:
or
for full command details.
Design Principles
- Explicit over implicit
- Predictable command structure
- Script-friendly output
- Consistent behavior across services
- Environment-based configuration
License
MIT License.
Openapi® CLI — bringing Openapi® to your terminal.