Use Xantly with OpenHands

OpenHands (formerly OpenDevin) is an autonomous coding agent. LiteLLM-backed, any OpenAI-compatible gateway just works. Three env vars and it routes through Xantly.

OpenHands (formerly OpenDevin) is an autonomous coding agent, give it a task, it reads your code, runs commands, writes patches. Under the hood it uses LiteLLM for LLM dispatch, which means any OpenAI-compatible gateway just works. Xantly plugs in with three env vars.

Prerequisites

Setup

OpenHands reads LiteLLM-style env vars. Set these before running:

export LLM_API_KEY=xantly_sk_...
export LLM_BASE_URL=https://api.xantly.com/v1
export LLM_MODEL=openai/xantly/auto-quality

Note the openai/ prefix, LiteLLM expects <protocol>/<model>.

Then run:

docker run -it --rm \
  -e LLM_API_KEY \
  -e LLM_BASE_URL \
  -e LLM_MODEL \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v $HOME/.openhands-state:/.openhands-state \
  -p 3000:3000 \
  docker.all-hands.dev/all-hands-ai/openhands:latest

Open http://localhost:3000 → OpenHands UI loads, with Xantly as the configured provider.

Configure in UI

Alternative to env vars, once OpenHands is running, open Settings:

FieldValue
LLM Provideropenai
LLM Modelopenai/xantly/auto-quality
Base URLhttps://api.xantly.com/v1
API Keyxantly_sk_...

Save. Restart the agent for the settings to stick.

First task

In the OpenHands UI, start a new session and give it a goal:

Clone github.com/tiangolo/fastapi, run the test suite, summarize failures.

OpenHands spins up a sandboxed Docker container, pulls the repo, runs pytest, reads output, summarizes. Every LLM call in that flow routes through Xantly.

Model choice

Model IDWhen
openai/xantly/auto-qualityAgent default, reliable tool-calling.
openai/anthropic/claude-sonnet-4.6Best tool-calling for long agent runs.
openai/openai/gpt-5.4Tight structured outputs.
openai/xantly/auto-valueBudget-conscious long runs.

Don't use xantly/auto-speed for OpenHands, speed-tier models trade tool-calling reliability for latency, and OpenHands relies heavily on tool calls.

Verify

Give the agent a trivial task:

Print "pong" to the console using bash.

OpenHands should fire a run_bash tool call → see pong → return. Check your Xantly dashboard for the logged call.

What you get

Gotchas

Prefix ambiguity: openai/xantly/auto-quality. LiteLLM requires the protocol prefix. Full slug is openai/<xantly-model-id>. Double-slashes are normal.

Docker socket mount. OpenHands needs /var/run/docker.sock mounted to spin up sandbox containers. Safe, but double-check if you're on a managed host (some block this).

Long sessions + budget. OpenHands can run for 30+ minutes on a single task. Set Dashboard → API Keys → Daily Budget USD to a value you're comfortable with. Xantly will return 402 once hit; OpenHands surfaces this as a friendly error.

Tool-call failures loop. If a model can't reliably produce tool calls, OpenHands will retry. Pin to anthropic/claude-sonnet-4.6 or use xantly/auto-quality (BaRP picks a reliable tool-caller).

MCP support. OpenHands has MCP client support in newer releases. Xantly's outgoing MCP calls pass through normally.

Next steps