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

# GET /v1/models — List and Retrieve Models on Swytcho

> List all AI models your API key can access or retrieve details for a specific model ID, including ownership metadata and when it was added to the platform.

The models endpoints let you discover which AI models your API key can access and inspect the details of any individual model. Use these endpoints at runtime to build dynamic model selectors, validate a model ID before sending a generation request, or check when a model was added to the platform.

## Endpoints

### List all models

```text theme={null}
GET https://api.swytcho.com/v1/models
```

Returns an array of all models available to your account, including chat, completion, and embedding models.

### Get a specific model

```text theme={null}
GET https://api.swytcho.com/v1/models/{model_id}
```

Returns the details for a single model identified by its `model_id`. Returns a `404 Not Found` error if the model does not exist or is not accessible with your API key.

| Path Parameter | Type   | Description                                               |
| -------------- | ------ | --------------------------------------------------------- |
| `model_id`     | string | The unique identifier of the model (e.g., `swytcho-pro`). |

## Request Examples

<CodeGroup>
  ```bash List all models (curl) theme={null}
  curl https://api.swytcho.com/v1/models \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```bash Get a specific model (curl) theme={null}
  curl https://api.swytcho.com/v1/models/swytcho-pro \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import os
  from swytcho import Swytcho

  client = Swytcho(api_key=os.environ["SWYTCHO_API_KEY"])

  # List all models
  models = client.models.list()
  for model in models.data:
      print(model.id)

  # Get a specific model
  model = client.models.retrieve("swytcho-pro")
  print(model.id, model.owned_by)
  ```

  ```javascript Node.js theme={null}
  import Swytcho from "swytcho";

  const client = new Swytcho({ apiKey: process.env.SWYTCHO_API_KEY });

  // List all models
  const models = await client.models.list();
  for (const model of models.data) {
    console.log(model.id);
  }

  // Get a specific model
  const model = await client.models.retrieve("swytcho-pro");
  console.log(model.id, model.owned_by);
  ```
</CodeGroup>

## Response Fields

Each model object in the API response contains the following fields.

<ResponseField name="id" type="string">
  The unique identifier for the model (e.g., `"swytcho-pro"`). Pass this value as the `model` parameter in chat, completion, and embedding requests.
</ResponseField>

<ResponseField name="object" type="string">
  Always `"model"`.
</ResponseField>

<ResponseField name="created" type="integer">
  Unix timestamp (seconds) indicating when this model was made available on the platform.
</ResponseField>

<ResponseField name="owned_by" type="string">
  The organization that owns and maintains this model (e.g., `"swytcho"` for first-party models or the provider name for third-party models).
</ResponseField>

## Example Response — List All Models

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "id": "swytcho-pro",
      "object": "model",
      "created": 1710000000,
      "owned_by": "swytcho"
    },
    {
      "id": "swytcho-base",
      "object": "model",
      "created": 1710000001,
      "owned_by": "swytcho"
    },
    {
      "id": "swytcho-embed-v1",
      "object": "model",
      "created": 1710000002,
      "owned_by": "swytcho"
    }
  ]
}
```

## Example Response — Single Model

```json theme={null}
{
  "id": "swytcho-pro",
  "object": "model",
  "created": 1710000000,
  "owned_by": "swytcho"
}
```

<Tip>
  Call `GET /v1/models` at application startup to build a dynamic list of available models rather than hard-coding model IDs. This ensures your application automatically surfaces newly released models and gracefully handles the removal of deprecated ones without requiring a code deployment.
</Tip>
