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

# Models, checkpoints, and LoRAs

> Select only catalog versions that are ready for your generation mode.

The API catalog returns versions currently available for the requested
generation mode. A model page being visible on the website does not necessarily
mean every version is available to the developer API.

## Query by mode and type

Both `mode` and `type` are required:

```http theme={"system"}
GET /api/v1/models?mode=text_to_image&type=checkpoint
GET /api/v1/models?mode=image_to_video&type=lora
```

Supported modes are:

* `text_to_image`
* `image_to_image`
* `image_edit`
* `text_to_video`
* `image_to_video`

Use `type=checkpoint` for the required base selection and `type=lora` for
optional adapters. You may also pass `q`, `baseModel`, `cursor`, and `limit`.

## Search and filter

Search names with `q` and narrow compatible adapters with `baseModel`:

```bash theme={"system"}
curl --get 'https://pornfactoryai.com/api/v1/models' \
  --header 'Authorization: Bearer pfai_YOUR_KEY' \
  --data-urlencode 'mode=text_to_image' \
  --data-urlencode 'type=lora' \
  --data-urlencode 'q=portrait' \
  --data-urlencode 'baseModel=SDXL 1.0' \
  --data-urlencode 'limit=20'
```

Each result contains the public IDs required for generation, display names,
base model, preview URL when available, and a credit estimate:

```json theme={"system"}
{
  "object": "list",
  "data": [
    {
      "object": "model",
      "model_id": "mdl_YOUR_MODEL",
      "version_id": "ver_YOUR_VERSION",
      "model_name": "Portrait style",
      "version_name": "Version 1",
      "model_type": "lora",
      "base_model": "SDXL 1.0",
      "credit_estimate": 4,
      "preview_url": "https://pornfactoryai.com/..."
    }
  ],
  "next_cursor": "CURSOR_OR_NULL"
}
```

When `next_cursor` is not `null`, pass it unchanged as `cursor` to fetch the
next page. Treat cursors as opaque values and do not construct them yourself.

## Generation selection

Every request requires one checkpoint:

```json theme={"system"}
{
  "checkpoint": {
    "model_id": "mdl_...",
    "version_id": "ver_..."
  }
}
```

Add up to four LoRAs with a strength from `0` through `2`:

```json theme={"system"}
{
  "loras": [
    {
      "model_id": "mdl_...",
      "version_id": "ver_...",
      "strength": 0.85
    }
  ]
}
```

<Note>
  Always use the exact model and version pair returned by the catalog. The API
  rejects mismatched, unavailable, or mode-incompatible selections.
</Note>

<Tip>
  Query the catalog at selection time instead of hard-coding availability.
  Catalog entries can change as versions become ready or unavailable.
</Tip>
