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

# List models

> List the AI models available to your Yelu API key in an OpenAI-compatible model catalog.

Returns the model IDs currently available to the authenticated API key. Use this endpoint during configuration or periodic catalog refresh instead of assuming that every provider model is enabled.

## Endpoint

```http theme={"theme":{"light":"github-light","dark":"github-dark"}}
GET https://api.yelu.ai/v1/models
```

## Headers

<ParamField header="Authorization" type="string" required>
  API key using the format `Bearer $YELU_API_KEY`.
</ParamField>

## Request body

This endpoint does not accept a request body.

## Response

<ResponseField name="object" type="string" required>
  Always `list` for an OpenAI-compatible model collection.
</ResponseField>

<ResponseField name="data" type="array" required>
  Models available to the authenticated key.

  <Expandable title="model properties">
    <ResponseField name="id" type="string" required>
      Model identifier to send in API requests.
    </ResponseField>

    <ResponseField name="object" type="string" required>
      Object type, normally `model`.
    </ResponseField>

    <ResponseField name="created" type="integer">
      Unix timestamp associated with the catalog entry when supplied.
    </ResponseField>

    <ResponseField name="owned_by" type="string">
      Provider or organization label associated with the model.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl https://api.yelu.ai/v1/models \
    -H "Authorization: Bearer $YELU_API_KEY"
  ```

  ```javascript JavaScript (Fetch) theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const response = await fetch('https://api.yelu.ai/v1/models', {
    headers: { Authorization: `Bearer ${process.env.YELU_API_KEY}` },
  });

  if (!response.ok) throw new Error(await response.text());
  const models = await response.json();
  console.log(models.data.map(({ id }) => id));
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import os
  import requests

  response = requests.get(
      "https://api.yelu.ai/v1/models",
      headers={"Authorization": f"Bearer {os.environ['YELU_API_KEY']}"},
      timeout=30,
  )
  response.raise_for_status()
  print([model["id"] for model in response.json()["data"]])
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "object": "list",
    "data": [
      {
        "id": "gpt-4o-mini",
        "object": "model",
        "created": 1721172741,
        "owned_by": "openai"
      },
      {
        "id": "claude-3-7-sonnet",
        "object": "model",
        "created": 1740096000,
        "owned_by": "anthropic"
      }
    ]
  }
  ```

  ```json 401 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "error": {
      "message": "Invalid API key.",
      "type": "authentication_error",
      "param": null,
      "code": "invalid_api_key"
    }
  }
  ```
</ResponseExample>

## Error codes

| Status | Code or type           | Meaning                                       |
| ------ | ---------------------- | --------------------------------------------- |
| `401`  | `authentication_error` | The Bearer token is missing or invalid.       |
| `403`  | `permission_denied`    | The key or account is disabled or restricted. |
| `429`  | `rate_limit_error`     | The request limit has been reached.           |
| `500`  | `server_error`         | The gateway could not build the catalog.      |

<Note>
  A model appearing in the catalog identifies routable access. Capability support—such as vision, tools, JSON schema, audio, or image generation—still depends on that model.
</Note>
