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

# Gestionar API keys

> Crear, listar y revocar API keys desde el dashboard o por API.

## Desde el dashboard

<Steps>
  <Step title="Inicia sesión">
    Ve a [veripay.datagora.mx/dashboard](https://veripay.datagora.mx/dashboard).
  </Step>

  <Step title="Abre la sección API Keys">
    En el menú lateral selecciona **API keys**.
  </Step>

  <Step title="Crea una key">
    Haz clic en **Crear nueva**, asígnale un nombre (p. ej. `staging`) y elige `live` o `test`.
  </Step>

  <Step title="Copia el secreto">
    Verás la key completa **una sola vez**: `vk_live_xxxxxxxx.SECRETO`. Guárdala en tu vault de secretos.
  </Step>
</Steps>

<Warning>
  Si pierdes el secreto **no hay forma de recuperarlo**: revoca la key y genera una nueva.
</Warning>

## Por API (sesión Supabase)

Útil si quieres rotar keys desde un script con la cookie de tu sesión.

<CodeGroup>
  ```bash Crear theme={null}
  curl -X POST "https://veripay.datagora.mx/api/keys" \
    -H "Cookie: sb-access-token=$SB_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{ "name": "ci-bot", "env": "live" }'
  ```

  ```bash Listar theme={null}
  curl "https://veripay.datagora.mx/api/keys?include_revoked=false" \
    -H "Cookie: sb-access-token=$SB_TOKEN"
  ```

  ```bash Revocar theme={null}
  curl -X DELETE "https://veripay.datagora.mx/api/keys/$KEY_ID" \
    -H "Cookie: sb-access-token=$SB_TOKEN"
  ```
</CodeGroup>

## Estructura del modelo

```ts theme={null}
type ApiKey = {
  id: string;            // uuid
  name: string;
  prefix: string;        // vk_live_aB3xQ91p
  per_minute: number;    // default 60
  monthly_quota: number; // default 1000
  revoked_at: string | null;
  created_at: string;
};
```

## Defaults por plan

| Plan             | `per_minute` | `monthly_quota` |
| ---------------- | ------------ | --------------- |
| Startup (gratis) | `60`         | `1,000`         |
| Enterprise       | configurable | sin tope        |

Para ajustar límites de una key específica, contáctanos en [soporte@datagora.mx](mailto:soporte@datagora.mx).
