New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@xapi-to/xapi

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xapi-to/xapi

Agent-friendly CLI for xapi - discover and call capabilities and APIs

latest
npmnpm
Version
0.1.7
Version published
Weekly downloads
12
-60%
Maintainers
3
Weekly downloads
 
Created
Source

xapi-cli

Agent-friendly command-line interface for xAPI — discover and call capabilities and APIs from your terminal or AI agent.

Installation

# Via npx (no install needed)
npx @xapi-to/xapi --help

# Or install globally with bun
bun add -g @xapi-to/xapi

# Or from source
cd xapi-cli && bun install

Quick Start

# 1. Register a new account (apiKey saved automatically)
xapi register

# 2. Or set an existing key
xapi config set apiKey=sk-xxx

# 3. Or via env var
export XAPI_API_KEY=sk-xxx

# 4. Verify connectivity
xapi config health

Usage

xapi <command> [args] [flags]

Action Commands

Unified interface for capabilities (built-in) and APIs (third-party). Use --source capability|api to filter.

xapi list                                            # list all actions
xapi list --source capability                        # only built-in capabilities
xapi list --source api --category DeFi               # filter by source and category
xapi list --page 2 --page-size 20                    # pagination
xapi list --service-id <id>                          # filter by service

xapi search "twitter"                                # search by keyword
xapi search "token price" --source api               # search APIs only

xapi categories                                      # list all categories
xapi categories --source capability                  # categories for capabilities only

xapi services                                        # list all services
xapi services --category Social --page-size 10       # filter and paginate

xapi get twitter.tweet_detail                        # get action schema
xapi call twitter.tweet_detail --input '{"tweet_id":"1234567890"}'  # execute

OAuth

Bind third-party OAuth accounts (e.g. Twitter) to your API key.

xapi oauth bind --provider twitter                   # bind Twitter account
xapi oauth status                                    # list current bindings
xapi oauth unbind <binding-id>                       # remove a binding
xapi oauth providers                                 # list available providers

Account

xapi register                                        # create account, saves apiKey automatically
xapi balance                                         # show xToken balance
xapi topup                                           # generate payment URL
xapi topup --method stripe --amount 10               # stripe, $10
xapi topup --method x402                             # x402 (USDC on Base)

Config

xapi config show                                     # show current config
xapi config set apiKey=sk-xxx                        # save API key
xapi config health                                   # check backend connectivity

Workflow: Always GET before CALL

Before calling any action, always read its schema first to understand required parameters:

# 1. Find the action
xapi search "twitter"

# 2. Read its schema
xapi get twitter.tweet_detail

# 3. Call with correct parameters
xapi call twitter.tweet_detail --input '{"tweet_id":"1234567890"}'

Output Formats

All output is JSON by default — designed for agent consumption.

xapi list --format json                              # default, machine-readable
xapi list --format pretty                            # pretty-printed JSON
xapi list --format table                             # human-readable table

Environment Variables

VariableDescription
XAPI_API_KEYAPI key (overrides config file)
XAPI_ACTION_HOSTAction service host (default: action.xapi.to)
XAPI_OUTPUTDefault output format (json|pretty|table)

Config is stored at ~/.xapi/config.json.

Built-in Capabilities

IDDescription
twitter.tweet_detailGet tweet details and replies
twitter.user_by_screen_nameGet user profile by username
twitter.user_by_screen_namesBatch get user profiles by usernames
twitter.user_tweetsGet tweets from a user
twitter.user_mediaGet media posts from a user
twitter.followingGet user following list
twitter.followersGet user followers
twitter.retweetersGet tweet retweeters
twitter.search_timelineSearch tweets, users, photos, videos
ai.text.chat.fastFast AI chat completion
ai.text.chat.reasoningAdvanced reasoning chat
ai.text.summarizeSummarize long text
ai.text.rewriteRewrite text with different styles
ai.embedding.generateGenerate vector embeddings
web.searchWeb search
web.search.realtimeRealtime web search with time filters
news.search.latestLatest news search
crypto.token.priceCrypto token price and changes
crypto.token.metadataCrypto token metadata

Security

  • NEVER send your API key to any domain other than *.xapi.to
  • The key is stored at ~/.xapi/config.json — do not expose this file
  • topup outputs a payment URL containing the API key — do not share publicly

License

MIT

FAQs

Package last updated on 10 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts