Headshot Generator

Headshot Generator

Overview

Transform your regular photos into professional headshots with our AI-powered Headshot Generator. Perfect for LinkedIn profiles, business cards, or any professional use. Simply upload your photo, and our AI will enhance it to create a high-quality, professional-looking headshot that makes you look your best. No professional photographer or expensive studio needed - get studio-quality results in minutes!

Key Features:

  • Creates professional-looking headshots from regular photos
  • Optimizes lighting and background
  • Enhances image quality while maintaining natural look
  • Perfect for professional profiles and business use

API Reference

  • URL: https://api.maxstudio.ai/headshot-generator
  • Method: POST

API Parameters

NameTypeRequiredDescription
imagestringyesBase64 encoded image

Note: The input image must contain a clearly visible person's face

⚠️ Important: When sending the base64 image, do not include the prefix (e.g., 'data:image/jpeg;base64,'). Send only the raw base64 string.

Header

NameTypeRequiredDescription
x-api-keystringyesYour API key obtained from the MaxStudio APIs Dashboard (opens in a new tab). Generate this key by logging into your account and navigating to the API Keys section.

Code Examples

// TypeScript implementation
interface Params {
image: string;
}
async function HeadshotGenerator(image: string): Promise<any> {
try {
const response = await fetch('https://api.maxstudio.ai/headshot-generator', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
image: image,
})
});
const jobId = await response.json();
return jobId;
} catch (error) {
console.error('Error:', error);
throw error;
}
}

Success Response

{

"jobId": "<job_id>"
}

Error Response Examples

// Rate Limit Error

{
"status": 429,
"error": "Rate limit exceeded. Please try again later."
}
// Insufficient Credits

{
"status": 402,
"error": "Insufficient credits. Please Buy credits."
}
// Invalid Input

{
"status": 400,
"error": "Image size must be less than 5MB"
}

Get Job Status

Header

NameTypeRequiredDescription
x-api-keystringyesYour API key obtained from the MaxStudio APIs Dashboard (opens in a new tab). Generate this key by logging into your account and navigating to the API Keys section.

To check the status of your job, use the following examples:

// TypeScript implementation
async function getJobStatus(jobId: string): Promise<string> {
const url = `https://api.maxstudio.ai/headshot-generator/${jobId}`;
try {
const response = await axios.get(url);
const jobId = await response.json();
return jobId;
} catch (error) {
console.error('Error:', error);
throw error;
}
}

Job Status Reference

StatusDescription
creatingJob is being initialized
pendingJob is in processing queue
runningJob is actively processing
completedProcessing finished successfully
failedProcessing encountered an error
not-foundInvalid or expired job ID

Output

{

"status": "<status>", // One of the status values from the table above
"result": "<result>" // Base64 encoded image data when status is 'completed'
}