API reference
Hangar REST API.
Bearer-token authenticated. Errors are JSON. Rate limits return standard headers. Full machine-readable spec at /openapi.json.
Quick reference
- Base URL
https://hangar.so/api- Auth
Authorization: Bearer oss_<token>- Spec (3.1)
/openapi.json- Rate limits
- X-RateLimit-* headers
health
Liveness + readiness probes.
- GET
/healthgetHealthHealth check
Liveness probe. Returns `{ ok: true, timestamp }` when the API process is alive. No auth required.
auth
Personal Access Token mint, list, and revoke.
- GET
/tokenslistTokensList Personal Access Tokens
Returns every PAT belonging to the authenticated user. Plaintext is never re-returned — only the prefix and metadata.
- POST
/tokensmintTokenMint a Personal Access Token
Mints a new PAT. The plaintext is returned ONCE — store it before navigating away.
- DELETE
/tokensrevokeTokenRevoke a Personal Access Token
Revokes the token by id.
mcp
Model Context Protocol Streamable HTTP endpoint.
- POST
/mcpmcpRpcMCP Streamable HTTP — JSON-RPC client→server
Model Context Protocol Streamable HTTP transport. Send JSON-RPC requests; receive single JSON responses or SSE streams. See /docs/mcp.
- GET
/mcpmcpEventStreamMCP Streamable HTTP — server→client SSE stream
Long-lived SSE stream for server-initiated MCP notifications. See /docs/mcp.
- DELETE
/mcpmcpCloseMCP Streamable HTTP — terminate session
Closes a stateful MCP session (no-op in stateless mode).
instance
Agent runtime lifecycle (status, pause, resume, refresh, model).
- GET
/instance/statusgetInstanceStatusRead agent instance status
Returns the current Fly Machine state for the authenticated user, plus the wallet balance and active subscription summary.
- POST
/instance/pausepauseInstancePause the agent instance
Stops the Fly Machine. Resumable via `/instance/resume`. The volume is preserved.
- POST
/instance/resumeresumeInstanceResume the paused agent instance
- POST
/instance/refreshrefreshInstanceRe-inject env vars and restart the agent
- POST
/instance/modelsetInstanceModelChange the instance's default LLM model
wallet
Wallet balance + top-up checkout.
- POST
/wallet/topupcreateWalletTopupCreate a wallet top-up checkout session
Returns a hosted checkout URL the user opens to top up their wallet. Card details are never seen by Hangar.
billing
Subscription checkout + customer portal.
- POST
/checkoutcreateSubscriptionCheckoutCreate a subscription checkout session
skills
Skill catalogue + import.
- GET
/skillslistSkillsList skills available to the user
- GET
/skills/{id}getSkillRead a skill by slug
channels
Inbound webhooks (Telegram/Discord/Slack).
Examples
Read the long-form walkthroughs:
- /docs/quickstart — first deploy in 60 seconds.
- /docs/auth — sessions, PATs, scopes.
- /docs/mcp — MCP server, tools, transports.
- /docs/errors — error codes + recovery hints.
- /docs/rate-limits — limit headers + backoff.