# Models

> GET /v1/models returns the one model your key's allocation can call.

Source: https://cairva.xyz/docs/models

Lists the models your key can call. Because a key is bound to one allocation and an allocation covers one model, the list has exactly one entry.

```endpoint
GET /v1/models
```

Requires the `inference` scope.

## Example

```bash curl
curl https://cairva.xyz/v1/models \
  -H "Authorization: Bearer $CAIRVA_API_KEY"
```

```javascript JavaScript
const models = await client.models.list();
for (const model of models.data) console.log(model.id, model.context_length);
```

```python Python
for model in client.models.list():
    print(model.id, model.model_extra["context_length"])
```

## Response

```json
{
  "object": "list",
  "data": [
    {
      "id": "gemma4:e2b",
      "object": "model",
      "created": 1793433600,
      "owned_by": "cairva",
      "context_length": 8192
    }
  ]
}
```

| Field | Meaning |
| --- | --- |
| `id` | The value to send as `model` in chat completions |
| `created` | When the model was added to Cairva's catalog, in Unix seconds |
| `owned_by` | Always `cairva` |
| `context_length` | The model's context limit in tokens, from Cairva's catalog |

The `context_length` above is an example. Read the value for your model from the response.

Calling chat completions with any other `model` fails with `403 model_not_permitted`, and the message names the model your key can call.
