Jewelry Try-On API
Virtually try on jewelry on a model or generate professional jewelry photos.
GET/api/image/jewelry-try-on-prompts
Retrieve a list of all available pre-defined scene instructions for the Jewelry Try-On endpoint.
Example Request
curl -X GET 'https://codingmantra.com/api/image/jewelry-try-on-prompts'Example Response
{
"data": [
{
"id": "jewelry-elegant-portrait",
"title": "Elegant Portrait",
"categoryId": "studio-portrait",
"categoryTitle": "Studio & Portrait",
"demoImageUrl": "https://..."
},
// ... more prompts
]
}POST/api/image/jewelry-try-on
Virtually try on jewelry on a model or generate a professional jewelry photo.
Request Body
| Field | Type | Description |
|---|---|---|
| jewelryImages | Array of Objects | Required. An array of jewelry image objects. Each object must have either a `dataUrl` or `url`. Supports optional `label` and `prompt`. |
| personImage | string | Optional. A data URI or URL of a person to model the jewelry. If omitted, an AI model will be generated. |
| prompt | string | Optional. Additional instructions for the scene or model style. |
| logoImage | string | Optional. A data URI or URL of a logo to place on the image. |
| logoPlacement | string | Optional. Instructions for logo placement (e.g., 'top-left', 'center'). |
| logoSize | number | Optional. A numeric value (0.1 to 0.5) representing the logo size as a percentage of the image. |
| referenceImage | string | Optional. A data URI or URL of a reference image to guide the style. |
| aspectRatio | string | Optional. Default: `'1:1'`. |
| outputResult | string | Optional. `'base64'` (default) or `'url'`. |
Example Request
curl -X POST 'https://codingmantra.com/api/image/jewelry-try-on' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"jewelryImages": [
{ "url": "https://example.com/necklace.png", "label": "gold necklace" }
],
"personImage": "https://example.com/model.jpg",
"prompt": "elegant evening wear style",
"aspectRatio": "9:16"
}'Example Response
{
"data": {
"photoDataUri": "data:image/png;base64,..."
}
}