Skip to content

List inference tools

Viewing v2, the current version

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

New in v2. This endpoint has no v1 equivalent.

List the Layer tools this caller can run in the workspace, in the order the Layer app’s tools menu shows them. Each names the base models it runs on here and the one a run takes when it names none. A tool none of whose models the workspace allows is left out.

workspace_id
required
Workspace ID

ID of the workspace that owns the resource.

string format: uuid

ID of the workspace that owns the resource.

modality
Any of:
Modality
string
Allowed values: text image audio video three_d playable world

Only the tools that make this modality.

group
Any of:
InferenceToolGroup

Whether a tool makes something new or changes something the user already has.

string
Allowed values: generate edit

Only the tools that make something new (generate) or change an asset (edit).

project_id
Project ID

Optional project the work would be filed in: the models and defaults answered are those a run in it gets. Without it or session_id, the answer is for the workspace.

string format: uuid
nullable

Optional project the work would be filed in: the models and defaults answered are those a run in it gets. Without it or session_id, the answer is for the workspace.

session_id
Session ID

Optional session the work would land in: the answer is for its project. With project_id, the session must be in that project.

string format: uuid
nullable

Optional session the work would land in: the answer is for its project. With project_id, the session must be in that project.

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.

Successful Response

Media typeapplication/json
ListInferenceToolsOutput
object
inference_tools
required
Inference Tools
Array<object>
InferenceToolSummary
object
key
required
Key

The tool’s key, such as image.upscale.

string
name
required
Name

The tool’s name, as the Layer app shows it.

string
description
required
Description

What the tool does.

string
submit_label
required
Submit Label

What the tool’s run button says in the Layer app, such as Remove background.

string
progress_label
required
Progress Label

What the Layer app says while a run of the tool is in progress, such as Removing background.

string
group
required
InferenceToolGroup

generate for a tool that makes something new, edit for one that changes an asset.

string
Allowed values: generate edit
modality
required
Modality

The type of asset the tool makes.

string
Allowed values: text image audio video three_d playable world
source
required
Any of:
InferenceToolSource
object
modality
required
Modality

The type of asset the tool works on.

string
Allowed values: text image audio video three_d playable world
takes_mask
required
Takes Mask

Whether the tool can keep its edit to an area a mask marks. The tool’s schema on a base model says whether that model can, in x-source.takes_mask.

boolean
batches_outputs
required
Batches Outputs

Whether a run can make several outputs (batch_size above 1) where its model batches. False for a tool whose every run makes one.

boolean
concept
required
Concept

The icon the Layer app shows for the tool, by concept name, such as upscale. Null for a tool shown with its modality’s icon.

string
nullable
prompt_placeholder
required
Prompt Placeholder

The hint the Layer app shows in the tool’s empty prompt; null where it shows the default.

string
nullable
primary
required
Primary

Whether the tool is an edit people reach for most on its asset type, which the Layer app offers first where a file’s edits are listed.

boolean
keywords
required
Keywords

Extra terms a search matches the tool by, such as synonyms and the names the community uses.

Array<string>
base_model_ids
required
Base Model IDs

The base models the caller can run the tool on, in catalog order.

Array<string>
default_base_model_id
required
Default Base Model ID

The model a run of the tool takes when it names none: the tool’s own default, else the caller’s first pinned model among base_model_ids, else Layer’s recommendation for the tool’s job.

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
{
"inference_tools": [
{
"group": "generate",
"modality": "text",
"source": {
"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
error_code
required

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

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

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

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
error_code
required

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

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

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

Resource not found.

Media typeapplication/problem+json
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
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

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

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.

Media typeapplication/problem+json
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
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

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

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
error_code
required

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

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

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

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
error_code
required

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

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

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

Internal server error.

Media typeapplication/problem+json
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
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

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