# Get recommended base models

GET

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

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

```python
import requests


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


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/defaults';
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/defaults"


  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/defaults",
  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/defaults")
  .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/defaults")


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/defaults");
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer <token>");
var response = client.Execute(request);
```

* Layer API

> **New in v2.** This endpoint has no v1 equivalent.

Layer’s curated recommendations, filtered to the models this workspace may run. Use this to pick a model when the caller named a modality or an intent but not a specific `base_model_id`: take entry `[0]` of the matching bucket, falling through to later entries if it is unavailable. Prefer `preferred_by_use_case` over `featured_by_modality` when the intent is known, since it is finer-grained.

The curation changes as models ship and are retired, so clients should re-read this periodically rather than hard-coding a model id.

## Authorizations

* **[bearerAuth](/docs/v2/rest-api#bearerauth)**
* **[oauth2](/docs/v2/rest-api#oauth2)**

## 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.

## Responses

### 200

Successful Response

_BaseModelDefaultsOutput_

Layer’s curated recommendations, filtered to what this workspace may run.

Both maps are ordered best-first, and entry `[0]` is the pick to use when the caller expresses no preference. Later entries are genuine fallbacks, so a client holding a stale copy can walk the list. Buckets left empty by workspace filtering are omitted rather than returned empty, so a present key always has a usable pick.

object

**featured\_by\_modality**

required

_Featured By Modality_

Recommended base models per output modality, best first. `[0]` is the default for a request that names only a modality.

object

**_key_**

additional properties

Array<string>

**preferred\_by\_use\_case**

required

_Preferred By Use Case_

Recommended base models per use case, best first. Finer-grained than modality — prefer this when the caller’s intent is known.

object

**_key_**

additional properties

Array<string>

**base\_models**

required

_Base Models_

Details for every base model named above, deduplicated, so a client can render a recommendation without a second request.

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

**description**

Any of:

**string**

string

**null**

null

**price\_per\_unit**

Any of:

**number**

number

**null**

null

**price\_unit**

Any of:

**string**

string

**null**

null

**inference\_timing**

required

_Inference Timing_

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

string

##### 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

##### Example

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

### 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

##### Example

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

### 404

Resource not found.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

##### Example

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

### 409

The request with this `Idempotency-Key` is still running — retry after the number of seconds in `Retry-After`.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

##### Example

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

### 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

##### Example

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

### 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

##### Example

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

### 500

Internal server error.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

##### Example

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