modified_magicapi-hair.json•5.14 kB
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.1.3",
"description": "API for simulating different hair styles using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/magicapi/hair"
}
],
"paths": {
"magicapi/hair/predictions/{request_id}": {
"get": {
"summary": "Get hairstyled image URL",
"description": "This endpoint retrieves the URL of the simulated hairstyle image for a given request ID.\n",
"parameters": [
{
"name": "request_id",
"in": "path",
"required": true,
"description": "Unique identifier for the request.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Status of the prediction (e.g., \"succeeded\")."
},
"image_url": {
"type": "string",
"format": "uri",
"description": "URL of the hairstyled image."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"magicapi/hair/hair": {
"post": {
"summary": "Hair style simulator",
"description": "API for simulating different hair styles using AI models. Make sure to call get hairstyled image after with the request id received from this API.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"image": {
"type": "string",
"default": "https://replicate.delivery/mgxm/b8be17a7-abcb-4421-80f2-e6a1e3fe38c7/MarkZuckerberg.jpg"
},
"editing_type": {
"type": "string",
"default": "both"
},
"color_description": {
"type": "string",
"default": "blond"
},
"hairstyle_description": {
"type": "string",
"default": "hi-top fade hairstyle"
}
},
"required": [
"image",
"editing_type",
"color_description",
"hairstyle_description"
]
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"request_id": {
"type": "string",
"description": "Unique identifier for the request."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}