# List base models

GET

/v2/workspaces/{workspace\_id}/base-models

```bash
curl --request GET \
  --url https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models \
  --header 'Authorization: Bearer <token>'
```

```python
import requests


url = "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models"


headers = {"Authorization": "Bearer <token>"}


response = requests.get(url, headers=headers)


print(response.json())
```

```js
const url = 'https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main


import (
  "fmt"
  "net/http"
  "io"
)


func main() {


  url := "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models"


  req, _ := http.NewRequest("GET", url, nil)


  req.Header.Add("Authorization", "Bearer <token>")


  res, _ := http.DefaultClient.Do(req)


  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)


  fmt.Println(res)
  fmt.Println(string(body))


}
```

```php
<?php


$curl = curl_init();


curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);


$response = curl_exec($curl);
$err = curl_error($curl);


curl_close($curl);


if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

```java
OkHttpClient client = new OkHttpClient();


Request request = new Request.Builder()
  .url("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models")
  .get()
  .addHeader("Authorization", "Bearer <token>")
  .build();


Response response = client.newCall(request).execute();
```

```ruby
require 'uri'
require 'net/http'


url = URI("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models")


http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true


request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'


response = http.request(request)
puts response.read_body
```

```csharp
var client = new RestClient("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models");
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer <token>");
var response = client.Execute(request);
```

* Layer API

> **Changed in v2.** This endpoint’s contract differs from v1\. See the [v2 migration guide](/docs/migration) for the request and response changes before you switch.

List the base models enabled for this workspace, sourced from the model registry. Results come back in Layer’s recommended order, which reflects synced quality and popularity signals and can therefore shift between requests. Reference sets are listed separately under /reference-sets.

## Authorizations

* **[bearerAuth](/docs/v2/rest-api#bearerauth)**
* **[oauth2](/docs/v2/rest-api#oauth2)**
* **[serviceAccount](/docs/v2/rest-api#serviceaccount)**  
generation:read

## Parameters

### Path Parameters

**workspace\_id**

required

_Workspace Id_

Id of the workspace that owns the resource.

string format: uuid

Id of the workspace that owns the resource.

### Query Parameters

**modality**

Any of:

**Modality**

_Modality_

string

Allowed values: text image audio video three\_d playable world

**null**

null

Filter by output modality

**search**

_Search_

Full-text search on name, aliases, and description

string

nullable

Full-text search on name, aliases, and description

**use\_case**

Any of:

**InferenceUseCase**

_InferenceUseCase_

string

Allowed values: text\_to\_image image\_editing multi\_angle inpainting reframing split\_into\_layers text\_to\_video image\_to\_video video\_editing video\_extend insert\_video video\_subtitle video\_lipsync motion\_transfer video\_object\_swap video\_character\_swap relight\_video image\_to\_video\_lipsync text\_to\_3d image\_to\_3d text\_to\_world image\_to\_world remesh retexture uv\_unwrap animate rig segment image\_segment image\_mask text\_to\_speech sound\_effects music upscaling video\_interpolation denoise\_image denoise\_video denoise\_audio voice\_change audio\_separation audio\_isolation deblur\_video restore\_image sdr\_to\_hdr\_video background\_removal vectorization virtual\_try\_on restyle pixelate colorize change\_expression erase\_object edit\_text dub\_video extend\_audio generate\_pbr\_materials create\_skybox complete\_draft

**null**

null

Filter to the models that declare this use case, in Layer’s recommended order for it. The finer-grained choice when the caller’s intent is known, e.g. `retexture` or `rig`.

**tileable**

_Tileable_

Set true to list only models that can generate seamless tileable textures.

boolean

Set true to list only models that can generate seamless tileable textures.

**limit**

_Limit_

Maximum number of results to return.

integer

default: 20 \>= 1 <= 100

Maximum number of results to return.

**cursor**

_Cursor_

Cursor from a previous response to fetch the next page.

string

nullable

Cursor from a previous response to fetch the next page.

## Responses

### 200

Successful Response

_ListBaseModelsOutput_object

**base\_models**

required

_Base Models_

Array<object>

_BaseModelSummary_object

**base\_model\_id**

required

_Base Model Id_

Base model identifier, e.g. flux-dev — pass it as `base_model_id`.

string

**name**

required

_Name_

Display name.

string

**aliases**

_Aliases_

Community nicknames this model is also known by.

Array<string>

default: 

**modality**

required

_Modality_

Image, video, three\_d, or audio.

string

Allowed values: text image audio video three\_d playable world

**provider**

_Provider_

Slug of the organization behind the model, e.g. openai or bfl, when known.

string

nullable

**description**

_Description_

Short description.

string

nullable

**price\_per\_unit**

_Price Per Unit_

CU cost per measurement unit.

number

nullable

**price\_unit**

_Price Unit_

Measurement unit, e.g. megapixel, second, generation.

string

nullable

**inference\_timing**

required

_Inference Timing_

Typical generation time range, e.g. ‘5-15s’.

string

**pagination**

required

_PaginationOutput_object

**next\_cursor**

_Next Cursor_

Cursor to use to get the next page

string

nullable

**has\_more\_results**

required

_Has More Results_

If there are more results to page through

boolean

**total\_count**

_Total Count_

Total number of results matching the query

integer

nullable

##### Example

```json
{
  "base_models": [
    {
      "aliases": [],
      "modality": "text"
    }
  ]
}
```

### 401

Unauthenticated — missing or invalid Bearer token.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```

### 403

Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```

### 404

Resource not found.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```

### 409

The outcome of the request with this `Idempotency-Key` is not known yet: it is still running, or it failed without a stored response. Retry after the number of seconds in `Retry-After`.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```

### 422

Invalid input parameters, or an `Idempotency-Key` reused for a different request.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```

### 429

Rate limited — retry after the number of seconds in `Retry-After`.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```

### 500

Internal server error.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```
