# auth.md: how AI agents authenticate to JANCTION Render

JANCTION Render is a cloud GPU render farm for Blender that AI agents call as an MCP server or HTTP API. There are two doors; both issue an API key with no sign-up, and no card is needed for the first 100 JPY of free GPU time.

## 1. MCP (remote, Streamable HTTP) at https://render.janction.jp/mcp

1. Call the endpoint without credentials. The reply is 401 with a WWW-Authenticate header whose resource_metadata points to https://render.janction.jp/.well-known/oauth-protected-resource/mcp and a JSON body whose how_to_authenticate field lists the options below.
2. OAuth 2.1 with PKCE and dynamic client registration: read the protected resource metadata at https://render.janction.jp/.well-known/oauth-protected-resource/mcp , then the authorization server metadata at https://render.janction.jp/.well-known/oauth-authorization-server (authorization, token, registration and revocation endpoints). The consent page issues an API key bound to the session; scope: render. Claude.ai, ChatGPT, Claude Code, Codex, Cursor and other MCP clients do this automatically.
   Scopes: render (everything; the default), read (status, links, estimates, billing only), share (publish or remove share pages). Ask only for what the agent needs; a read-only connection cannot submit renders.
3. Or skip OAuth: send Authorization: Bearer <api key> with a key from step 2 of the HTTP section.

## 2. HTTP API at https://render.janction.jp/v1

- POST https://render.janction.jp/v1/keys with a JSON body {"label": "<your agent name>"} returns a key (jr_...). Send it as X-API-Key: <key> (or Authorization: Bearer <key>).
- POST https://render.janction.jp/v1/try with {"scene_script": "<bpy>"} or {"scene_url": "https://..."} renders a first 720p preview without any key and returns the image links plus a key to continue (one free try per network per 24 hours).
- GET https://render.janction.jp/v1/me shows the key's quota, spend caps and usage.

## Quotas and errors

- Welcome credit: each new key starts with 100 JPY (1000 GPU-seconds, 14 days) for previews and finals, and 400 JPY more for saving a card that is not charged (once per card); after that, previews are free up to 2 GPU-minutes a day and finals cost 0.1 JPY per GPU-second from prepaid credit; final renders up to 3,000 frames per instruction (parts of 240), 1080p on free time and 4K on prepaid credit.
- 402 payment_required: the job goes past the free GPU time left and the credit is short; it carries checkout_url (show it to the user), topup_yen, free_gpu_seconds_left_today and welcome (balance and expiry).
- 429 carries a machine-readable error field: rate_limited (short burst; retry_after_s), key_limit (too many new keys from one network; retry_after_s), try_limit.
- 401 and 403 on the HTTP API return error, detail and possible_fix.
- Keys can be revoked by their owner; treat them like passwords and never put them in scene scripts.

Documentation: https://render.janction.jp/llms.txt (agents), https://render.janction.jp/facts (primary facts), https://render.janction.jp/openapi.json (HTTP API), https://render.janction.jp/.well-known/mcp/server-card.json (MCP).
