Quickstart
Go from zero to a running AI agent in 5 minutes
This quickstart gets you from zero to a working AI agent in 5 minutes. You'll install MUXI, create a formation, and test it.
Prerequisites:
- Terminal access (macOS, Linux, or Windows)
- OpenAI API key (get one here)
- 5 minutes
Get started in 5 minutes
-
Install MUXI
brew install muxi-ai/tap/muxiExpected output:
==> Downloading https://github.com/muxi-ai/muxi/releases/... ==> Installing muxi ๐บ /opt/homebrew/bin/muxicurl -fsSL https://muxi.org/install | sudo bashExpected output:
[INFO] Downloading MUXI... [INFO] Installing to /usr/local/bin [INFO] MUXI installed successfullypowershell -c "irm https://muxi.org/install | iex"Expected output:
Downloading MUXI... Installing to C:\Program Files\muxi MUXI installed successfullyVerify installation:
muxi --versionExpected:
muxi version 1.0.0(or higher)Troubleshooting:
- Command not found? Restart your terminal
- macOS:
brew update && brew install muxi-ai/tap/muxi - Linux: Check PATH includes
/usr/local/bin
-
Start the Server
First time only - generate credentials:
muxi-server initExpected output:
Generated credentials: Key ID: muxi_key_abc123... Secret: muxi_secret_xyz789... โ ๏ธ Save these credentials securely! Config saved to: ~/.muxi/server/config.yamlSave these credentials! You'll need them to deploy formations remotely.
Now start the server:
muxi-server startExpected output:
[INFO] MUXI Server starting... [INFO] Listening on :7890 [INFO] Server readyLeave this terminal open - the server must stay running.
Troubleshooting:
- Port already in use?
muxi-server --port 7891 - Check logs:
muxi-server logs
- Port already in use?
-
Create a Formation
Open a new terminal:
muxi new formation my-assistant cd my-assistantThis creates:
my-assistant/ โโโ formation.afs # Main configuration โโโ agents/ # Agent definitions โโโ secrets # Required secrets template โโโ .gitignore -
Configure Secrets
muxi secrets setupEnter your OpenAI API key when prompted:
Setting up secrets for my-assistant... Required secrets: OPENAI_API_KEY (from llm.api_keys) Enter OPENAI_API_KEY: sk-... โ Secrets encrypted and saved -
Run Locally
With the server running (from Step 2), start your formation:
muxi upExpected output:
โ Started my-assistant โ Formation running on port 8001 Draft URL: http://localhost:7890/draft/my-assistant To stop: muxi downThink of
muxi up/muxi downlikedocker compose up/docker compose down- quick start/stop for local development. -
Test It
pip install muxifrom muxi import FormationClient client = FormationClient( server_url="http://localhost:7890", formation_id="my-assistant", mode="draft", # Uses /draft/ prefix for local dev ) for event in client.chat_stream({"message": "Hello!"}): if event.get("type") == "text": print(event.get("text"), end="")npm install @muxi-ai/muxi-typescriptimport { FormationClient } from "@muxi-ai/muxi-typescript"; const client = new FormationClient({ serverUrl: "http://localhost:7890", formationId: "my-assistant", mode: "draft", }); for await (const event of client.chatStream({ message: "Hello!" })) { if (event.type === "text") process.stdout.write(event.text); }go get github.com/muxi-ai/muxi-goimport muxi "github.com/muxi-ai/muxi-go" client := muxi.NewFormationClient(&muxi.FormationConfig{ ServerURL: "http://localhost:7890", FormationID: "my-assistant", Mode: "draft", }) stream, _ := client.ChatStream(ctx, &muxi.ChatRequest{Message: "Hello!"}) for chunk := range stream { if chunk.Type == "text" { fmt.Print(chunk.Text) } }gem install muxirequire 'muxi' client = Muxi::FormationClient.new( server_url: 'http://localhost:7890', formation_id: 'my-assistant', mode: 'draft' ) client.chat_stream(message: 'Hello!') do |event| print event['text'] if event['type'] == 'text' endimplementation("org.muxi:muxi-java:0.20260212.0")FormationClient client = new FormationClient( "http://localhost:7890", "my-assistant", "draft" ); client.chatStream(new ChatRequest("Hello!"), event -> { if ("text".equals(event.getType())) { System.out.print(event.getText()); } return true; });implementation("org.muxi:muxi-kotlin:0.20260212.0")val client = FormationClient( serverUrl = "http://localhost:7890", formationId = "my-assistant", mode = "draft" ) client.chatStream(ChatRequest(message = "Hello!")).collect { event -> if (event.type == "text") print(event.text) }// Package.swift .package(url: "https://github.com/muxi-ai/muxi-swift.git", from: "0.1.0")let client = FormationClient( serverURL: "http://localhost:7890", formationID: "my-assistant", mode: "draft" ) for try await event in client.chatStream(message: "Hello!") { if event.type == "text" { print(event.text ?? "", terminator: "") } }dotnet add package Muxivar client = new FormationClient( serverUrl: "http://localhost:7890", formationId: "my-assistant", mode: "draft" ); await foreach (var chunk in client.ChatStreamAsync(new ChatRequest { Message = "Hello!" })) { if (chunk.Type == "text") Console.Write(chunk.Text); }composer require muxi/muxi-php$client = new FormationClient( serverUrl: 'http://localhost:7890', formationId: 'my-assistant', mode: 'draft' ); foreach ($client->chatStream(['message' => 'Hello!']) as $event) { if ($event['type'] === 'text') echo $event['text']; }dart pub add muxifinal client = FormationClient( serverUrl: 'http://localhost:7890', formationId: 'my-assistant', mode: 'draft', ); await for (final event in client.chatStream(message: 'Hello!')) { if (event['type'] == 'text') stdout.write(event['text']); }cargo add muxi-rustlet client = FormationClient::new( "http://localhost:7890", "my-assistant", ).with_mode("draft"); let mut stream = client.chat_stream("Hello!").await?; while let Some(event) = stream.next().await { if event?.event_type == "text" { print!("{}", event.text.unwrap_or_default()); } }#include <muxi/muxi.hpp> auto client = muxi::FormationClient( "http://localhost:7890", "my-assistant", "draft" ); client.chat_stream({{"message", "Hello!"}}, [](const auto& event) { if (event.type == "text") std::cout << event.text; return true; });curl -X POST http://localhost:7890/draft/my-assistant/v1/chat \ -H "Content-Type: application/json" \ -d '{"message": "Hello!"}'Local dev โ Production: Use
mode="draft"withmuxi up, then remove it aftermuxi deployto use the live/api/endpoint.
Start from Registry
Pull a pre-built formation instead of creating from scratch:
muxi pull @muxi/hello-muxi
cd starter-assistant
muxi secrets setup
muxi dev
Browse registry.muxi.org to discover community formations.
What You Built
graph LR
A[Your App] -->|HTTP/SDK| B[MUXI Server :7890]
B --> C[Formation :8001]
C --> D[Agent: assistant]
D --> E[OpenAI GPT-5]
You now have:
- A MUXI Server managing formations
- A Formation with one agent
- An API ready for integration
Want to understand how this all works? See How MUXI Works for the full architecture and request flow.
Common First Issues
Port already in use
# Find what's using the port
lsof -i :7890
# Use a different port
muxi-server --port 7891
Command not found after install
Restart your terminal, or check your PATH:
# macOS/Linux
echo $PATH | grep -E "(homebrew|local/bin)"
# Add to PATH if needed
export PATH="$PATH:/usr/local/bin"
Server won't start
# Check if already running
ps aux | grep muxi-server
# View logs
muxi-server logs
API key errors
# Verify secret is set
muxi secrets get OPENAI_API_KEY
# Re-run setup
muxi secrets setup
For more issues, see the Troubleshooting Guide.