{"components":{"schemas":{"DeviceLogin":{"properties":{"deviceCode":{"description":"Secret code to poll with. Keep it private.","type":"string"},"envVar":{"description":"Environment variable to store the token in.","example":"GRADIENTS_TOKEN","type":"string"},"expiresIn":{"description":"Seconds until it expires.","type":"integer"},"interval":{"description":"Seconds to wait between polls.","type":"integer"},"tokenUrl":{"format":"uri","type":"string"},"userCode":{"description":"Code the user confirms.","type":"string"},"verificationUrl":{"description":"Link the user opens to approve the login.","format":"uri","type":"string"}},"required":["deviceCode","expiresIn","interval","tokenUrl","userCode","verificationUrl"],"type":"object"},"DeviceLoginStatus":{"properties":{"envVar":{"type":"string"},"error":{"type":"string"},"status":{"enum":["pending","slow_down","approved","denied","expired"],"type":"string"},"token":{"description":"The API token, only when `status` is `approved`.","type":"string"}},"required":["status"],"type":"object"},"Error":{"description":"A JSON error: `error` is a human-readable message, `code` a stable machine-readable code, `hint` what to do next.","properties":{"code":{"description":"Stable error code.","type":"string"},"error":{"description":"What went wrong.","type":"string"},"hint":{"description":"How to recover, when there is a fix.","type":"string"}},"required":["error","code"],"type":"object"},"Me":{"properties":{"email":{"type":["string","null"]},"pro":{"oneOf":[{"properties":{"linked":{"const":true},"source":{"const":"account"}},"type":"object"},{"type":"null"}]},"userId":{"type":["string","null"]}},"required":["email","userId","pro"],"type":"object"},"OAuthDeviceAuthorization":{"properties":{"device_code":{"type":"string"},"expires_in":{"type":"integer"},"interval":{"type":"integer"},"user_code":{"type":"string"},"verification_uri":{"format":"uri","type":"string"},"verification_uri_complete":{"format":"uri","type":"string"}},"required":["device_code","user_code","verification_uri","expires_in"],"type":"object"},"OAuthError":{"description":"An RFC 6749 error response.","properties":{"error":{"enum":["invalid_request","unsupported_grant_type","authorization_pending","slow_down","access_denied","expired_token"],"type":"string"},"error_description":{"type":"string"}},"required":["error"],"type":"object"},"OAuthToken":{"properties":{"access_token":{"type":"string"},"token_type":{"const":"Bearer"}},"required":["access_token","token_type"],"type":"object"},"RegistryIndex":{"description":"A shadcn registry index (https://ui.shadcn.com/schema/registry.json).","properties":{"$schema":{"type":"string"},"homepage":{"type":"string"},"items":{"items":{"$ref":"#/components/schemas/RegistryItem"},"type":"array"},"name":{"type":"string"}},"required":["items"],"type":"object"},"RegistryItem":{"description":"A shadcn registry item (https://ui.shadcn.com/schema/registry-item.json). Install with `npx shadcn@latest add <url>`.","properties":{"$schema":{"type":"string"},"dependencies":{"items":{"type":"string"},"type":"array"},"description":{"type":"string"},"files":{"items":{"properties":{"content":{"type":"string"},"path":{"type":"string"},"type":{"type":"string"}},"type":"object"},"type":"array"},"name":{"type":"string"},"registryDependencies":{"items":{"type":"string"},"type":"array"},"title":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"type":"object"}},"securitySchemes":{"bearerToken":{"bearerFormat":"gradients.sh personal token","description":"A personal token from the device login (or the account page), sent as `Authorization: Bearer <token>`. Tokens carry one scope, `registry:read`: they read the Pro registry and nothing else. See https://gradients.sh/.well-known/oauth-protected-resource.","scheme":"bearer","type":"http"}}},"externalDocs":{"description":"Agent guide","url":"https://gradients.sh/llms.txt"},"info":{"contact":{"email":"hello@gradients.sh","name":"gradients.sh","url":"https://gradients.sh/contact"},"description":"Install live, animated gradient components for React from the gradients.sh shadcn registry. Free items need no credentials. Pro items need a token from the device login: start it, have the user approve it in their browser, then poll for the token.","license":{"identifier":"MIT","name":"MIT (free components)"},"title":"gradients.sh API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/api/agent/login":{"post":{"description":"Starts a device login that connects an agent to the user's Pro account. Show the user `verificationUrl`, then poll `tokenUrl` every `interval` seconds.","operationId":"startDeviceLogin","requestBody":{"content":{"application/json":{"schema":{"properties":{"client":{"description":"Your agent's name, shown to the user when they approve.","maxLength":200,"type":"string"}},"type":"object"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLogin"}}},"description":"The login started."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request is malformed."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body is too large."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited. Wait, then retry."}},"summary":"Start a device login","tags":["Login"]}},"/api/agent/login/token":{"post":{"description":"Polls a device login. Answers 202 while the user hasn't decided, then the token once they approve.","operationId":"pollDeviceLogin","requestBody":{"content":{"application/json":{"schema":{"properties":{"deviceCode":{"maxLength":100,"minLength":20,"type":"string"}},"required":["deviceCode"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLoginStatus"}}},"description":"Approved: the response carries the token."},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLoginStatus"}}},"description":"Still waiting for the user."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request is malformed."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLoginStatus"}}},"description":"The user denied the login."},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLoginStatus"}}},"description":"The login expired."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body is too large."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLoginStatus"}}},"description":"Polling too fast: wait `interval` seconds."}},"summary":"Poll a device login for its token","tags":["Login"]}},"/api/me":{"get":{"description":"Who the browser session belongs to and whether it has Pro. Returns nulls when signed out.","operationId":"getMe","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}},"description":"The visitor."}},"summary":"Get the signed-in visitor","tags":["Account"]}},"/oauth/device_authorization":{"post":{"description":"The same device login as a standard RFC 8628 device authorization request.","operationId":"oauthDeviceAuthorization","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"client_id":{"description":"Any short name for your client.","type":"string"},"scope":{"enum":["registry:read"],"type":"string"}},"required":["client_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthDeviceAuthorization"}}},"description":"The login started."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}},"description":"Invalid request."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}},"description":"Rate limited."}},"summary":"Start an OAuth device authorization","tags":["OAuth"]}},"/oauth/token":{"post":{"description":"Exchanges an approved device code for an access token (RFC 8628 section 3.4).","operationId":"oauthToken","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"client_id":{"type":"string"},"device_code":{"type":"string"},"grant_type":{"const":"urn:ietf:params:oauth:grant-type:device_code"}},"required":["grant_type","device_code","client_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthToken"}}},"description":"The access token."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}},"description":"Pending, denied, expired or invalid: see `error`."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}},"description":"Rate limited."}},"summary":"Redeem a device code","tags":["OAuth"]}},"/r/{name}.json":{"get":{"description":"A free component as a shadcn registry item. No credentials needed.","operationId":"getFreeRegistryItem","parameters":[{"description":"Component name, for example `aurora`.","in":"path","name":"name","required":true,"schema":{"pattern":"^[a-z0-9-]+$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistryItem"}}},"description":"The registry item."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No such item."}},"summary":"Get a free registry item","tags":["Registry"]}},"/r/registry.json":{"get":{"description":"Every free component, for `npx shadcn@latest search` and shadcn's MCP server.","operationId":"getFreeRegistryIndex","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistryIndex"}}},"description":"The free registry."}},"summary":"List free registry items","tags":["Registry"]}},"/r/c/{code}.json":{"get":{"description":"A gradient configured in the editor, as an installable registry item. `code` comes from a share link.","operationId":"getConfigRegistryItem","parameters":[{"description":"The config code from a gradients.sh link.","in":"path","name":"code","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistryItem"}}},"description":"The registry item."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No credentials: send a token as `Authorization: Bearer <token>`."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The token is invalid, revoked, or its account has no Pro."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No such item."}},"summary":"Get a configured gradient","tags":["Registry"]}},"/r/pro/registry.json":{"get":{"description":"Every Pro component's name and description. Public, so agents can list Pro items before connecting.","operationId":"getProRegistryIndex","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistryIndex"}}},"description":"The Pro registry."}},"summary":"List Pro registry items","tags":["Registry"]}},"/r/pro/{name}.json":{"get":{"description":"A Pro component with its source. Needs a token from an account with Pro.","operationId":"getProRegistryItem","parameters":[{"description":"Pro component name, for example `border-beam`.","in":"path","name":"name","required":true,"schema":{"pattern":"^[a-z0-9-]+$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistryItem"}}},"description":"The registry item."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request is malformed."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No credentials: send a token as `Authorization: Bearer <token>`."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The token is invalid, revoked, or its account has no Pro."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No such item."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited. Wait, then retry."}},"security":[{"bearerToken":[]}],"summary":"Get a Pro registry item","tags":["Registry"]}}},"servers":[{"url":"https://gradients.sh"}],"tags":[{"description":"shadcn registry items and indexes.","name":"Registry"},{"description":"Connect an agent to a Pro account.","name":"Login"},{"description":"The same login over standard OAuth 2.0.","name":"OAuth"},{"description":"The browser session.","name":"Account"}]}