Skip to main content
This tab documents each endpoint of the Judt API.
  • REST API base URL: https://api.judt.ai (OpenAPI description at https://api.judt.ai/api/openapi.json)
  • MCP server URL: https://api.judt.ai/mcp
  • Authorization server and dashboard: https://judt.ai (agent instructions at https://judt.ai/auth.md)
For an overview of how to authenticate, see Authentication.

Authentication details

Send an API key or an OAuth access token in the Authorization header of each request:

API keys

  • Format: judt_ followed by 43 characters.
  • Organization-wide keys: The keys that you create on the API keys page. They can access all Apps in the organization, create new Apps (POST /api/apps), and create App tokens (POST /api/tokens).
  • App tokens: Bound to one App. You create an App token with POST /api/tokens (valid for 60 to 86400 seconds).
    • GET /api/apps returns only that App.
    • POST /api/apps and POST /api/tokens return 403 app_scoped_token.
    • Requests to /api/apps/{id} for a different App return 404 not_found.
    • GET /api/templates and GET /api/models remain available.

OAuth scopes, endpoints, and lifetimes

An agent gets an OAuth 2.0 token through MCP OAuth (authorization code grant), self-registration (service_auth), or the device authorization grant (RFC 8628). For the full procedure, see https://judt.ai/auth.md.
  • Metadata endpoints:
    • Protected resource metadata (RFC 9728): https://api.judt.ai/.well-known/oauth-protected-resource (API) and https://api.judt.ai/.well-known/oauth-protected-resource/mcp (MCP server).
    • Authorization server metadata (RFC 8414): https://judt.ai/.well-known/oauth-authorization-server.
    • Personal Agent Protocol (Poppy 0.1) metadata: https://judt.ai/.well-known/poppy.json.
  • OAuth endpoints:
    • Agent self-registration: POST https://judt.ai/api/auth/agent/identity
    • Client registration (RFC 7591): POST https://judt.ai/api/auth/oauth2/register
    • Device code (RFC 8628): POST https://judt.ai/api/auth/device/code
    • Token and refresh: POST https://judt.ai/api/auth/oauth2/token
    • Revocation: POST https://judt.ai/api/auth/oauth2/revoke
  • Resource parameters (RFC 8707): Send one resource parameter for each server that you use (resource=https://api.judt.ai for the REST API, resource=https://api.judt.ai/mcp for the MCP server). If you do not send resource, the token works only on https://api.judt.ai.
  • Token lifetimes:
    • Access token: 1 hour (3600 seconds).
    • Refresh token: 30 days (2592000 seconds). Each refresh response returns a new refresh_token. Keep the new token and discard the old token.
  • DPoP key binding (RFC 9449): If you send a DPoP proof header when you request or refresh a token, the token is bound to your key. Send each API or MCP request with Authorization: DPoP ACCESS_TOKEN and a new DPoP proof header.

Organization roles

Each API key and OAuth token acts as you in one organization and has your role in that organization:

Sandboxes, retries, and time limits

  • Sandboxes: POST /api/apps reserves the App’s address, but it does not start a sandbox. A request that uses files, Git, commands, commits, restores, previews, or deployments starts the sandbox first. The sandbox stops automatically when it is idle.
  • Idempotency and retries: Each write request runs under an Idempotency-Key, and each response returns the key in a header. You can send your own key (up to 200 printable characters), or the API creates one. For 30 days, a retry with the same key and input returns the first request’s result instead of repeating the work. PUT and DELETE on a Secret do not use a key.
    • 503 or 504: The API recorded the action, but the action is not finished. Retry with the same Idempotency-Key to get the result. A new key runs the action again.
    • 4xx or 502: The result is final. Correct the cause before you send a new request.
  • Time limits:
    • File writes, commits, restores, and POST /api/apps/{id}/stop: 120 seconds (plus up to 120 seconds if the request starts a stopped sandbox).
    • Commands (POST /api/apps/{id}/commands): timeout_seconds (up to 120 seconds), plus 60 seconds to stop the command and save its output.
    • Publishing, unpublishing, deleting an App, and changing production settings: 540 seconds.

Pagination

A list returns one page, in the form {"results": [], "has_more": false, "next_cursor": null}. To get the next page, send next_cursor as the cursor query parameter while has_more is true. Use limit to set the page size. The default is 50, and the maximum is 100.

Errors

When a request fails, the API returns a JSON body in this format:
The code value does not change. Check code, not message. The detail field is optional.

Authentication and authorization errors

When the server rejects a credential, it returns a JSON error body and sets the WWW-Authenticate header. A 401 response includes the resource_metadata URL in WWW-Authenticate (RFC 9728).

General API errors