> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pyai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Vercel

> Use PyAI speech and transcription from your Vercel app.

Use PyAI from a Vercel server function with a project API key. Keep the key on
the server; never prefix it with `NEXT_PUBLIC_` or embed it in browser code.

## Set up today

1. Create a scoped key in the [PyAI console](https://console.pyai.com). Speech
   generation needs `speak:synthesize`; transcription needs `hear:transcribe`.
2. Add `PYAI_API_KEY` in your Vercel project's environment variables. Select
   the deployment environments that should have access.
3. Redeploy the application. Existing deployments do not inherit new variables.
4. Read the key as `process.env.PYAI_API_KEY` inside server code.

Authenticate your app's users before exposing a speech endpoint. Requests using
live project keys consume that project's credits. A key kept on the server does
not by itself prevent visitors from calling an unprotected application route.

## Account connection preview

<Note>
  The automated account connection is being qualified. A public Vercel Marketplace
  listing is not yet approved. Manual environment-variable setup above remains
  available.
</Note>

When access is enabled, start at
[Connect Vercel](https://console.pyai.com/integrations/vercel). Sign in to PyAI,
choose **Connect with Vercel**, and authorize only the intended Vercel projects.
After returning, choose a PyAI organization and project and a Vercel project.
Review the scope and usage notice, then select **Create key and connect**.

The preview creates one key for speech and transcription and installs it as
`PYAI_API_KEY` in Production and Preview. It does not overwrite an existing
variable. This initial version connects one Vercel project per installation.
Use an owner or admin account in the PyAI organization.

## Disconnect and recover

* Open the connection with the PyAI account that created it and confirm
  **Disconnect PyAI**. This revokes the integration key; deployed applications
  using it lose access.
* Removing the integration in Vercel also revokes its key when the signed
  removal event is delivered. Transferring the installation to another Vercel
  team revokes the existing PyAI access.
* If an install fails after sending the environment variable, its new key is
  revoked. Check Vercel for a remaining `PYAI_API_KEY` variable before trying
  again; the integration never silently overwrites it.
* If cleanup cannot reach Vercel, the console reports that the variable still
  needs removal. Revoked keys remain unusable.
* Remove the old integration from Vercel before starting a new installation.

For support, contact [support@pyai.com](mailto:support@pyai.com). Include the
connection status and request ID, but never keys or authorization codes.
