Passport Photo API
Create compliant, professional passport-style photos, LinkedIn headshots, and ID card images.
GET/api/image/passport-photo-prompts
Retrieve a list of standard and creative passport photo styles.
Example Request
curl -X GET 'https://codingmantra.com/api/image/passport-photo-prompts'Example Response
{
"data": [
{
"id": "standard-passport",
"title": "Standard Passport Photo",
"categoryId": "official",
"categoryTitle": "Official & Formal",
"description": "Create a high-resolution..."
},
// ... more prompts
]
}POST/api/image/passport-photo
Process an image into a passport-style photo.
Request Body
| Field | Type | Description |
|---|---|---|
| photoDataUri | string | Required. Data URI or URL of the source photo. |
| prompt | string | Required. Instructions (e.g., "White background, neutral expression"). |
| model | string | Optional. `'standard'` (default) or `'pro'`. |
| aspectRatio | string | Optional. Default `'1:1'`. |
| referenceImage | string | Optional. Style reference image. |
| outputResult | string | Optional. `'base64'` (default) or `'url'`. |
Example Request
curl -X POST 'https://codingmantra.com/api/image/passport-photo' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"photoDataUri": "https://example.com/selfie.jpg",
"prompt": "Standard passport photo, white background, centered",
"aspectRatio": "1:1"
}'Example Response
{
"data": {
"photoDataUri": "data:image/png;base64,..."
}
}