ساخت امضا با هوش مصنوعی
با استفاده از این وب سرویس میتوانید انواع امضای هنری، تایپوگرافی و دستنوشته را با کمک هوش مصنوعی و بر اساس متن، نام یا پرامپت دلخواه خود تولید کنید.
مشخصات
| مشخصه | مقدار |
|---|---|
| دستهبندی | هوش مصنوعی |
| وضعیت | فعال |
| نسخه API | apis-1 |
| فرمت پاسخ | JSON |
| آدرس پایه | https://open.nestapi.ir |
| مسیر | /apis-1/ai-signature |
| لینک کامل | https://open.nestapi.ir/apis-1/ai-signature |
متدهای HTTP
| متد | مسیر | نوع ورودی |
|---|---|---|
GET | /apis-1/ai-signature | Query String |
پارامترها
پارامترهای Query String
| نام | نوع | الزامی | پیشفرض | توضیحات |
|---|---|---|---|---|
text | string | خیر | — | متن مورد نظر برای تبدیل به امضا (اولویت اول) |
name | string | خیر | — | نام یا عبارت برای امضا (اولویت دوم) |
prompt | string | خیر | — | پرامپت توصیفی برای کنترل سبک امضا (اولویت سوم) |
first_name | string | خیر | — | نام کوچک (در صورت عدم استفاده از text/name/prompt) |
last_name | string | خیر | — | نام خانوادگی (در صورت عدم استفاده از text/name/prompt) |
color | string | خیر | #000000 | رنگ امضا بهصورت کد HEX |
lang | string | خیر | auto | زبان پردازش متن: auto (تشخیص خودکار)، en یا zh |
format | string | خیر | json | قالب خروجی: json (لیست امضاها) یا png (تحویل مستقیم تصویر) |
index | integer | خیر | 1 | شمارهٔ امضای انتخابی برای خروجی PNG مستقیم (1 تا 4) |
include_base64 | boolean | خیر | false | گنجاندن دادهٔ Base64 تصویر در پاسخ JSON |
نمونه درخواست
تولید امضا با متن (خروجی JSON)
لینک مستقیم
GET https://open.nestapi.ir/apis-1/ai-signature?text=Ali%20Reza&color=%230000FF&lang=auto
نمونه کد
- cURL
- PHP
- Python
- JavaScript
curl -X GET "https://open.nestapi.ir/apis-1/ai-signature?text=Ali%20Reza&color=%230000FF&lang=auto"
<?php
// composer require nestapi/nestapi
require 'vendor/autoload.php';
use NestApi\NestApi;
use NestApi\Exception\ApiException;
use NestApi\Exception\TransportException;
$api = new NestApi();
try {
$response = $api->aiSignature(text: 'Ali Reza', color: '#0000FF', lang: 'auto');
print_r($response->data);
} catch (ApiException $e) {
// Error reported by the API (validation, not found, rate limit, ...)
echo $e->getMessage();
} catch (TransportException $e) {
// Network error or unusable response; not a subclass of ApiException
echo 'Network error: ' . $e->getMessage();
}
# pip install nestapi-py
from nestapi import ApiError, NestApi, TransportError
with NestApi() as api:
try:
response = api.ai_signature(text="Ali Reza", color="#0000FF", lang="auto")
print(response.data)
except ApiError as e:
# Error reported by the API (validation, not found, rate limit, ...)
print(e.error_code, e)
except TransportError as e:
# Network error or unusable response; not a subclass of ApiError
print("Network error:", e)
// npm install @devh3n/nestapi
import { ApiError, NestApi, TransportError } from "@devh3n/nestapi";
const api = new NestApi();
try {
const response = await api.aiSignature({ text: "Ali Reza", color: "#0000FF", lang: "auto" });
console.log(response.data);
} catch (error) {
if (error instanceof ApiError) {
// Error reported by the API (validation, not found, rate limit, ...)
console.error(error.errorCode, error.message);
} else if (error instanceof TransportError) {
// Network error or unusable response; not a subclass of ApiError
console.error("Network error:", error.message);
}
}
دریافت مستقیم تصویر PNG (امضای شماره ۱)
لینک مستقیم
GET https://open.nestapi.ir/apis-1/ai-signature?name=John%20Doe&format=png&index=1
نمونه کد
- cURL
- PHP
- Python
- JavaScript
curl -X GET "https://open.nestapi.ir/apis-1/ai-signature?name=John%20Doe&format=png&index=1"
<?php
// composer require nestapi/nestapi
require 'vendor/autoload.php';
use NestApi\NestApi;
use NestApi\Exception\ApiException;
use NestApi\Exception\TransportException;
$api = new NestApi();
try {
$response = $api->aiSignature(name: 'John Doe', format: 'png', index: '1');
print_r($response->data);
} catch (ApiException $e) {
// Error reported by the API (validation, not found, rate limit, ...)
echo $e->getMessage();
} catch (TransportException $e) {
// Network error or unusable response; not a subclass of ApiException
echo 'Network error: ' . $e->getMessage();
}
# pip install nestapi-py
from nestapi import ApiError, NestApi, TransportError
with NestApi() as api:
try:
response = api.ai_signature(name="John Doe", format="png", index="1")
print(response.data)
except ApiError as e:
# Error reported by the API (validation, not found, rate limit, ...)
print(e.error_code, e)
except TransportError as e:
# Network error or unusable response; not a subclass of ApiError
print("Network error:", e)
// npm install @devh3n/nestapi
import { ApiError, NestApi, TransportError } from "@devh3n/nestapi";
const api = new NestApi();
try {
const response = await api.aiSignature({ name: "John Doe", format: "png", index: "1" });
console.log(response.data);
} catch (error) {
if (error instanceof ApiError) {
// Error reported by the API (validation, not found, rate limit, ...)
console.error(error.errorCode, error.message);
} else if (error instanceof TransportError) {
// Network error or unusable response; not a subclass of ApiError
console.error("Network error:", error.message);
}
}
دریافت امضا با نام و نام خانوادگی
لینک مستقیم
GET https://open.nestapi.ir/apis-1/ai-signature?first_name=John&last_name=Doe&color=%231a1a1a
نمونه کد
- cURL
- PHP
- Python
- JavaScript
curl -X GET "https://open.nestapi.ir/apis-1/ai-signature?first_name=John&last_name=Doe&color=%231a1a1a"
<?php
// composer require nestapi/nestapi
require 'vendor/autoload.php';
use NestApi\NestApi;
use NestApi\Exception\ApiException;
use NestApi\Exception\TransportException;
$api = new NestApi();
try {
$response = $api->aiSignature(first_name: 'John', last_name: 'Doe', color: '#1a1a1a');
print_r($response->data);
} catch (ApiException $e) {
// Error reported by the API (validation, not found, rate limit, ...)
echo $e->getMessage();
} catch (TransportException $e) {
// Network error or unusable response; not a subclass of ApiException
echo 'Network error: ' . $e->getMessage();
}
# pip install nestapi-py
from nestapi import ApiError, NestApi, TransportError
with NestApi() as api:
try:
response = api.ai_signature(first_name="John", last_name="Doe", color="#1a1a1a")
print(response.data)
except ApiError as e:
# Error reported by the API (validation, not found, rate limit, ...)
print(e.error_code, e)
except TransportError as e:
# Network error or unusable response; not a subclass of ApiError
print("Network error:", e)
// npm install @devh3n/nestapi
import { ApiError, NestApi, TransportError } from "@devh3n/nestapi";
const api = new NestApi();
try {
const response = await api.aiSignature({ first_name: "John", last_name: "Doe", color: "#1a1a1a" });
console.log(response.data);
} catch (error) {
if (error instanceof ApiError) {
// Error reported by the API (validation, not found, rate limit, ...)
console.error(error.errorCode, error.message);
} else if (error instanceof TransportError) {
// Network error or unusable response; not a subclass of ApiError
console.error("Network error:", error.message);
}
}
کدهای خطا
| کد | وضعیت | علت |
|---|---|---|
NOT_FOUND | 404 | مسیر وجود ندارد، یا متد روی آن ثبت نشده |
PARAM_NOT_FOUND | 400 | پارامتر لازم ارسال نشده |
VALIDATION_ERROR | 422 | پارامتر آمده ولی نوع، قالب یا بازهاش نادرست است |
IMAGE_NOT_FOUND | 404 | امضای درخواستی یافت نشد |
SIGNATURE_GENERATION_FAILED | 502 | تولید امضا توسط هوش مصنوعی با خطا مواجه شد |