TypeScript SDK
Choose your integration.
Compatibility and upgrades
Check runtime requirements and versioning.
SDK 0.6.1
- An aborted call that used an idempotency key (
run, execution commands, and Admin API key issuance) tells you to recover with the original key, and keeps the responsestatusandrequestId. - A
ConnectionErrorraised after response headers arrive keepsstatusandrequestId.
CLI 0.2.1
- Requests name the CLI and its version in the
X-AgentMuxer-Clientheader, so support can find your calls. - The update check runs at most once a day, including when you are offline, and still shows a newer release it already knows about.
- Uses SDK 0.6.1.
SDK 0.6.0
Breaking changes:- The client is a class. Replace
createClient()withnew AgentMuxer()from@agentmuxer/sdk, andcreateAdminClient()withnew AgentMuxerAdmin()from@agentmuxer/sdk/admin. The@agentmuxer/sdk/cliententry is removed. - Methods take
(input, options?). Pass an abort signal as{ signal }instead of a positional argument. A caller abort throwsAgentMuxerErrorwith kind"aborted". - Refusal reasons,
refusedBy,credentialKind, and balancestatusare open string types. Add adefaultbranch to exhaustiveswitchstatements. - The framework adapters’
AgentMuxerOptionstypes are renamed toOpenAIAgentsOptions,ClaudeAgentOptions, andAISDKOptions.
runneeds only a provider, path, and inputs.methodis optional when the path serves one method, and the maximum cost defaults to $1.00. PassmaxCost: "0.25"as a USD string instead ofmaxCostMicros.search,inspect,run,getInvocation,accountStatus, and execution handle reads retry lost connections, timeouts, rate limits, and gateway errors twice by default, honoringRetry-After.runresends the same idempotency key, so a retry never charges twice.- Set
timeout(100 seconds by default) andmaxRetriesper client or per call, and pass a customfetchto either client. - New
ConnectionError,ConnectionTimeoutError,RateLimitError, andRefusalErrorclasses, andthrowOnRefusalto throw for any result other thanresponded. accountStatus(),inspectwithview: "call_ready",requestIdon results, andrequire()support for the root,/contracts, and/adminentries.- Validation errors name the failing field.
CLI 0.2.0
Breaking changes:installrun by an agent or without a terminal no longer signs in the CLI. It waits up to 330 seconds for browser approval, exits 0, and prints each remaining step as anOwner action:line. Runagentmuxer loginbefore using API commands there, andstatusto confirm setup.- With no coding agent detected,
installexits 1 and points to SKILL.md. statusexits 0 when a coding agent is set up and the CLI is not signed in, printingCLI: not signed in. Scripts that call the API should check for that line or runagentmuxer login.- A flag given to a command it doesn’t apply to now fails with an error that names it.
- Agents can run setup themselves.
installasks no questions, configures every detected coding agent, starts sign-in for the agent it runs in, and hands the remaining steps to you.--no-cli-loginskips only the CLI sign-in. run PROVIDER PATHneeds only the provider, path, and inputs.--methodis optional when the path serves one method, and the maximum cost defaults to $1.00.run --querytakes a JSON object of query parameters.inspect --view call_readyshows the compact request view.- API commands retry lost connections, timeouts, rate limits, and gateway errors up to twice with the same idempotency key, so a retry never charges twice.
agentmuxer help, fuller help for every API command, and a once-a-day notice when a newer release is available. SetAGENTMUXER_NO_UPDATE_CHECK=1to turn the notice off.- Licensed under MIT. Uses SDK 0.6.0.
One-line agent setup
- Paste
Set up AgentMuxer from https://agentmuxer.com/SKILL.mdinto your coding agent. It runs setup, then relays the sign-in steps for you to finish in the same conversation.
Simpler calls
maxCostMicrosis optional oncall_offering. Each call’s maximum defaults to $1.00, andmaxCosttakes a USD string such as"0.25"as an alternative to micros.methodis optional oncall_offeringandinspect_offeringwhen the path serves one method. When a path serves several, the response lists the methods to choose from.- Invalid arguments name the failing field.
SDK 0.5.0
- New
@agentmuxer/sdk/adminentry for the Admin API, with typed methods for the account balance, applications (create or get by your own external id, list, update, cap, disable), application keys (create, rotate with a grace period, revoke), and usage. SDK 0.6.0 renamescreateAdminClienttonew AgentMuxerAdmin(). - The package includes the Admin API’s OpenAPI description (
admin-api.openapi.json) and a runnable platform integration example. - Results for application keys omit the account-wide balance (
billing.balanceMicros), and account status reportsbalance: null. The CLI sign-in still shows your balance. - Responses from search, inspect, run,
getInvocation, and execution handles accept fields added by newer servers. - An invalid
baseUrlthrowsAgentMuxerErrorwith kindinvalid_request.
CLI 0.1.3
agentmuxer statusaccepts account fields added by newer servers. Uses SDK 0.5.0.
Team accounts
- Invite teammates from the dashboard’s Members page. Members use the account’s credits with their own agents, and admins also manage applications and members. Invitation links work for the invited email address and stay valid for 7 days.
Call-ready inspection
inspect_offeringreturns a compact, call-ready view of each request: the fields, types, and locations your agent needs for a valid first call.
Admin API
- Manage your account from your servers at
https://api.agentmuxer.com/v1/adminwith an admin key created on the dashboard’s Applications page. Create one application per customer company, cap its spending, issue and rotate its keys, and read usage. - Admin keys manage applications, and application keys make calls. All applications draw on your account’s balance.
SDK 0.4.0
- Execution handles (
client.execution(...)) attach to an existing call to wait for its result, stream its progress, follow a provider job that continues after its first response, resume a pending approval, and stop following. - The
partitionoption separates calls and results per end user within one application key. Derive it from your own authenticated users. - The Vercel AI SDK connection exposes AgentMuxer’s
instructions, validates purchase arguments before the tool runs so the model can correct them, and accepts a trusted server-sidemcpUrl. - The initialization signal and deadline also cover tool discovery.
SDK 0.3.1
- Type-checking fix for the Vercel AI SDK adapter. Runtime behavior and public interfaces are unchanged.
CLI 0.1.1 and 0.1.2
- Simpler installed guidance: agents call
search_offeringswithout extra options. - Uses SDK 0.3.1 and 0.4.0.
CLI 0.1.0
Initial release of@agentmuxer/cli, which replaces @agentmuxer/setup and the agentmuxer command from SDK 0.2.install,status, andremoveset up AgentMuxer’s hosted MCP server and guidance in Codex, Claude Code, and OpenCode, using each client’s own sign-in.loginandlogoutsign the CLI in through your browser and keep credentials in the OS keyring.search,inspect,run, andgetcall AgentMuxer from a terminal or script.- To move from setup, run
npx -y @agentmuxer/cli@latest install.
SDK 0.3.0
accessTokenis accepted instead ofapiKeyfor an already-issued AgentMuxer access token.- New
@agentmuxer/sdk/contractsentry with the request types and validators.
Call APIs by provider and path
search_offeringsreturns operations as provider, method, and path addresses.inspect_offeringandcall_offeringtake that address, with path values inpathParamsand inputs inquery,headers,cookies, orbody.- Call a known operation directly, without searching first.
- New
get_invocationtool recovers a lost response or checks a pending call byinvocationIdor the originalidempotencyKey, at no charge.
Search ranking
search_offeringsranks results by how closely each operation fits your query.
SDK 0.2.1
- Vercel AI SDK transport errors use the MCP client’s error classes.
- Manual purchase confirmation can pause and resume on a later authenticated request, keeping the original purchase and tool call.
- Vercel AI SDK tool calls allow 100 seconds.
SDK 0.2.0
- A direct API client with no framework dependency, addressing operations by provider, method, and path.
- Automatic recovery keys on every call, and explicit original keys for accepting changed terms.
- Typed discovery, inspection, invocation results, and read-only invocation lookup.
- An
agentmuxercommand with JSON, file, and stdin input. It moved to@agentmuxer/clion September 23. - Framework adapter imports and authentication are compatible with 0.1.0.
Payment confirmation per application
- Choose on the dashboard’s Applications page whether each application’s paid calls follow the account default, require confirmation, or run unattended within your spending limits. See billing and approvals.
Structured pricing
- Search results show structured pricing for each operation: a fixed total, a unit rate, an observed estimate, or an unknown price.
SDK 0.1.0
Initial release of@agentmuxer/sdk.- Connect OpenAI Agents, Claude Agent SDK, and Vercel AI SDK to AgentMuxer.
- Authenticate with an application key through
AGENTMUXER_API_KEYorapiKey. - Give agents discovery and purchase tools, subject to balance, spending limits, and payment confirmation settings.
- Use TypeScript and ESM on Node.js 22.18 or later.
Setup 0.1.4 to 0.1.6
- Setup detects which supported clients are installed and adds AgentMuxer guidance to each one’s global instructions.
- Concurrent setup runs wait their turn, and each configuration file is updated atomically.
removecleans up configuration left behind after you uninstall a client.
Price confirmation through your agent
- When a call’s price is above your maximum,
call_offeringreturns the exact terms. To accept them, repeat the call with the same arguments plusacceptTermsfromnextAction. See the MCP tool reference.
Setup 0.1.2 and 0.1.3
- Setup keeps your existing sign-ins and client registrations, including OpenCode credentials after an access token expires.
statusrecognizes Claude Code’s connected status.
Sign-in on connect
https://mcp.agentmuxer.com/mcpasks for sign-in when a client first connects, so discovery and paid calls both run under your account. Clients that support MCP authorization start the browser sign-in for you.
Setup 0.1.1
- Setup treats sign-in as a required step and guides you through it.
Setup 0.1.0
Initial release of@agentmuxer/setup.install,status, andremoveconnect Codex, Claude Code, and OpenCode to AgentMuxer’s hosted MCP server. See connect your agent.- Setup preserves your existing client settings and rolls back cleanly if a step fails.