--- title: OpenHands Simplified Backend emoji: 🤖 colorFrom: indigo colorTo: purple sdk: docker app_port: 7860 pinned: false --- # OpenHands Simplified Backend (Phase 1) FastAPI service that exposes: - `GET /health` — liveness + provider/key status - `POST /api/chat` — non-streaming chat - `POST /api/chat/stream` — SSE; auto-routes chat vs E2B execution - `POST /api/execute` — SSE; always runs in E2B sandbox - `POST /api/intent` — intent classifier only ## Environment variables (set in HF Space → Settings → Secrets) | Name | Required | Notes | |-------------------|----------|----------------------------------------| | `GEMINI_KEY` | optional | comma-separated Gemini API keys | | `SAMBANOVA_KEY` | optional | comma-separated SambaNova API keys | | `GITHUB_KEY` | optional | comma-separated GitHub Models tokens | | `E2B_API_KEY` | **yes** | required for execution endpoints | | `E2B_TEMPLATE` | optional | custom sandbox template id | | `ALLOWED_ORIGINS` | optional | CSV; defaults to `*` | | `LOG_LEVEL` | optional | default `INFO` | At least ONE LLM provider key must be set. ## Test (after deploy) ```bash curl https://.hf.space/health curl -N -X POST https://.hf.space/api/execute \ -H 'Content-Type: application/json' \ -d '{"message":"Create proof.txt with the current UNIX timestamp and print its contents."}' ```