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

health

Liveness + readiness probes.

  • GET/healthgetHealth

    Health 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/tokenslistTokens

    List Personal Access Tokens

    Returns every PAT belonging to the authenticated user. Plaintext is never re-returned — only the prefix and metadata.

  • POST/tokensmintToken

    Mint a Personal Access Token

    Mints a new PAT. The plaintext is returned ONCE — store it before navigating away.

  • DELETE/tokensrevokeToken

    Revoke a Personal Access Token

    Revokes the token by id.

mcp

Model Context Protocol Streamable HTTP endpoint.

  • POST/mcpmcpRpc

    MCP 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/mcpmcpEventStream

    MCP Streamable HTTP — server→client SSE stream

    Long-lived SSE stream for server-initiated MCP notifications. See /docs/mcp.

  • DELETE/mcpmcpClose

    MCP 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/statusgetInstanceStatus

    Read agent instance status

    Returns the current Fly Machine state for the authenticated user, plus the wallet balance and active subscription summary.

  • POST/instance/pausepauseInstance

    Pause the agent instance

    Stops the Fly Machine. Resumable via `/instance/resume`. The volume is preserved.

  • POST/instance/resumeresumeInstance

    Resume the paused agent instance

  • POST/instance/refreshrefreshInstance

    Re-inject env vars and restart the agent

  • POST/instance/modelsetInstanceModel

    Change the instance's default LLM model

wallet

Wallet balance + top-up checkout.

  • POST/wallet/topupcreateWalletTopup

    Create 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/checkoutcreateSubscriptionCheckout

    Create a subscription checkout session

skills

Skill catalogue + import.

  • GET/skillslistSkills

    List skills available to the user

  • GET/skills/{id}getSkill

    Read a skill by slug

channels

Inbound webhooks (Telegram/Discord/Slack).

    Examples

    Read the long-form walkthroughs:

    API reference — Hangar