# Models

> GET /v1/models: the models your API key can call.

Lists the models your API key can call. The same response works with the OpenAI and Anthropic SDKs.

## Method and path

`GET /v1/models`

`GET /v1/models/{model}`

Base URL `https://api.relayvia.dev/v1`. Send the key as `Authorization: Bearer sk-...`.

## Common parameters

No parameters. The key in the header decides whose data is returned.

Requests are forwarded in the original format, so the original API's parameters work unless the next section says otherwise. This table lists the common ones; see the [official reference](https://platform.openai.com/docs/api-reference/models/list) for the rest.

## Differences from the original API

- Only models this key can call are listed: its group and model limits apply, and only models whose endpoint is open are included (chat models at launch; image and video models join when their endpoints open).
- Each model has `id`, `object`, `created` (Unix seconds) and `owned_by`: the vendor in lowercase with spaces as `-`, or `relayvia` when the model has no vendor. `GET /v1/models/<model>` returns one model, and 404 `model_not_found` when the key cannot use it or it does not exist.

## Request examples

**cURL**

```bash
curl https://api.relayvia.dev/v1/models \
  -H "Authorization: Bearer sk-..."
```

**Python**

```python
from openai import OpenAI

client = OpenAI(base_url="https://api.relayvia.dev/v1", api_key="sk-...")
for model in client.models.list():
    print(model.id)
```

**JavaScript**

```javascript
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.relayvia.dev/v1", apiKey: "sk-..." });
for await (const model of client.models.list()) {
  console.log(model.id);
}
```

## Response examples

```json
{
  "object": "list",
  "data": [
    {
      "id": "gpt-5.5",
      "object": "model",
      "created": 1767225600,
      "owned_by": "openai"
    },
    {
      "id": "claude-opus-5",
      "object": "model",
      "created": 1767225600,
      "owned_by": "anthropic"
    }
  ],
  "has_more": false
}
```

## Errors this endpoint returns

| HTTP | code | When |
| --- | --- | --- |
| `401` | `invalid_api_key` | The API key does not exist, is disabled or has expired. |
| `403` | `forbidden` | The key may not use this model, the source IP is not on the allowlist, or the account is disabled. |
| `404` | `model_not_found` | The model is not listed. |
| `429` | `rate_limited` | Too many requests: per IP, per key, per account, or too many requests in progress at once. |

Every code, its fixed message and what to do are on the [error codes](https://relayvia.dev/docs/errors) page.
