Quickstart
From a fresh shell to your first dispatched MAP call in under five minutes.
This guide gets you to a verified dispatched call against MAP — MACS.auth_negotiation — using the CLI, then walks the same call through the Rust and TypeScript SDKs.
Prerequisites
- A MAP API key. Request one at pricing.
- An OAS DID for your caller agent (the API key onboarding flow provisions one if you don't have it).
- For the CLI:
cargoor a pre-built binary. - For the Rust SDK: a workspace with
tokioavailable. - For the TypeScript SDK: Node 20+ or Bun 1.1+.
Install the CLI
cargo install --git https://github.com/l1fe-ai/map map-clicurl -fsSL https://get.multiagentic.dev | sh
# Adds `map` to ~/.local/bin# The CLI is Rust-native; npm/bun cannot install it directly.
# Use cargo or the curl installer above.The CLI binary is map. The Rust crate that builds it is services/map-cli.
Authenticate
Run map login
map login --auth-url https://auth.l1fe.aiThe CLI spawns a local callback server on 127.0.0.1:8600, opens your browser to the OAuth2 PKCE authorization endpoint, and exchanges the authorization code for access_token + refresh_token.
Provision an API key
The CLI calls the provisioner endpoint to mint an API key bound to your DID. The result is stored in ~/.map/config.json:
{
"auth_url": "https://auth.l1fe.ai",
"api_url": "https://api.multiagentic.dev",
"agent_did": "did:oas:l1fe:agent:0xa3f9c1a4...",
"access_token": "...",
"refresh_token": "...",
"api_key": "map_live_..."
}Your first dispatched call
map invoke MACS auth_negotiation --input '{
"profile": "DidAuth",
"challenge_kind": "Nonce"
}'You should receive a Response { data, metadata } envelope back. The shape is defined in engine/common/src/lib.rs:
pub struct Response {
pub data: Value,
pub metadata: Option<HashMap<String, Value>>,
}If the call succeeded, you've passed all eight stages of the dispatch pipeline: version resolution, context enrichment, rate limiting, security gating, circuit breaking, load balancing, router invocation, and result handling.
Same call through the SDKs
# Cargo.toml
[dependencies]
macs-sdk = { git = "https://github.com/l1fe-ai/map", package = "macs-sdk" }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }use macs_sdk::MacsClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = MacsClient::from_env()?; // reads ~/.map/config.json or MAP_API_KEY
let resp = client.auth_negotiation(
macs_sdk::AuthNegotiationPayload {
profile: macs_sdk::AuthProfile::DidAuth,
challenge_kind: macs_sdk::ChallengeKind::Nonce,
}
).await?;
println!("{resp:#?}");
Ok(())
}bun add @l1fe/mind-wm
# MACS client is bundled in the same SDK familyimport { MapClient } from '@l1fe/mind-wm/map';
const map = new MapClient({
apiKey: process.env.MAP_API_KEY!,
agentDid: process.env.MAP_AGENT_DID!
});
const response = await map.dispatch({
protocol: 'MACS',
version: 'v1.0.0',
operation: 'auth_negotiation',
input: { profile: 'DidAuth', challenge_kind: 'Nonce' }
});
console.log(response);