lupin.Open console
Agents & MCP

Build a framework-independent Lupin HTTP client

Use standard HTTPS, explicit error handling and durable operation records without depending on a particular agent framework.

HTTPS is the portable integration boundary

Lupin’s REST API is available at https://api.lupin.sh. Any environment that can send authenticated HTTPS requests and parse JSON can integrate without a framework-specific adapter or a publicly installed SDK. Autonomous registration is public and returns the restricted workspace credential; other resource operations use Authorization: Bearer. Keep the client small: fixed base URL, controlled path construction, JSON encoding, response decoding and typed failures. Framework-specific planning and model calls can sit above that transport without changing resource ownership or server policy.

Encode paths and queries deliberately

Treat resource IDs as identifiers and URL-encode them when constructing a path. Build query strings with a standard parameter encoder, preserving opaque pagination tokens. Use the documented snake_case wire fields and ISO-8601 timestamps instead of leaking your language’s object naming convention into request bodies. Fix the production origin in trusted configuration and permit local alternatives only through explicit development settings. Do not accept an API origin from received email or a model-generated tool result. A portable client should not become an arbitrary authenticated network proxy.

Preserve status and structured errors

Inspect HTTP status before parsing a success shape. Error objects contain a structured code and message, and validation failures can include field errors. Distinguish 401 credential problems, 403 missing authority, 404 missing or inaccessible resources and 429 rate limiting with Retry-After. Some endpoints return binary or message/rfc822 bodies rather than JSON, so choose the decoder by the operation. Do not log raw error responses indiscriminately: registration and recovery content can contain sensitive material. Return bounded diagnostics while keeping credential state private.

Make retries operation-aware

Read requests can use bounded backoff for transient transport failures, while external writes need a saved action identity before submission. Sends use Idempotency-Key, some resource creates use client_id and autonomous registration uses its own secret recovery identity. A blanket retry interceptor that generates a new key is unsafe. Preserve the exact request snapshot and operation state across process restarts. For uncertain provider outcomes, stop automatic write retries and inspect recorded evidence rather than treating every network exception as proof that no external effect occurred.

Keep authorization above the transport

A bearer key enforces API permission, but your application still needs the actual user’s authorization for sensitive external actions. Keep that review snapshot separate from the HTTP helper, then execute only the approved request. A bootstrap client can use read and draft routes while a separately controlled service handles authorized sends. MCP is another standardized adapter over the same registered handlers if your agent framework prefers tools. Neither interface grants broader scope, provider readiness or spending authority simply by being easier to call.

Start with one safe read

Implement GET /v0/auth/me and an inbox read before adding writes, pagination and media handling. Use a mock transport or isolated local API to test request encoding and error branches. Your next step is a small operation registry that records method, route template, expected response type and retry policy so new features follow the same dependable client behavior.

Read caller identity with a credential loaded from private runtime storage.
curl --fail-with-body https://api.lupin.sh/v0/auth/me \
  -H "Authorization: Bearer $LUPIN_API_KEY"

Sources & verification

Reviewed against checked-in Lupin API handlers and documentation. Example requests were not executed against live providers.

Prepared with AI assistance by Lupin editorial. How we research and maintain these guides.

Put it into practice

Give your agent the right tools.

Review the API, workspace requirements and permissions before enabling a workflow.

Register an agent See plans