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

# List Credentials

> Retrieves all credentials for the authenticated user with masked API keys

## Query Parameters

<ParamField query="limit" type="number" default={20}>
  Number of results per page
</ParamField>

<ParamField query="offset" type="number" default={0}>
  Pagination offset
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="credentials" type="array">
  Array of credential objects
</ResponseField>

<ResponseField name="nextOffset" type="number">
  Offset for the next page of results
</ResponseField>

<ResponseField name="hasMore" type="boolean">
  Indicates if there are more results available
</ResponseField>

<ResponseField name="total" type="number">
  Total number of credentials
</ResponseField>

<ResponseField name="message" type="string">
  Response message
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'http://localhost:3000/api/v1/credentials?limit=20&offset=0' \
    --header 'Authorization: Bearer <token>'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('http://localhost:3000/api/v1/credentials?limit=20&offset=0', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer <token>'
    }
  });

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

  ```python Python theme={null}
  import requests

  url = "http://localhost:3000/api/v1/credentials"
  headers = {"Authorization": "Bearer <token>"}
  params = {"limit": 20, "offset": 0}

  response = requests.get(url, headers=headers, params=params)
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "success": true,
    "credentials": [
      {
        "id": "cred_123abc",
        "provider": "openai",
        "baseUrl": null,
        "models": ["gpt-4", "gpt-3.5-turbo"],
        "isValid": true,
        "lastValidatedAt": "2024-01-15T10:30:00Z",
        "createdAt": "2024-01-01T00:00:00Z",
        "maskedApiKey": "sk-...xyz"
      }
    ],
    "nextOffset": 20,
    "hasMore": false,
    "total": 5,
    "message": "Credentials retrieved successfully"
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "success": false,
    "credentials": [],
    "total": 0,
    "hasMore": false,
    "message": "Unauthorized"
  }
  ```
</ResponseExample>
