# Vercel

Put the agent credential in the project environment and call Gnesi from a server function.

Add `GNESI_CREDENTIAL` in the Vercel project environment. The value is the agent credential from Settings, Agent access. Mark it sensitive. Do not prefix it with `NEXT_PUBLIC_`.

Call Gnesi from a server function, a route handler, or a background function. The [Vercel AI SDK](/integrations/vercel-ai-sdk) page is the tool loop. A plain fetch works too:

```typescript
const response = await fetch("https://api.gnesi.io/v1/conversations?view=needs_you", {
  headers: { Authorization: `Bearer ${process.env.GNESI_CREDENTIAL}` },
});
```

The browser must not see the credential. A chat visitor signs in through [MCP](/integrations/mcp) on their own client.

A paid agent send is USDC from the wallet. A short balance is an error. The agent calls `gnesi_add_funds` and shows the URL. Cash out is `gnesi_cash_out`. It is not an HTTP 402. See [Payments](/payments).
