curl --request POST \
--url https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid \
--header 'Content-Type: multipart/form-data' \
--header 'ailabapi-api-key: <api-key>' \
--form image='@example-file' \
--form expression=Angry \
--form 'style=3D Emoji Render' \
--form 'scene=Baby Shower' \
--form 'filler=Go Go Go'import requests
url = "https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid"
files = { "image": ("example-file", open("example-file", "rb")) }
payload = {
"expression": "Angry",
"style": "3D Emoji Render",
"scene": "Baby Shower",
"filler": "Go Go Go"
}
headers = {"ailabapi-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('image', '<string>');
form.append('expression', 'Angry');
form.append('style', '3D Emoji Render');
form.append('scene', 'Baby Shower');
form.append('filler', 'Go Go Go');
const options = {method: 'POST', headers: {'ailabapi-api-key': '<api-key>'}};
options.body = form;
fetch('https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"expression\"\r\n\r\nAngry\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"style\"\r\n\r\n3D Emoji Render\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scene\"\r\n\r\nBaby Shower\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filler\"\r\n\r\nGo Go Go\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"ailabapi-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"expression\"\r\n\r\nAngry\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"style\"\r\n\r\n3D Emoji Render\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scene\"\r\n\r\nBaby Shower\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filler\"\r\n\r\nGo Go Go\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ailabapi-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid")
.header("ailabapi-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"expression\"\r\n\r\nAngry\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"style\"\r\n\r\n3D Emoji Render\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scene\"\r\n\r\nBaby Shower\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filler\"\r\n\r\nGo Go Go\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ailabapi-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"expression\"\r\n\r\nAngry\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"style\"\r\n\r\n3D Emoji Render\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scene\"\r\n\r\nBaby Shower\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filler\"\r\n\r\nGo Go Go\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"request_id": "",
"log_id": "",
"error_code": 0,
"error_code_str": "",
"error_msg": "",
"error_detail": {
"status_code": 200,
"code": "",
"code_message": "",
"message": ""
},
"task_type": "async",
"task_id": ""
}AI Emoji Generator API
AI Emoji Generator API turns portrait or pet photos into emoji-style grids with consistent expressions and scenes.
curl --request POST \
--url https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid \
--header 'Content-Type: multipart/form-data' \
--header 'ailabapi-api-key: <api-key>' \
--form image='@example-file' \
--form expression=Angry \
--form 'style=3D Emoji Render' \
--form 'scene=Baby Shower' \
--form 'filler=Go Go Go'import requests
url = "https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid"
files = { "image": ("example-file", open("example-file", "rb")) }
payload = {
"expression": "Angry",
"style": "3D Emoji Render",
"scene": "Baby Shower",
"filler": "Go Go Go"
}
headers = {"ailabapi-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('image', '<string>');
form.append('expression', 'Angry');
form.append('style', '3D Emoji Render');
form.append('scene', 'Baby Shower');
form.append('filler', 'Go Go Go');
const options = {method: 'POST', headers: {'ailabapi-api-key': '<api-key>'}};
options.body = form;
fetch('https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"expression\"\r\n\r\nAngry\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"style\"\r\n\r\n3D Emoji Render\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scene\"\r\n\r\nBaby Shower\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filler\"\r\n\r\nGo Go Go\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"ailabapi-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"expression\"\r\n\r\nAngry\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"style\"\r\n\r\n3D Emoji Render\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scene\"\r\n\r\nBaby Shower\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filler\"\r\n\r\nGo Go Go\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ailabapi-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid")
.header("ailabapi-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"expression\"\r\n\r\nAngry\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"style\"\r\n\r\n3D Emoji Render\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scene\"\r\n\r\nBaby Shower\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filler\"\r\n\r\nGo Go Go\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ailabapi-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"expression\"\r\n\r\nAngry\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"style\"\r\n\r\n3D Emoji Render\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scene\"\r\n\r\nBaby Shower\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filler\"\r\n\r\nGo Go Go\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"request_id": "",
"log_id": "",
"error_code": 0,
"error_code_str": "",
"error_msg": "",
"error_detail": {
"status_code": 200,
"code": "",
"code_message": "",
"message": ""
},
"task_type": "async",
"task_id": ""
}Request
- URL:
https://www.ailabapi.com/api/image/effects/photo-to-emoji-grid - Method:
POST - Content-Type:
multipart/form-data
Image requirements
- Image format:
JPEGJPGPNGWEBP - Image size: No more than 10 MB.
- Image resolution: Less than 4096x4096px.
Headers
| Field | Required | Type | Description |
|---|---|---|---|
ailabapi-api-key | YES | string | Application API KEY. Get API KEY |
Body
| Field | Required | Type | Scope | Default | Description |
|---|---|---|---|---|---|
image | YES | file | Original image. | ||
expression | YES | string | Expression (English only). Max 100 characters; extra text will be automatically truncated. Use standard vocabulary. | ||
style | YES | string | Style (English only). Max 100 characters; extra text will be automatically truncated. Use standard vocabulary. | ||
scene | YES | string | Scene (English only). Max 100 characters; extra text will be automatically truncated. Use standard vocabulary. | ||
filler | NO | string | Filler text (English only). Max 20 characters; extra text will be automatically truncated. Use standard vocabulary. |
Response
-
Handle
Public Response FieldsParse and validate thePublic Response Fields, checking the status code or response message to ensure the request is successful and error-free. -
Handle
Business Response FieldsIf thePublic Response Fieldsare valid and error-free, proceed with processing the business logic in theBusiness Response Fields.
Public Response Fields
Viewing Public Response Fields and Error CodesBusiness Response Fields
| Field | Type | Scope | Description |
|---|---|---|---|
task_type | string | async | Task Type. “async: Asynchronous tasks. |
task_id | string | Asynchronous task ID. Please use this field when calling the Querying Async Task Results API. |
Response Example
{
"request_id": "",
"log_id": "",
"error_code": 0,
"error_code_str": "",
"error_msg": "",
"error_detail": {
"status_code": 200,
"code": "",
"code_message": "",
"message": ""
},
"task_type": "async",
"task_id": ""
}
task_id and call Querying Async Task Results to get the final results.Asynchronous task results are valid for 24 hours. It is recommended that asynchronous task results be queried every 5 seconds.Authorizations
API Key for authentication
Body
Original image.
- Image format:
JPEGJPGPNGWEBP - Image size: No more than 10 MB.
- Image resolution: Less than 4096x4096px.
Expression (English only). Max 100 characters; extra text will be automatically truncated. Use standard vocabulary to pass review.
100"Angry"
Style (English only). Max 100 characters; extra text will be automatically truncated. Use standard vocabulary to pass review.
100"3D Emoji Render"
Scene (English only). Max 100 characters; extra text will be automatically truncated. Use standard vocabulary to pass review.
100"Baby Shower"
Filler Text (English only). Max 20 characters; extra text will be automatically truncated. Use standard vocabulary to pass review.
20"Go Go Go"
Response
Success
The response is of type object.

