Start
Quickstart
Add Connect with Wind to an application. Choose an integration path.
Connect with Wind links a user’s Wind balance to your application through a one-time OAuth authorization. Afterward, your application makes metered inference requests that draw against a bounded, per-connection allocation.
There are three integration paths. All implement the same protocol and produce an equivalent result. The coding-assistant and SDK paths are recommended for most integrations; the REST API is available for languages without an SDK, edge runtimes, and cases that require full control of the flow.
Prerequisites
Create an application in the Wind developer console:
- Enable developer mode.
- Open Apps → New app. Provide a name, a logo, and one or more exact-match redirect URIs.
- Record the
client_idandclient_secret. The secret is shown once. - Under Settings → Allowed models, pick the models the app may call.
New applications run in a sandbox — a mock provider, and test accounts with fake balances that you create on the console’s Sandbox page and connect as. See Sandbox and going live.
Integration paths
Coding assistant
Provide the wind-connect skill to an AI coding
assistant such as Claude Code or Cursor. The skill is a complete description of
the integration; the assistant implements it against your codebase.
Add "Connect with Wind" to this application so users pay for AI usage from their
own Wind balance. Follow https://docs.usewind.app/skills/wind-connect/SKILL.md .
The stack is <...>; the application already has user authentication via <...>.
See Agents and LLMs.
SDK
@usewind/browser provides the connect button. @usewind/node (or usewind
for Python) provides the server integration: it registers the two OAuth routes
and handles token refresh and retry for billed requests.
import { wind } from '@usewind/node'
wind.configure({ grantStore }) // credentials from WIND_CLIENT_ID / _SECRET / _REDIRECT_URI
app.use(wind.routes({ currentUser: (req) => req.session.userId }))
const res = await wind
.connection(userId)
.model('gpt-4o')
.chat({ messages })
REST API
Integrate directly against the HTTP API with no dependency. The REST API integration guide covers the flow end to end in six steps.
Protocol overview
Every path performs the same sequence:
- Redirect the user to
accounts.usewind.app/oauth/authorizewith PKCE parameters. - Exchange the returned authorization code for tokens on your server.
- Persist the
connection_idandrefresh_tokenon your user record. - Obtain short-lived access tokens by refreshing. The refresh token is rotated on each use.
- Send inference requests to
POST /v1/ai/{model}with the access token and an idempotency key. - Handle
allocation_exhausted,connection_revoked, and webhook events.
The SDK implements this sequence. Authentication and Making requests document each step in detail.