Developers
Integrate Failure AI OAuth
Failure is a PKCE OAuth 2.0 authorization server. Register an app in the dashboard, show the frosted glass Sign in with Failure button, and exchange the code for tokens that unlock linked providers. Full guide: docs/INTEGRATION.md.
PKCE quickstart
- Create a public client in the dashboard (PKCE required).
- Send users to
/oauth/authorizewithcode_challenge(S256). - Exchange the code at
/api/oauth/tokenwithcode_verifier. - Call
/api/oauth/userinfowith the access token to read profile + provider credentials — or call the OpenAI-compatible/v1/chat/completionsproxy with the same Bearer token.
OpenAI-compatible API
Create an API key (fsk_…) on the dashboard, set baseURL to https://oauth.failure.fail/v1, and use model ids like codex/gpt-5.6-sol.
OPENAI_BASE_URL=https://oauth.failure.fail/v1
OPENAI_API_KEY=fsk_…
GET https://oauth.failure.fail/v1/models
POST https://oauth.failure.fail/v1/chat/completionsDiscovery
https://oauth.failure.fail/.well-known/openid-configurationUniversal UI format
{
"brand": "Failure",
"product": "Failure AI OAuth",
"button": {
"id": "sign-in-with-failure",
"label": "Sign in with Failure",
"recommendedHeight": 48,
"recommendedMinWidth": 260,
"theme": {
"surface": "frosted-glass",
"background": "linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.05))",
"border": "1px solid rgba(255,255,255,0.28)",
"blur": "18px",
"text": "#fff7ed",
"accent": "#ff6b35",
"shadow": "0 10px 40px rgba(0,0,0,0.35)",
"radius": "999px",
"fontFamily": "\"Syne\", \"Figtree\", sans-serif"
},
"cssClass": "failure-signin-btn",
"scriptUrl": "https://oauth.failure.fail/sdk/sign-in-with-failure.js",
"cssUrl": "https://oauth.failure.fail/sdk/sign-in-with-failure.css"
},
"oauth": {
"authorize": "https://oauth.failure.fail/oauth/authorize",
"token": "https://oauth.failure.fail/api/oauth/token",
"userinfo": "https://oauth.failure.fail/api/oauth/userinfo",
"discovery": "https://oauth.failure.fail/.well-known/openid-configuration",
"pkceRequired": true,
"responseType": "code",
"defaultScopes": [
"openid",
"profile",
"email",
"providers",
"offline_access"
]
},
"card": {
"title": "Sign in with Failure",
"subtitle": "One OAuth for every AI provider your apps need.",
"accent": "ember-glass"
}
}Example authorize URL
https://oauth.failure.fail/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=https://yourapp.com/callback&scope=openid%20profile%20email%20providers%20offline_access&code_challenge=CHALLENGE&code_challenge_method=S256&state=STATE