cURL
curl "https://api.ruseo.cn/api/ai_font?text=API+Hub&type=json"
通过AI进行字体设计,传入文字返回创意字体图片,支持JSON格式和直接返回图片两种方式。
https://api.ruseo.cn/api/ai_font
接口调用前需要确认的核心配置。
/api/ai_fontai_font必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
text |
是 | string | 待设计的文字内容 | API Hub |
type |
否 | string | 输出类型:image(返回图片) 或 json(返回JSON),默认json | json |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/ai_font?text=API+Hub&type=json
curl "https://api.ruseo.cn/api/ai_font?text=API+Hub&type=json"
$url = 'https://api.ruseo.cn/api/ai_font?text=API+Hub&type=json';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/ai_font?text=API+Hub&type=json')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "ai_font",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
text |
string | 设计的文字内容 | PearAPI |
now_time |
string | 生成时间 | 2024-01-01 12:00:00 |
size |
string | 图像尺寸 | 512x512 |
imgurl |
string | 图像链接 | https://xxx.com/output.png |
data |
string | 返回数据 | base64或URL |
点击左侧“发送请求”查看结果...