Browse documentationLoRA Details

GET /api/v1/loras/{lora_id}

API version: v1.2.4

Get detailed information about a specific LoRA model.

Endpoint

Plain text
GET /api/v1/loras/{lora_id}

Authentication

Required. Include your API key in the request header:

Plain text
X-API-Key: your-api-key-here

Path Parameters

ParameterTypeRequiredDescription
lora_idstringYesUUID of the LoRA model

Response

Success (200 OK)

JSON
{
  "lora_id": "550e8400-e29b-41d4-a716-446655440000",
  "file_id": "lora-550e8400-e29b-41d4-a716-446655440000",
  "user_id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Anime Style LoRA",
  "description": "Custom trained for anime-style character generation",
  "tags": ["anime", "character", "style"],
  "default_scale": 0.8,
  "high_noise_url": "https://s3.amazonaws.com/bucket/lora/high_noise.safetensors",
  "low_noise_url": "https://s3.amazonaws.com/bucket/lora/low_noise.safetensors",
  "file_size": 524288000,
  "usage_count": 42,
  "created_at": "2024-01-15T10:30:00Z",
  "last_used_at": "2024-01-20T14:25:00Z",
  "status": "ready",
  "error_message": null
}

Response Fields

FieldTypeDescription
lora_idstringUnique UUID identifier
file_idstringFile identifier (format: lora-{uuid})
user_idstringOwner's user UUID (null if public)
namestringDisplay name
descriptionstringDescription text
tagsarrayList of tags
default_scalefloatDefault LoRA strength (0.0-1.0)
high_noise_urlstringStorage URL of high noise file
low_noise_urlstringStorage URL of low noise file
file_sizeintegerTotal file size in bytes
usage_countintegerNumber of times used in video generation
created_atstringISO 8601 creation timestamp
last_used_atstringISO 8601 last usage timestamp (null if never used)
statusstringCurrent status: pending, downloading, ready, trained, failed, expired, deleted
error_messagestringError description if status is failed (null otherwise)
sourcestringOrigin of the model. Always upload for LoRAs created through this API
expires_atstringISO 8601 expiration timestamp
expiredbooleanWhether the LoRA has expired

Examples

Get LoRA Details (cURL)

cURL
curl -X GET "https://phosor.ai/api/v1/loras/550e8400-e29b-41d4-a716-446655440000" \
  -H "X-API-Key: your-api-key"

Get and Display Details (Python)

Python
import requests

def get_lora_details(lora_id, api_key):
    """Get detailed information about a LoRA model"""
    response = requests.get(
        f"https://phosor.ai/api/v1/loras/{lora_id}",
        headers={"X-API-Key": api_key}
    )

    if response.status_code == 200:
        return response.json()
    elif response.status_code == 404:
        print(f"LoRA {lora_id} not found")
        return None
    else:
        print(f"Error: {response.text}")
        return None

# Usage
lora = get_lora_details("550e8400-e29b-41d4-a716-446655440000", "your-api-key")

if lora:
    print(f"Name: {lora['name']}")
    print(f"Description: {lora['description']}")
    print(f"Status: {lora['status']}")
    print(f"Default Scale: {lora['default_scale']}")
    print(f"File Size: {lora['file_size'] / 1024 / 1024:.2f} MB")
    print(f"Usage Count: {lora['usage_count']}")
    print(f"Tags: {', '.join(lora['tags'] or [])}")
    print(f"Created: {lora['created_at']}")
    print(f"Last Used: {lora['last_used_at'] or 'Never'}")

JavaScript Example

JavaScript
async function getLoraDetails(loraId, apiKey) {
  const response = await fetch(
    `https://phosor.ai/api/v1/loras/${loraId}`,
    {
      headers: { 'X-API-Key': apiKey }
    }
  );

  if (response.ok) {
    return await response.json();
  } else if (response.status === 404) {
    console.log('LoRA not found');
    return null;
  } else {
    throw new Error(await response.text());
  }
}

// Usage
getLoraDetails('550e8400-e29b-41d4-a716-446655440000', 'your-api-key')
  .then(lora => {
    if (lora) {
      console.log(`Name: ${lora.name}`);
      console.log(`Status: ${lora.status}`);
      console.log(`Usage: ${lora.usage_count} times`);
    }
  });

Verify Before Using

Python
import requests

def verify_lora_for_use(lora_id, api_key):
    """Verify a LoRA model is ready for video generation"""
    response = requests.get(
        f"https://phosor.ai/api/v1/loras/{lora_id}",
        headers={"X-API-Key": api_key}
    )

    if response.status_code != 200:
        return False, "LoRA not found"

    lora = response.json()

    if lora["status"] != "ready":
        return False, f"LoRA status is '{lora['status']}', not 'ready'"

    if not lora["high_noise_url"] or not lora["low_noise_url"]:
        return False, "LoRA files not available"

    return True, lora

# Usage
is_valid, result = verify_lora_for_use(
    "550e8400-e29b-41d4-a716-446655440000",
    "your-api-key"
)

if is_valid:
    print(f"LoRA '{result['name']}' is ready to use")
    print(f"Recommended scale: {result['default_scale']}")
else:
    print(f"Cannot use LoRA: {result}")

Display LoRA Card

Python
import requests

def display_lora_card(lora_id, api_key):
    """Display formatted LoRA information"""
    response = requests.get(
        f"https://phosor.ai/api/v1/loras/{lora_id}",
        headers={"X-API-Key": api_key}
    )

    if response.status_code != 200:
        print("LoRA not found")
        return

    lora = response.json()

    print("=" * 50)
    print(f"  {lora['name']}")
    print("=" * 50)
    print(f"  ID: {lora['lora_id']}")
    print(f"  Status: {lora['status']}")
    print()

    if lora['description']:
        print(f"  Description:")
        print(f"    {lora['description']}")
        print()

    if lora['tags']:
        print(f"  Tags: {', '.join(lora['tags'])}")

    print(f"  Default Scale: {lora['default_scale']}")
    print(f"  File Size: {lora['file_size'] / 1024 / 1024:.1f} MB")
    print()
    print(f"  Statistics:")
    print(f"    Usage Count: {lora['usage_count']}")
    print(f"    Created: {lora['created_at'][:10]}")

    if lora['last_used_at']:
        print(f"    Last Used: {lora['last_used_at'][:10]}")
    print("=" * 50)

# Usage
display_lora_card("550e8400-e29b-41d4-a716-446655440000", "your-api-key")

Difference from Status Endpoint

Aspect/api/v1/loras/{lora_id}/status/api/v1/loras/{lora_id}
PurposeCheck upload progressGet full details
FieldsMinimal (status focused)Complete (all fields)
Use CasePolling during uploadDisplay/verification

Error Responses

LoRA Not Found (404 Not Found)

JSON
{
  "error": "LoRA not found",
  "message": "No LoRA model found with the specified ID"
}

Unauthorized (401 Unauthorized)

JSON
{
  "error": "API key required",
  "message": "X-API-Key header is required"
}