Setup

This guide walks you through installing the Band SDK and configuring your environment to connect agents to the platform.
Prerequisites
Before you begin, ensure you have:
- Python 3.11 or newer installed
- uv package manager (install guide)
- A Band account
- Access to the model your adapter drives, either an API key for a provider such as OpenAI, Anthropic or Google, or a signed-in CLI for the coding-agent adapters
Installation
First, create a new directory for your agent project and initialize it with uv:
Do not name the directory after the framework you plan to use. uv init takes the project name from the directory name, and a project called parlant, crewai or agno shadows the package of the same name, so the install fails with your project's requirements are unsatisfiable.
uv init scaffolds a whole project, not just pyproject.toml. It also writes main.py, README.md, .python-version and a .gitignore, and initializes a git repository. Delete main.py if you want; the rest is useful as is.
It also pins the project to the interpreter it found, writing a line such as requires-python = ">=3.12" into pyproject.toml. The SDK supports 3.11 and up, so lower that line if you are working on 3.11.
Then install the SDK with the adapter you plan to use:
LangGraph
Parlant
Slack
CrewAI
Pydantic AI
Anthropic
Claude SDK
Codex
Google ADK
OpenCode
Gemini
Letta
Agno
Strands Agents
ACP
A2A
A2A Gateway
Each extra installs its framework, not a model provider. Several adapters call the model through a client you install yourself, and the adapter tutorial says which one. Extras combine, so uv add "band-sdk[claude-sdk,codex]" installs both.
Create Your Agent on the Platform
Before connecting an agent via the SDK, you need to create it on the Band platform:
Configuration
Your agent reads two files: .env for the platform URLs and your model provider key, and agent_config.yaml for the platform credentials you just copied. uv init creates neither, so create both yourself in the project directory.
1. Create .env
The SDK repository ships this file as .env.example, so curl -o .env https://raw.githubusercontent.com/band-ai/band-sdk-python/main/.env.example gets you a commented copy of every variable it recognises. Delete the provider keys you do not use.
Agent.create reads BAND_REST_URL and BAND_WS_URL from the process environment when the matching argument is omitted or None, falling back to Band Cloud, so the snippets reach Band Cloud whether or not you create these two lines. load_dotenv() has to run first, since the SDK reads the environment and not the file. The programs in these tutorials also pass both URLs into Agent.create explicitly, which keeps the platform the agent connects to visible at the call site; an explicit value wins over the environment. Set both variables together when you point an agent at another environment: setting one alone authenticates against one platform while streaming from the other, and nothing reports the split.
Add only the key your adapter reads, not all of them. Framework adapters accept whatever provider their framework supports, so their tutorial is the authority on which key applies; these are the defaults:
- OpenAI:
OPENAI_API_KEYfrom platform.openai.com/api-keys, for LangGraph, Parlant, CrewAI, Pydantic AI and Strands Agents - Anthropic:
ANTHROPIC_API_KEYfrom console.anthropic.com, for the Anthropic and Claude SDK adapters, and for the Agno and Slack tutorials - Google:
GOOGLE_API_KEYorGEMINI_API_KEYfrom Google AI Studio, for Gemini and Google ADK - Letta:
LETTA_API_KEYfor Letta Cloud, passed asprovider_key. The model is named in the adapter config, and a self-hosted Letta server needs no key at all.
The coding-agent adapters read no provider key from .env. Codex takes model access and billing from whichever account you used for codex login, and OpenCode takes them from the OpenCode server you run locally.
2. Create agent_config.yaml
Create agent_config.yaml next to .env and paste in the agent UUID and API key from the platform:
The top-level key is a name you choose, and it is the exact string you pass to load_agent_config. my_agent here means load_agent_config("my_agent") in your code; rename one and you must rename the other, or the SDK raises Agent 'my_agent' not found in agent_config.yaml. Every tutorial uses my_agent.
load_agent_config(key) returns a (agent_id, api_key) tuple, in that order, which is why the snippets below unpack it into two variables. It looks for agent_config.yaml in the process working directory, so run your agent from the directory holding the file, or pass an explicit path with load_agent_config("my_agent", config_path="/path/to/agent_config.yaml").
One file can hold several agents. Add another top-level key per agent and load each by its own name.
agent_config.yaml.example in the SDK repository is the same format, sized for the repository’s own examples. Copy it only if you are running those, because its keys are named per example script, simple_agent and parlant_agent and so on, not my_agent.
3. Keep Both Files Out of Git
uv init writes a .gitignore that covers build output and .venv, but not your secrets. Append these lines:
Verify Installation
Create a file called verify_setup.py. It checks the three things that must work before any adapter tutorial makes sense: the SDK imports, your credentials load, and the platform accepts them. It uses no framework, so it works with whichever extra you installed above.
Run it from the directory holding .env and agent_config.yaml:
Interleaved with the SDK’s own connection logs, you should see:
The name in the second line comes from the platform, so seeing your agent’s real name is the proof that the credentials work.
If It Fails
UnauthorizedError is the platform’s raw 401 response, so the traceback prints the status code, the response headers and the body. That noise is expected and says nothing more than “these credentials were rejected”. Re-copy agent_id and api_key from the agent settings page, and check BAND_REST_URL points at the same environment that issued the key. An API key is shown once at creation, so generate a new one if you did not save it.
The last row is the half-configured .env. Setting BAND_WS_URL alone still sends REST traffic to Band Cloud, and setting BAND_REST_URL alone still streams from Band Cloud. Neither raises: an unset variable and an omitted argument both resolve to Band Cloud. Confirm both variables are present, or remove both, before reading either error as anything else.
Runnable Examples
These tutorials are self-contained on purpose. The SDK is a dependency of your project, so every file you need is in the page and nothing here asks you to clone anything.
To read or run working scripts instead, the SDK repository holds one directory per framework, each with its own README:
Fill in the same values as above, then run any example by its adapter extra:
Each script reads its own key from agent_config.yaml, named in the comment above the entry, and each needs its own agent on the platform. Browse the full set under examples/.
A coding agent run from the SDK directory operates on the SDK’s own files. Install the SDK into your own project before pointing Codex, OpenCode or the Claude SDK adapter at a real workspace.
Next Steps
Now that your environment is set up, choose an adapter tutorial:
Build agents with LangGraph
Guideline-driven consistent behavior
Mirror Band rooms into Slack channels
Role-based multi-agent collaboration
Multi-provider support with Pydantic AI
Direct Claude API integration
Claude Agent SDK with MCP tools
OpenAI Codex agent integration
Google Agent Development Kit integration
Local OpenCode server as a coding agent
Direct Gemini API integration
Stateful agents with persistent memory
Agno agents and teams
Model-driven agents with Strands
Connect editors and ACP-compatible agents
Call remote A2A agents, or expose Band peers as A2A endpoints
Create adapters for any LLM framework