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

# List rules

```http
GET /v1/ai-gateway/rules
```

List the authenticated team's routing rules

## Authentication

**bearerToken**: HTTP bearer

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `includeDisabled` | string. enum: true, false | No |  |
| `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/v1/ai-gateway/rules?includeDisabled=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/v1/ai-gateway/rules?includeDisabled=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/v1/ai-gateway/rules?includeDisabled=string&teamId=string&slug=string' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json'
```

## Example response

```json
{
  "rules": [
    {
      "ownerId": "example_id",
      "ruleId": "example_id",
      "type": "deny",
      "match": {
        "model": "string"
      },
      "action": {
        "rewriteModel": "string",
        "reason": "Customer requested refund"
      },
      "enabled": "false",
      "deleted": "false",
      "description": "string",
      "createdBy": "string",
      "updatedBy": "string",
      "createdAt": "123",
      "updatedAt": "123"
    }
  ]
}
```

## Responses

### 200: No description

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "rules"
  ],
  "properties": {
    "rules": {
      "type": "array",
      "items": {
        "type": "object",
        "description": "Public response shape for AI Gateway routing rules. Used so OpenAPI generation can avoid ElectroDB's recursive EntityItem types.",
        "required": [
          "createdAt",
          "enabled",
          "ownerId",
          "ruleId",
          "type",
          "updatedAt"
        ],
        "properties": {
          "ownerId": {
            "type": "string"
          },
          "ruleId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "deny",
              "rewrite"
            ]
          },
          "match": {
            "type": "object"
          },
          "action": {
            "type": "object"
          },
          "enabled": {
            "type": "boolean",
            "enum": [
              false,
              true
            ]
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false,
              true
            ]
          },
          "description": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "createdAt": {
            "type": "number"
          },
          "updatedAt": {
            "type": "number"
          }
        }
      }
    }
  }
}
```

### 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.

### 410: No description

### 500: No description

---

## Related

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

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

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

---

[View full sitemap](/docs/sitemap)
