Get base model
Viewing v2— current version
curl --request GET \ --url https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models/:base_model_id \ --header 'Authorization: Bearer <token>'import requests
url = "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models/:base_model_id"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.json())const url = 'https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models/:base_model_id';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);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models/:base_model_id"
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
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models/:base_model_id", 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;}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models/:base_model_id") .get() .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();require 'uri'require 'net/http'
url = URI("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models/:base_model_id")
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_bodyvar client = new RestClient("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/base-models/:base_model_id");var request = new RestRequest("", Method.Get);request.AddHeader("Authorization", "Bearer <token>");var response = client.Execute(request);Changed in v2. This endpoint’s contract differs from v1. See the v2 migration guide for the request and response changes before you switch.
Get a base model’s capabilities, pricing, and typical generation time.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Id of the workspace that owns the resource.
Id of the workspace that owns the resource.
The base model, named by the id the list endpoint returns, or by its slug, display name, or alias.
The base model, named by the id the list endpoint returns, or by its slug, display name, or alias.
Responses
Section titled “Responses”Successful Response
object
Base model identifier, e.g. flux-dev — pass it as base_model_id.
Display name.
Community nicknames this model is also known by.
Image, video, three_d, or audio.
Slug of the organization behind the model, e.g. openai or bfl, when known.
Short description.
CU cost per measurement unit.
Measurement unit, e.g. megapixel, second, generation.
Typical generation time range, e.g. ‘5-15s’.
Supported inputs, sizes, and generation features.
object
Supported modes: create, create_video, create_3_d, create_speech, create_sound_effect, prompt_edit_image, etc.
Longest prompt, in characters, the model accepts; null when unbounded.
Generates a tileable image by construction when tileability is set, rather than through Layer’s seam-repair pass. Cannot be combined with a LoRA style.
Draws a game tile (isometric or hex) onto a fixed grid when a generation sets tile_grid.
Supported guidance inputs and their per-type file limits. init_image is the source image an edit model modifies; reference_image supplies subjects to reproduce; ip_adapter is legacy IP-Adapter style-only transfer.
object
Guidance file type, such as init_image, reference_image, first_frame, pose, or depth.
Maximum number of files of this type accepted by the model.
Longest single video or audio this slot accepts, in seconds. A cap on the combined length of several files is listed under shared_guidance_limits. Null when the model states no cap.
Shortest video or audio this slot accepts, in seconds; a shorter one is rejected. Null when the model states no floor.
Minimum number of files of this type a run must supply. 0 means the input is optional.
Caps on the combined count of several guidance types, on top of each type’s own max_count. A run must fit both: 9 images, 3 videos and 3 audio files can each be within their own limits and still exceed a 12-file total.
object
Guidance file types that count toward this limit.
Most files of these types one run may attach combined. Only one first_frame counts.
Shortest summed length, in seconds, of the videos or audio of these types. Null when unbounded.
Longest summed length, in seconds, of the videos or audio of these types. Null when unbounded.
3D models that read their init_image files by view: the views a source can fill. Tag each init_image with the view it shows (view on the guidance file); the model reads each file as the view it is tagged with, so a wrong tag warps the mesh. Empty when the model takes its views unordered.
Supported video durations in seconds
Audio models: shortest clip this model generates, in seconds.
Audio models: longest clip this model generates, in seconds. Pass duration_seconds between the min and max; a request outside them is refused.
This model has no default clip length; without duration_seconds the shortest is used.
Quality rungs this model offers, lowest first, from minimal, low, medium, high, xhigh, max. Empty means the model has no quality control. Pass one of these as quality; a rung outside the list is clamped to the nearest one offered rather than refused. Higher rungs can cost more — price a run before spending on one.
Composes music. Distinguishes a music model from a sound-effect model, which the modality and the duration range alone do not.
Takes sung words in a dedicated lyrics input, separate from the text prompt. This describes the input shape, not whether the model can sing: some families read lyrics written into the prompt instead, so a false value is not a reason to rule a model out for a song.
The model sets the output length itself, from the text or the input file. It has no duration control, so duration_seconds is ignored: do not promise a requested length.
Takes a flag that guarantees no vocals. On other music models, asking for an instrumental in the prompt is only a suggestion.
Composes the clip to repeat with no audible seam when the loop parameter is set.
Takes the track as an ordered list of sections, each with its own length, styles and sung lines, via the composition_plan parameter. A plan supersedes prompt, duration_seconds and instrumental, which are dropped rather than sent with it.
Scores a video stretch by stretch from a contiguous list of per-stretch briefs.
Containers this model can be asked to deliver. Layer never re-encodes a clip, so an empty list means the model returns what it returns and the format cannot be promised.
Speaks only in a trained voice, so a generation needs a reference set holding one. Without it the provider falls back to its own default voice.
Renders a quick, low-cost draft when draft is set, to be completed at full quality later by its completion model (see the forge instructions).
Example
{ "aliases": [], "modality": "text", "capabilities": { "text_prompt": false, "text_prompt_required": false, "negative_prompt": false, "seed": false, "inpainting": false, "outpainting": false, "tileability": false, "native_tileability": false, "tile_grid": false, "guidance_file_types": [ { "min_count": 0 } ], "duration_seconds_required": false, "generate_audio": false, "lipsync": false, "textures": false, "quad_mesh": false, "pbr_materials": false, "generate_parts": false, "text_to_speech": false, "sound_effect": false, "music": false, "lyrics": false, "auto_duration": false, "instrumental": false, "loop": false, "composition_plan": false, "audio_inpaint": false, "audio_outpaint": false, "audio_segments": false, "voice_reference_set_required": false, "rigging": false, "animation": false, "camera_transform": false, "draft": false, "camera_trajectory": false, "voice_changer": false, "audio_isolation": false, "audio_denoise": false, "audio_separation": false }}Unauthenticated — missing or invalid Bearer token.
object
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.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Resource not found.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}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
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.
object
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.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Internal server error.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}