# Run an inference tool

POST

/v2/workspaces/{workspace\_id}/inference-tools/{inference\_tool\_key}/inferences

```bash
curl --request POST \
  --url https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inference-tools/:inference_tool_key/inferences \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "base_model_id": "<string>",
  "source_file_id": "<uuid>",
  "source_size": {
    "width": 0,
    "height": 0,
    "duration_seconds": 0
  },
  "source_transform": {
    "crop": {
      "x": 0,
      "y": 0,
      "width": 0,
      "height": 0
    },
    "rotate": 0
  },
  "mask_file_id": "<uuid>",
  "masked_edit_output": "composite",
  "batch_size": 1,
  "input": {},
  "reference_sets": [],
  "session_id": "<uuid>",
  "session_name": "<string>",
  "webhook": {
    "url": "<string>",
    "events": [
      "inference.completed"
    ],
    "metadata": {}
  }
}'
```

```python
import requests


url = "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inference-tools/:inference_tool_key/inferences"


payload = {
    "base_model_id": "<string>",
    "source_file_id": "<uuid>",
    "source_size": {
        "width": 0,
        "height": 0,
        "duration_seconds": 0
    },
    "source_transform": {
        "crop": {
            "x": 0,
            "y": 0,
            "width": 0,
            "height": 0
        },
        "rotate": 0
    },
    "mask_file_id": "<uuid>",
    "masked_edit_output": "composite",
    "batch_size": 1,
    "input": {},
    "reference_sets": [],
    "session_id": "<uuid>",
    "session_name": "<string>",
    "webhook": {
        "url": "<string>",
        "events": ["inference.completed"],
        "metadata": {}
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}


response = requests.post(url, json=payload, headers=headers)


print(response.json())
```

```js
const url = 'https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inference-tools/:inference_tool_key/inferences';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"base_model_id":"<string>","source_file_id":"<uuid>","source_size":{"width":0,"height":0,"duration_seconds":0},"source_transform":{"crop":{"x":0,"y":0,"width":0,"height":0},"rotate":0},"mask_file_id":"<uuid>","masked_edit_output":"composite","batch_size":1,"input":{},"reference_sets":[],"session_id":"<uuid>","session_name":"<string>","webhook":{"url":"<string>","events":["inference.completed"],"metadata":{}}}'
};


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"
  "strings"
  "net/http"
  "io"
)


func main() {


  url := "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inference-tools/:inference_tool_key/inferences"


  payload := strings.NewReader("{\n  \"base_model_id\": \"<string>\",\n  \"source_file_id\": \"<uuid>\",\n  \"source_size\": {\n    \"width\": 0,\n    \"height\": 0,\n    \"duration_seconds\": 0\n  },\n  \"source_transform\": {\n    \"crop\": {\n      \"x\": 0,\n      \"y\": 0,\n      \"width\": 0,\n      \"height\": 0\n    },\n    \"rotate\": 0\n  },\n  \"mask_file_id\": \"<uuid>\",\n  \"masked_edit_output\": \"composite\",\n  \"batch_size\": 1,\n  \"input\": {},\n  \"reference_sets\": [],\n  \"session_id\": \"<uuid>\",\n  \"session_name\": \"<string>\",\n  \"webhook\": {\n    \"url\": \"<string>\",\n    \"events\": [\n      \"inference.completed\"\n    ],\n    \"metadata\": {}\n  }\n}")


  req, _ := http.NewRequest("POST", url, payload)


  req.Header.Add("Authorization", "Bearer <token>")
  req.Header.Add("Content-Type", "application/json")


  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/inference-tools/:inference_tool_key/inferences",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'base_model_id' => '<string>',
    'source_file_id' => '<uuid>',
    'source_size' => [
        'width' => 0,
        'height' => 0,
        'duration_seconds' => 0
    ],
    'source_transform' => [
        'crop' => [
                'x' => 0,
                'y' => 0,
                'width' => 0,
                'height' => 0
        ],
        'rotate' => 0
    ],
    'mask_file_id' => '<uuid>',
    'masked_edit_output' => 'composite',
    'batch_size' => 1,
    'input' => [


    ],
    'reference_sets' => [


    ],
    'session_id' => '<uuid>',
    'session_name' => '<string>',
    'webhook' => [
        'url' => '<string>',
        'events' => [
                'inference.completed'
        ],
        'metadata' => [


        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);


$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();


MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"base_model_id\": \"<string>\",\n  \"source_file_id\": \"<uuid>\",\n  \"source_size\": {\n    \"width\": 0,\n    \"height\": 0,\n    \"duration_seconds\": 0\n  },\n  \"source_transform\": {\n    \"crop\": {\n      \"x\": 0,\n      \"y\": 0,\n      \"width\": 0,\n      \"height\": 0\n    },\n    \"rotate\": 0\n  },\n  \"mask_file_id\": \"<uuid>\",\n  \"masked_edit_output\": \"composite\",\n  \"batch_size\": 1,\n  \"input\": {},\n  \"reference_sets\": [],\n  \"session_id\": \"<uuid>\",\n  \"session_name\": \"<string>\",\n  \"webhook\": {\n    \"url\": \"<string>\",\n    \"events\": [\n      \"inference.completed\"\n    ],\n    \"metadata\": {}\n  }\n}");
Request request = new Request.Builder()
  .url("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inference-tools/:inference_tool_key/inferences")
  .post(body)
  .addHeader("Authorization", "Bearer <token>")
  .addHeader("Content-Type", "application/json")
  .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/inference-tools/:inference_tool_key/inferences")


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


request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"base_model_id\": \"<string>\",\n  \"source_file_id\": \"<uuid>\",\n  \"source_size\": {\n    \"width\": 0,\n    \"height\": 0,\n    \"duration_seconds\": 0\n  },\n  \"source_transform\": {\n    \"crop\": {\n      \"x\": 0,\n      \"y\": 0,\n      \"width\": 0,\n      \"height\": 0\n    },\n    \"rotate\": 0\n  },\n  \"mask_file_id\": \"<uuid>\",\n  \"masked_edit_output\": \"composite\",\n  \"batch_size\": 1,\n  \"input\": {},\n  \"reference_sets\": [],\n  \"session_id\": \"<uuid>\",\n  \"session_name\": \"<string>\",\n  \"webhook\": {\n    \"url\": \"<string>\",\n    \"events\": [\n      \"inference.completed\"\n    ],\n    \"metadata\": {}\n  }\n}"


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

```csharp
var client = new RestClient("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inference-tools/:inference_tool_key/inferences");
var request = new RestRequest("", Method.Post);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"base_model_id\": \"<string>\",\n  \"source_file_id\": \"<uuid>\",\n  \"source_size\": {\n    \"width\": 0,\n    \"height\": 0,\n    \"duration_seconds\": 0\n  },\n  \"source_transform\": {\n    \"crop\": {\n      \"x\": 0,\n      \"y\": 0,\n      \"width\": 0,\n      \"height\": 0\n    },\n    \"rotate\": 0\n  },\n  \"mask_file_id\": \"<uuid>\",\n  \"masked_edit_output\": \"composite\",\n  \"batch_size\": 1,\n  \"input\": {},\n  \"reference_sets\": [],\n  \"session_id\": \"<uuid>\",\n  \"session_name\": \"<string>\",\n  \"webhook\": {\n    \"url\": \"<string>\",\n    \"events\": [\n      \"inference.completed\"\n    ],\n    \"metadata\": {}\n  }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
```

* Layer API

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

Start a run of a Layer tool, such as `image.upscale`, on one of its base models: the one named, else the tool’s default for the caller. `input` holds the fields of the tool’s schema on that model (GET …/inference-schema); the tool sets the values it fixes. An edit takes the file it works on as `source_file_id`, never the `source_size` an estimate takes in its place, and the tools that take a mask take it as `mask_file_id`; every file is given by ID. An edit that sets no size keeps its source’s shape, and a reframe extends the source, centered, to the size asked for; an image reframe places the source elsewhere in the frame, turned or scaled, with `source_transform`. A reframe whose `input` sets no length runs as long as its source clip, up to the longest source the model reads; `normalized_parameters.duration_seconds` is the length it takes. Reference sets apply as on the flat run (`REFERENCE_SET_NOT_FOUND`, `REFERENCE_SET_REQUIRED`, `REFERENCE_SET_CONFLICT`, `REFERENCE_SET_LIMIT_EXCEEDED`). The asset the run makes reopens in that tool in the Layer app. Returns immediately with an inference ID; poll GET /v2/workspaces/{workspace\_id}/inferences/{inference\_id} for results.

## Authorizations

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

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

**inference\_tool\_key**

required

_Inference Tool Key_

Key of the inference tool, such as `image.upscale`, as returned by the list inference tools endpoint.

string

Key of the inference tool, such as `image.upscale`, as returned by the list inference tools endpoint.

### Header Parameters

**Idempotency-Key**

string

<= 255 characters

Opaque key making a retry of this request return the first result. A 2xx response is replayed for 24 hours with `Idempotent-Replayed: true`. A 4xx releases the key. A 5xx, or a request still running, holds the key for 120 seconds, during which a retry gets 409; after that a retry executes again. The key covers the method, path, query, and byte-identical body it was first used with; reusing it for a different request is rejected with 422\. Protection is best effort: if the key store is unavailable, or a record is lost early, a retry can execute again even after an earlier 409\. See the Idempotency section of the API description.

## Request Bodyrequired

_RunInferenceToolInput_object

**base\_model\_id**

_Base Model ID_

The base model to run the tool on, by ID, slug, name or alias: one of the tool’s `base_model_ids`. Without it, the run takes the tool’s `default_base_model_id` for the caller.

string

nullable

**source\_file\_id**

_Source File ID_

The file an edit works on, from this workspace or public. Required where the tool’s schema has `x-source.required`; a tool that makes something new takes none.

string format: uuid

nullable

**source\_size**

Any of:

**InferenceToolSourceSizeInput**

_InferenceToolSourceSizeInput_

An edit’s source by its size, before it is uploaded.

object

**width**

required

_Width_

The source’s width in pixels, as displayed.

integer

\>= 1

**height**

required

_Height_

The source’s height in pixels, as displayed.

integer

\>= 1

**duration\_seconds**

_Duration Seconds_

A video source’s length in seconds. Required for a video; an image takes none.

number

nullable \> 0

**null**

null

**source\_transform**

Any of:

**InferenceToolSourceTransform**

_InferenceToolSourceTransform_

Where an image reframe puts its source in the frame: the source turned by `rotate`, then the frame drawn over it as `crop`. The frame’s size in pixels is the run’s own, so the crop’s size sets how large the source is in it.

object

**crop**

required

_InferenceToolSourceCrop_

The frame as a box over the source, in the source’s pixels after `rotate`. Its shape is the frame’s, the one `input.aspect_ratio` sets, to within 1.5%; its size against the source’s sets the source’s scale in the frame: a crop twice the source’s width shows the source at half the frame’s width. On an `AUTO` aspect ratio the crop is the frame, at the size the model renders.

object

**x**

required

_X_

The frame’s left edge, in the source’s pixels from the source’s left edge, or from its bounding box’s when `rotate` turns it. Negative where the frame starts left of the source: the model fills that area.

number

**y**

required

_Y_

The frame’s top edge, in the source’s pixels from the source’s top edge, or from its bounding box’s when `rotate` turns it. Negative where the frame starts above the source: the model fills that area.

number

**width**

required

_Width_

The frame’s width in the source’s pixels. Where the frame reaches past the source’s right edge, the model fills that area.

number

\> 0

**height**

required

_Height_

The frame’s height in the source’s pixels. Where the frame reaches past the source’s bottom edge, the model fills that area.

number

\> 0

**rotate**

_Rotate_

Degrees to turn the source clockwise about its center before the crop, -360 to 360\. The turned source’s canvas grows to its bounding box, the source centered in it, and `crop` is measured from that box’s top-left corner.

number

nullable \>= -360 <= 360

**null**

null

**mask\_file\_id**

_Mask File ID_

An image the size of the source, white where the edit may change it and black where the source stays as it is. Only where the tool’s schema has `x-source.takes_mask`.

string format: uuid

nullable

**masked\_edit\_output**

Any of:

**MaskedEditOutput**

_MaskedEditOutput_

What a masked edit returns. The outcomes exclude each other: a run returns one of them.

string

Allowed values: composite whole\_frame layers

**null**

null

**batch\_size**

_Batch Size_

How many outputs the run makes (1-16). More than 1 needs a tool and a model that batch.

integer

default: 1 \>= 1 <= 16

**input**

_Input_

The fields of the tool’s schema on the model (GET …/inference-schema), with files by `file_id`. A field left out takes the model’s default from the AI policy in force for the run, else its own default, and the tool sets the values it fixes. A run needs every field the schema requires; an estimate prices the form as it stands, so it may leave some of them out.

object

**_key_**

additional properties

any

**reference\_sets**

_Reference Sets_

Reference sets to apply, up to 25, from GET /v2/workspaces/{workspace\_id}/reference-sets. Some models need one: an ElevenLabs voice for a voice change or speech, an animation preset for Tripo’s animate. A run on such a model without one is refused with `REFERENCE_SET_REQUIRED`; an estimate prices it without one.

Array<object>

default: <= 25 items

_InferenceReferenceSetInput_object

**set\_id**

required

_Set ID_

Reference set ID from GET /v2/workspaces/{workspace\_id}/reference-sets.

string format: uuid

**weight**

_Weight_

Weight for the set’s LoRA adapter when one applies. Ignored for sets applied as reference images or prompt text.

number

default: 1 <= 2

**session\_id**

_Session ID_

Organize this run under this session, from GET /v2/workspaces/{workspace\_id}/sessions. Takes precedence over `session_name`, and must belong to this workspace. Its project’s AI policy decides the models the run may take and their defaults; an estimate with it prices the run in that project.

string format: uuid

nullable

**session\_name**

_Session Name_

Organize this run under the most recent active session with this name, creating one if none matches. Ignored when `session_id` is given. An estimate with it prices the run in that session’s project, or in the workspace when no session has the name yet.

string

nullable <= 255 characters

**webhook**

Any of:

**WebhookInput**

_WebhookInput_

Where to POST this request’s terminal events, and what to include with them.

object

**url**

required

_URL_

HTTPS URL that receives a POST when this request reaches a terminal state. Must be publicly reachable; must not redirect. Acknowledge with any 2xx within 10 seconds and do the work asynchronously. Reply 410 to stop delivery permanently.

string

<= 2048 characters

**events**

_Events_

Narrows what is delivered. Omit to receive every event this request can produce, which is what `expected_events` on the response lists.

Array<string>

nullable

Allowed values: inference.completed inference.failed inference.cancelled training.succeeded training.failed scoring\_run.completed scoring\_run.failed workflow\_run.succeeded workflow\_run.failed workflow\_run.cancelled

**metadata**

_Metadata_

Opaque key/value pairs echoed back verbatim in every delivery, for correlating a callback with your own records. At most 10 keys and 1024 bytes in total.

object

**_key_**

additional properties

string

**null**

null

## Responses 

### 202

Successful Response

_RunInferenceToolOutput_object

**inference\_id**

required

_Inference ID_

Unique identifier for this forge run.

string format: uuid

**status**

required

_InferenceStatus_

Current status: IN\_PROGRESS.

string

Allowed values: in\_progress complete failed cancelled deleted

**estimated\_price\_creative\_units**

_Estimated Price Creative Units_

Estimated price in Creative Units.

number

nullable

**poll\_interval\_seconds**

required

_Poll Interval Seconds_

Suggested polling interval in seconds.

integer

**created\_at**

required

_Created At_

Timestamp of when the run was created.

string format: date-time

**session\_id**

_Session ID_

Session ID the run was added to, if a session was specified.

string format: uuid

nullable

**normalized\_parameters**

Any of:

**NormalizedInferenceParameters**

_NormalizedInferenceParameters_

Inference parameters after model-specific normalization.

These reflect the actual values used for generation, including model defaults applied for any parameters not explicitly set.

object

**width**

_Width_

Resolved output width in pixels.

integer

nullable

**height**

_Height_

Resolved output height in pixels.

integer

nullable

**batch\_size**

_Batch Size_

Number of outputs to generate.

integer

nullable

**num\_inference\_steps**

_Num Inference Steps_

Resolved number of diffusion steps.

integer

nullable

**guidance\_scale**

_Guidance Scale_

Resolved guidance scale.

number

nullable

**duration\_seconds**

_Duration Seconds_

Resolved output length in seconds — video duration or audio clip length.

number

nullable

**fps**

_FPS_

Resolved FPS.

integer

nullable

**null**

null

**base\_model\_id**

required

_Base Model ID_

The base model the run takes: the one named, else the tool’s default.

string

**expected\_events**

_Expected Events_

The events this run can deliver, resolved when it was submitted and narrowed by `webhook.events`; empty when no webhook was supplied. Of the outcome events listed (`inference.completed`, `inference.failed`, `inference.cancelled`), only the one that ends the run arrives, and none does when `webhook.events` leaves that one out. The scoring events are listed where this scope has automatic scoring rules, so this is how to tell ‘more is coming’ from ‘that was everything’. Best-effort: a rule turned off mid-run can still remove a listed scoring event, and when the rules cannot be read at submission the scoring events are left out though they may still arrive.

Array<string>

default: 

Allowed values: inference.completed inference.failed inference.cancelled training.succeeded training.failed scoring\_run.completed scoring\_run.failed workflow\_run.succeeded workflow\_run.failed workflow\_run.cancelled

**reference\_set\_contributions**

_Reference Set Contributions_

Per-set summary of what each reference set contributed.

Array<object>

default: 

_ForgeReferenceSetContribution_object

**set\_id**

_Set ID_

Reference Set ID this contribution belongs to, if any.

string format: uuid

nullable

**lora\_applied**

_LoRA Applied_

True when the set’s trained finetune (a LoRA, or a Recraft style) was applied.

boolean

**animation\_applied**

_Animation Applied_

True when an animation (Meshy rigging action) finetune was applied for this set.

boolean

**voice\_applied**

_Voice Applied_

True when a voice (ElevenLabs) finetune was applied for this set.

boolean

**mapped\_asset\_count**

_Mapped Asset Count_

Number of assets successfully mapped to guidance inputs.

integer

0

**palette\_applied**

_Palette Applied_

True when the set’s palette went into the run’s color palette (up to the model’s color limit), or a palette passed with the request stood in for it.

boolean

**prompt\_fallback\_applied**

_Prompt Fallback Applied_

True when the set fell back to prompt-only representation.

boolean

**auto\_prompt\_applied**

_Auto Prompt Applied_

True when the set’s auto prompt addition was appended to the prompt. Informational: the text rides on top of whatever else the set contributed and is not a degradation.

boolean

**lora\_available\_but\_incompatible**

_LoRA Available But Incompatible_

True when SBMC has a LoRA for this set on another base model but not the one used.

boolean

**skipped\_not\_applicable**

_Skipped Not Applicable_

True when the set isn’t applicable to the chosen model (its modality / applicable base models exclude it) so no LoRA or assets were applied.

boolean

**skipped\_irrelevant\_category**

_Skipped Irrelevant Category_

True when the set’s category means nothing for the chosen model’s modality (a camera move on an image model), so it was dropped entirely, prompt text included. Implies skipped\_not\_applicable.

boolean

**reference\_sets\_degraded**

_Reference Sets Degraded_

True when at least one attached reference set did not meaningfully contribute. The run still costs Creative Units.

boolean

**reference\_sets\_warning**

_Reference Sets Warning_

Names each degraded reference set and why, or null when none is degraded.

string

nullable

##### Example

```json
{
  "status": "in_progress",
  "expected_events": [],
  "reference_set_contributions": [],
  "reference_sets_degraded": false
}
```

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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