---
title: list-byok-credentials
product: vercel
url: /docs/rest-api/ai-gateway/list-byok-credentials
canonical_url: "https://vercel.com/docs/rest-api/ai-gateway/list-byok-credentials"
last_updated: 2026-10-28
type: reference
prerequisites:
  []
related:
  - /docs/rest-api
summary: Learn about list-byok-credentials on Vercel.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

# List BYOK credentials

```http
GET /ai-gateway/byok-credentials/list
```

List BYOK credentials for an owner, optionally filtered by provider

## Authentication

**bearerToken**: HTTP bearer

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ownerId` | string | No | The owner ID to list credentials for. Ignored for customer tokens, which always list their own team. |
| `providerSlug` | string | No | Optional provider slug to filter credentials by |
| `includeDeleted` | string. enum: true, false; default: "false" | No | Whether to include soft-deleted credentials |
| `decrypt` | string. enum: true, false; default: "false" | No | Not supported. Credential values are never returned. |
| `includeModelMappings` | string. enum: true, false; default: "false" | No | Whether to include model mappings for each credential in the response |
| `teamId` | string | No | The Team identifier to perform the request on behalf of. |
| `slug` | string | No | The Team slug to perform the request on behalf of. |


## Example request

### TypeScript

```typescript
const response = await fetch('https://api.vercel.com/ai-gateway/byok-credentials/list?ownerId=string&providerSlug=string&includeDeleted=string&decrypt=string&includeModelMappings=string&teamId=string&slug=string', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);
```

### Next.js

```typescript
'use server';

export async function callEndpoint() {
  const response = await fetch('https://api.vercel.com/ai-gateway/byok-credentials/list?ownerId=string&providerSlug=string&includeDeleted=string&decrypt=string&includeModelMappings=string&teamId=string&slug=string', {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${process.env.VERCEL_ACCESS_TOKEN}`,
      'Content-Type': 'application/json',
    },
    next: { revalidate: 3600 }
  });

  if (!response.ok) {
    throw new Error('Request failed');
  }

  return response.json();
}
```

### cURL

```bash
curl -X GET 'https://api.vercel.com/ai-gateway/byok-credentials/list?ownerId=string&providerSlug=string&includeDeleted=string&decrypt=string&includeModelMappings=string&teamId=string&slug=string' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json'
```

## Example response

```json
{
  "credentials": [
    {
      "active": "false",
      "createdAt": "123",
      "credential": "string",
      "credentialId": "example_id",
      "deleted": "false",
      "lastFourChars": "string",
      "modelMappings": [
        {
          "customModelId": "example_id",
          "gatewayModelSlug": "string"
        }
      ],
      "name": "Example Name",
      "ownerId": "example_id",
      "providerSlug": "example_id",
      "updatedAt": "123",
      "zeroDataRetention": "false"
    }
  ]
}
```

## Responses

### 200: No description

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "credentials"
  ],
  "properties": {
    "credentials": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "active",
          "createdAt",
          "credential",
          "credentialId",
          "deleted",
          "lastFourChars",
          "modelMappings",
          "name",
          "ownerId",
          "providerSlug",
          "updatedAt",
          "zeroDataRetention"
        ],
        "properties": {
          "active": {
            "type": "boolean",
            "enum": [
              false,
              true
            ]
          },
          "createdAt": {
            "type": "number"
          },
          "credential": {
            "type": "string",
            "nullable": true
          },
          "credentialId": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false,
              true
            ]
          },
          "lastFourChars": {
            "type": "string"
          },
          "modelMappings": {
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          },
          "providerSlug": {
            "type": "string"
          },
          "updatedAt": {
            "type": "number"
          },
          "zeroDataRetention": {
            "type": "boolean",
            "enum": [
              false,
              true
            ]
          }
        }
      }
    }
  }
}
```

### 400: One of the provided values in the request query is invalid.

### 401: The request is not authorized.

### 403: You do not have permission to access this resource.

### 404: No description

### 410: No description

### 500: No description

---

## Related

- [ai-gateway endpoints](/docs/rest-api#ai-gateway)

- [REST API overview](/docs/rest-api)

- [OpenAPI spec](https://vercel.com/openapi.json) (machine-readable, all endpoints)

---

[View full sitemap](/docs/sitemap)


If you encounter incorrect information, can’t find what you need, need a capability Vercel doesn’t currently offer, or have any other feedback to report, please do it by following the instructions at https://vercel.com/feedback.md.
