Hamster OSS API
The Hamster OSS API is the MCP server on your team's instance. Agents and scripts call it at https://<your-team>.tryhamster.dev/mcp with an OAuth access token.
The OpenAPI 3.1 document describes the same endpoints for tools that read OpenAPI.
Access
Sign up free at tryhamster.dev/signup, save and verify a card for $15 in starter credit, and create an instance; Get access has every step and Pricing has the prices. If someone at Hamster invited you, claim the invitation instead.
There's no sandbox or test environment, and no account-wide API key. To try the API, use the $15 starter credit on a Micro instance. Access is self-serve: an agent registers its own OAuth client at https://tryhamster.dev/oauth/register (RFC 7591 dynamic client registration), with no secret and no request to Hamster, and the person approves it in the browser. There are two kinds of token. Account tokens come from tryhamster.dev's own OAuth server: they let an agent act for one person on the account MCP server and the /api/v1/agent API, within the scopes the person approved. Instance tokens come from each instance: each one works for one instance and one project.
Quickstart
- Add
https://<your-team>.tryhamster.dev/mcpto your MCP client as a remote (HTTP) server. Clients that support MCP authorization find the authorization server on their own; Hamster OSS MCP server covers client setup. - When the client opens your instance in the browser, sign in and choose the project your agent works on.
- Call the
readtool with path/. It returns every path the tools accept.
To run Hamster OSS on your own machine, install the CLI:
curl -fsSL https://dl.tryhamster.dev/install.sh | sh
Authentication
Each instance is the OAuth authorization server for its own MCP server.
GET /.well-known/oauth-protected-resource/mcp— protected resource metadata (RFC 9728): the resource, its authorization server and thesystem:accessscope.GET /.well-known/oauth-authorization-server— authorization server metadata (RFC 8414) with the authorize, token and registration endpoints.POST /oauth/register— dynamic client registration (RFC 7591). Every client registers as a public client with no secret. The metadata listsregistration_endpointonly when the instance accepts registration./oauth/authorizeand/oauth/token— the authorization code flow with S256 PKCE. The only scope issystem:access. Access tokens expire and there are no refresh tokens, so a client reconnects to get a new one.- Connect your agent in Studio, or Agents in your settings — an expiring token for one project, without OAuth.
Send the token as Authorization: Bearer <token>. A request without a valid token gets 401 and a WWW-Authenticate header that points to the protected resource metadata. /mcp never accepts browser cookies.
Signing in to the dashboard at tryhamster.dev uses a separate identity provider, https://auth.tryhamster.dev (OpenID Connect). It doesn't issue tokens for MCP servers, and the dashboard's own API under /api/v1, outside /api/v1/agent, never accepts agent tokens.
Account API at tryhamster.dev
An agent can sign a person up and create an instance for them. The person approves the agent in the browser: they sign up or sign in, verify their email, accept the terms and approve the agent. There are two equal surfaces: the Hamster OSS account MCP server, POST https://tryhamster.dev/mcp, and its REST twin, https://tryhamster.dev/api/v1/agent/*. The OpenAPI document has every REST operation.
- tryhamster.dev is the authorization server for both. A call without a token gets
401and aWWW-Authenticateheader that points to/.well-known/oauth-protected-resource/mcp(MCP) or/.well-known/oauth-protected-resource(REST) and names all four scopes, so one approval covers the whole setup. A token is bound to the resources it was issued for: both, unless the client asked for one. - Self-serve client registration:
POST https://tryhamster.dev/oauth/registerwith your client metadata (RFC 7591) answers201with aclient_id. Every client is public (token_endpoint_auth_methodnone), and a Client ID Metadata Document URL also works asclient_id. The authorization server metadata athttps://tryhamster.dev/.well-known/oauth-authorization-serverlists it asregistration_endpoint. - Scopes:
account:read(account and instance status),account:write(redeem a Design Partner Code),instances:write(create instances, and the person's first organization) andbilling:write(links to Stripe-hosted pages that save a card without payment or add funds). - Ordinary onboarding uses hosted Checkout; agents never handle card details. An eligible first card earns $15 after verification on a Stripe-hosted setup page, without a payment. Later funding also happens on a Stripe-hosted page the person completes.
statusreportsaccountCreatedseparately from instance readiness and includes each organization’sstarterCreditstatus for billing roles.create_instancedefaults to Micro and keeps the same request identity through activation. After credit settles, the original pending creation resumes.get_instancereturnsmcpUrlonly after readiness checks pass.add_payment_methodaccepts optionalrequestIdandorganizationIdand opens card setup. The REST equivalent isPOST /api/v1/agent/billing/checkoutwithmode: "setup"; omitamountCents. Usemode: "payment"andamountCentsfor a top-up; omittingmodepreserves payment behavior.- Give the person the returned checkout
urlunchanged. It is ahttps://tryhamster.dev/checkout/…bearer link that redirects to Stripe while the session is open, or to the completion or expiry page afterward. It requires no sign-in and is never cached. - On MCP,
add_fundstakes an optionalrequestId, likecreate_instance. Without one, a retry returns the same Stripe page; once the person has paid it, the tool answers{"paid": true, "detail": …}instead, and the agent passes a newrequestIdto add funds again. With an explicitrequestId, a paid page stays the answer, as on REST. - Without a token, the MCP server answers
initialize,tools/listand the toolsget_pricing,search_docs,fetch_docandget_install_command. The toolsstatus,create_instance,get_instance,add_payment_method,add_fundsandredeem_codeneed a token with the matching scope; without one, they get the401challenge before their arguments are read. - When an instance is ready,
get_instancereturns its MCP URL and the commands to connect Claude Code, Cursor and Codex. - Errors are RFC 9457 problem details (
application/problem+json) with a stablecode; a402carriesnext_action. On MCP, a tool error is a result withisErrorand the problem as JSON in its text content, with nostructuredContent. Both surfaces share a limit of 120 requests per client per minute, advertised inRateLimit-PolicyandRateLimitheaders; over it, the answer is429withRetry-After. Creating requests accept anIdempotency-Keyheader in place ofrequestId; reusing a key with a different body gets422(idempotency_key_reused), and reusing arequestIdwith other parameters gets409(conflict).
Endpoints
POST https://<your-team>.tryhamster.dev/mcp— MCP over Streamable HTTP. Send a JSON-RPC 2.0 message and the answer is JSON. Needs a bearer token.GET https://<your-team>.tryhamster.dev/.well-known/oauth-protected-resource/mcp— protected resource metadata. Public.GET https://<your-team>.tryhamster.dev/.well-known/oauth-authorization-server— authorization server metadata. Public.GET https://dl.tryhamster.dev/channels/tracks.json— the release track catalog the installer reads. Public. Its signature is attracks.json.sig.POST https://tryhamster.dev/mcp— the Hamster OSS account MCP server (protocol 2025-11-25; 2025-06-18 and 2025-03-26 also accepted). Docs and pricing tools need no token; account tools need OAuth with tryhamster.dev.GET https://tryhamster.dev/api/v1/agent/catalog— sizes, prices and usage rates. Public. The other/api/v1/agent/*endpoints need a token.POST https://tryhamster.dev/oauth/register— dynamic client registration for the account MCP server and/api/v1/agent. Public.
API versioning and deprecation explains how each surface is versioned and how a breaking change is announced.
Example requests
Read the protected resource metadata:
curl -sS https://<your-team>.tryhamster.dev/.well-known/oauth-protected-resource/mcp
{"authorization_servers":["https://<your-team>.tryhamster.dev"],"resource":"https://<your-team>.tryhamster.dev/mcp","scopes_supported":["system:access"]}
List the MCP tools with an access token:
curl -sS https://<your-team>.tryhamster.dev/mcp \
-H "Authorization: Bearer $HAMSTER_TOKEN" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'MCP-Protocol-Version: 2025-06-18' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
The result lists six tools: create, read, update, delete, search and message.
Search these docs through the Hamster OSS account MCP server, which needs no token for this tool:
curl -sS https://tryhamster.dev/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'MCP-Protocol-Version: 2025-06-18' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_docs","arguments":{"query":"oauth scope"}}}'
Register an OAuth client for the account API, with no key to request:
curl -sS https://tryhamster.dev/oauth/register \
-H 'Content-Type: application/json' \
-d '{"client_name":"My agent","redirect_uris":["http://127.0.0.1:8765/callback"],"grant_types":["authorization_code","refresh_token"],"response_types":["code"],"token_endpoint_auth_method":"none"}'
The answer is 201 Created:
{"client_id":"dcr_…","client_id_issued_at":1793919612,"client_name":"My agent","grant_types":["authorization_code","refresh_token"],"redirect_uris":["http://127.0.0.1:8765/callback"],"response_types":["code"],"token_endpoint_auth_method":"none"}
Read the public release catalog:
curl -sS https://dl.tryhamster.dev/channels/tracks.json
Machine payments
The REST-only POST /api/v1/agent/billing/topups operation accepts MPP Stripe Shared Payment Tokens when enabled on the merchant account. Request billing:pay explicitly through OAuth consent; default scopes, existing grants and auth.md claim grants do not include it. The person must be an owner or admin of the organization. ChatGPT clients cannot use this operation.
Send requestId and organizationId as UUIDs and amountCents between 1000 and 1000000. Keep the OAuth bearer token in Authorization. The initial 402 response carries a signed WWW-Authenticate: Payment challenge; retry with the MPP credential in Payment-Authorization. The successful response includes Payment-Receipt and paid: true. Retry uncertain results with the same request ID and body. Payments add prepaid funds without saving a card, granting starter credit, or enabling automatic top-up. The OpenAPI document declares its x-payment-info offer; the runtime challenge supplies the exact amount.