Prerequisites
- Python 3.9+
- A Sail API key
- The Sail SDK:
pip install sail
Step 1: install + auth
SAIL_API_KEY always wins. When it is unset, the SDK uses the credential
stored by sail auth login under ~/.sail.
Step 2: write the minimal Voyage
run() emits voyage.completed when the block exits cleanly. If the block
raises, it emits voyage.failed and re-raises. No try/except needed.
Step 3: run it
Step 4: verify in the dashboard
Open the printed URL. You should see:- Status:
voyage completed - Agents: 1 (
Researcher) - Events: 2 (
hello.fired,inference.done) - Model calls: 1 (
zai-org/GLM-5.2-FP8, statuscompleted) - Execution Trace: one agent block with one span, two events nested underneath, one model row.
Decorators
For function-shaped work, decorate instead of nesting context managers. You get the same events, spans, and attribution:What to do next
- Add a Sailbox: see the Sailboxes guide for creating a
long-running sandboxed VM, then pass
sailbox_id=sb.sailbox_idtosail.voyage.create()so the Voyage is bound to that Sailbox. - Prefer an agent-guided setup? Use the Sail skills package and ask your coding agent to build or instrument a background agent with Voyage telemetry.
- Add a second agent: see Voyages Patterns → Multi-agent.
- Something looking wrong? Install the
Sail skills and use the
sail-voyage-debuggingskill.
Common first-run gotchas
- Voyage doesn’t appear in dashboard. Make sure
SAIL_API_KEYis set to a valid Sail API key (sk_...). Events are recorded against the key’s org, so a missing or wrong-org key means nothing shows up. - Process exits without a terminal event. The Voyage stays
“in progress” forever (a bounded best-effort flush at exit delivers
trailing events, but can still drop them if the network is down. It also
never marks the Voyage terminal). Use
with sail.voyage.run(...)so the terminal state is emitted for you, or callvoyage.complete()/voyage.fail()yourself. - Unexpected “auto” spans. If a Sail inference call or Sailbox exec runs
inside a Voyage with no active span, the SDK creates a timed span for it
automatically. That is expected. Add
@sail.span(...)only when you want to choose the step name yourself. CERTIFICATE_VERIFY_FAILEDon macOS Python. Some python.org installs do not have a usable root CA bundle. Installcertifiand point Python at it:python -m pip install certifi, thenexport SSL_CERT_FILE="$(python -c 'import certifi; print(certifi.where())')".- Unsupported model. Use a model id from Sail, not necessarily the model
your coding agent is using. Start with
zai-org/GLM-5.2-FP8; to list your account’s available models, callGET https://api.sailresearch.com/v1/modelswith yourSAIL_API_KEY.