Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
MUBIT_API_KEY | yes | — | API key in format mbt_<instance>_<key_id>_<secret> |
MUBIT_ENDPOINT | no | https://api.mubit.ai | Base endpoint for both HTTP and gRPC (SDK resolves protocol automatically) |
MUBIT_TRANSPORT | no | auto | Transport selection: auto, http, or grpc |
MUBIT_HTTP_ENDPOINT | no | https://api.mubit.ai | Override HTTP-specific endpoint |
MUBIT_GRPC_ENDPOINT | no | grpc.api.mubit.ai:443 | Override gRPC-specific endpoint |
MUBIT_ENDPOINT is set, it serves as the default for both HTTP and gRPC. The protocol-specific overrides (MUBIT_HTTP_ENDPOINT, MUBIT_GRPC_ENDPOINT) take precedence when set.
Transport selection
Thetransport option controls how the SDK communicates with MuBit:
| Value | Behavior |
|---|---|
auto (default) | SDK probes the endpoint and selects gRPC if available, falling back to HTTP |
http | Force HTTP/REST transport |
grpc | Force gRPC transport |
- Python
- Node / TS
- Rust
Endpoint defaults
| Context | HTTP endpoint | gRPC endpoint |
|---|---|---|
| Hosted (production) | https://api.mubit.ai | grpc.api.mubit.ai:443 |
| Hosted (dev) | https://api.dev.mubit.ai | grpc.api.dev.mubit.ai:443 |
| Local | http://127.0.0.1:3000 | 127.0.0.1:50051 |
Constructor options
Beyond environment variables, SDK constructors accept these options:| Option | Type | Description |
|---|---|---|
api_key | string | API key (overrides MUBIT_API_KEY) |
endpoint | string | Base endpoint (overrides MUBIT_ENDPOINT) |
transport | string | Transport selection (overrides MUBIT_TRANSPORT) |
run_id | string | Default run ID for all operations |
agent_id | string | Default agent ID |
user_id | string | Default user ID for scoping |
Resolution order
Configuration resolves in this order (first wins):- Explicit constructor argument
- Protocol-specific env var (
MUBIT_HTTP_ENDPOINT/MUBIT_GRPC_ENDPOINT) - Base env var (
MUBIT_ENDPOINT) - Built-in default (
https://api.mubit.ai)
Next steps
- See Getting started for quick setup.
- See gRPC Transport Guide for gRPC-specific guidance.
- See Control HTTP reference for the full HTTP API surface.