Skip to content

Get recommended base models

Viewing v2— current version

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

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.

workspace_id
required
Workspace Id

Id of the workspace that owns the resource.

string format: uuid

Id of the workspace that owns the resource.

Successful Response

Media typeapplication/json
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
price_per_unit
Any of:
number
price_unit
Any of:
string
inference_timing
required
Inference Timing

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

string
Example
{
"base_models": [
{
"aliases": [],
"modality": "text"
}
]
}

Unauthenticated — missing or invalid Bearer token.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

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

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Resource not found.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

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

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

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

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

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

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Internal server error.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}