Tokenify
Get API keyConsole
Menu

Sign in with Tokenify (OAuth)

How an app or an agent gets a token to spend from the project a person chooses.

View as markdown

Tokenify is an OAuth 2.1 authorization server, so an app can ask a person for access instead of asking them to paste a key. The person signs in, picks the project whose balance the app may spend, and approves; the app gets an access token for that project. An MCP client does all of this on its own from the server URL — this page is for building one, or for an app of your own.

Approving creates a key in the project, named after the app. The app spends through it, and revoking that key on the console’s Keys page disconnects the app, immediately.

Discovery

Everything starts from two documents:

DocumentAt
Protected resource (RFC 9728)https://api.tokenify.dev/.well-known/oauth-protected-resource
Authorization server (RFC 8414)https://api.tokenify.dev/.well-known/oauth-authorization-server

A request to /mcp without a token is answered 401 with a WWW-Authenticate header naming the first. The second lists the endpoints:

EndpointURL
Registration (RFC 7591)https://api.tokenify.dev/dash/v1/oauth/register
Authorizationhttps://www.tokenify.dev/app/connect
Tokenhttps://api.tokenify.dev/dash/v1/oauth/token

The flow

Register with your app’s name and redirect URIs. Registration is open and needs no credentials; apps are public clients, so there is no secret, and the person is shown where the code will be sent next to the name you gave.

curl -s https://api.tokenify.dev/dash/v1/oauth/register \
-H 'Content-Type: application/json' \
-d '{"client_name":"My Agent","redirect_uris":["http://127.0.0.1:53682/callback"],"token_endpoint_auth_method":"none"}'

Send the person to authorize with PKCE (S256 only) and the resource you want a token for:

https://www.tokenify.dev/app/connect?response_type=code&client_id=<id>
  &redirect_uri=http://127.0.0.1:53682/callback
  &code_challenge=<S256 of your verifier>&code_challenge_method=S256
  &state=<random>&resource=https://api.tokenify.dev/mcp

The browser comes back to your redirect URI with code, state and iss. Exchange the code within ten minutes:

curl -s https://api.tokenify.dev/dash/v1/oauth/token \
-d grant_type=authorization_code -d client_id=<id> -d code=<code> \
-d redirect_uri=http://127.0.0.1:53682/callback -d code_verifier=<verifier>

The answer has an access_token that lasts an hour and a refresh_token that lasts thirty days. Send the access token as Authorization: Bearer …, never in a URL — a token in a query string is refused, because URLs end up in logs.

Refreshing

Exchange the refresh token for a new pair, with the same client_id:

curl -s https://api.tokenify.dev/dash/v1/oauth/token \
-d grant_type=refresh_token -d client_id=<id> -d refresh_token=<refresh token> \
-d resource=https://api.tokenify.dev/mcp

Each refresh token works once: the answer carries the next one, and presenting a spent one ends the whole connection, on the assumption that it was stolen. So refresh from one place at a time, and store the new refresh token before using the new access token. Send resource again on every refresh if you want the narrower audience: without it, the token is issued for everything the connection was granted.

Audiences

resourceThe token can call
https://api.tokenify.dev/mcpThe MCP server only. The HTTP endpoints refuse it with token_wrong_audience.
https://api.tokenify.devThe whole API — the HTTP endpoints and the MCP server — as an API key of the project would.

Any other resource is refused. Ask for the narrowest one your app needs: an agent that only uses tools should ask for /mcp. A whole-API grant can be asked for a token for /mcp alone; never the reverse. What an agent may spend through the MCP server is the project’s to decide — see spending controls.

Errors

The token endpoint answers with the standard OAuth error codes (invalid_grant, invalid_client, invalid_request). A token refused by the API has an ordinary error body; token_wrong_audience and token_in_url are listed with the rest on the errors page.

Last updated 2026-11-25.