Request
Example:Bearer {{YOUR_API_KEY}}
Body Params application/json
{
"svgCode": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 600\"><defs><style>@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&display=swap');text { font-family: 'Noto Serif SC', serif; }</style></defs><rect width=\"400\" height=\"600\" fill=\"#f0f0f0\"/><text x=\"200\" y=\"50\" font-size=\"24\" font-weight=\"bold\" text-anchor=\"middle\">汉语新解</text><line x1=\"50\" y1=\"70\" x2=\"350\" y2=\"70\" stroke=\"#333\" stroke-width=\"2\"/><text x=\"200\" y=\"110\" font-size=\"36\" font-weight=\"bold\" text-anchor=\"middle\">产品经理</text><text x=\"200\" y=\"140\" font-size=\"16\" text-anchor=\"middle\">Product Manager</text><text x=\"200\" y=\"160\" font-size=\"16\" text-anchor=\"middle\">プロダクトマネージャー</text><text x=\"50\" y=\"220\" font-size=\"18\"><tspan x=\"50\" dy=\"0\">职场生态链中的顶级捕食者,</tspan><tspan x=\"50\" dy=\"30\">以\"用户需求\"为食,</tspan><tspan x=\"50\" dy=\"30\">将其消化成无穷无尽的需求文档。</tspan><tspan x=\"50\" dy=\"30\">擅长用 PPT 构筑空中楼阁,</tspan><tspan x=\"50\" dy=\"30\">用数据魔法使猪飞上天。</tspan><tspan x=\"50\" dy=\"30\">是程序员的噩梦制造机,</tspan><tspan x=\"50\" dy=\"30\">也是公司 vision 的守护神。</tspan></text><rect x=\"50\" y=\"450\" width=\"300\" height=\"100\" fill=\"#ddd\" opacity=\"0.5\"/><circle cx=\"200\" cy=\"500\" r=\"40\" fill=\"#bbb\" opacity=\"0.7\"/><polygon points=\"180,480 220,480 200,520\" fill=\"#999\" opacity=\"0.7\"/><text x=\"200\" y=\"580\" font-size=\"14\" text-anchor=\"middle\" font-style=\"italic\">梦想家与实干家的完美结合体</text></svg>"
}
Request samples
curl --location --request POST 'https://api.302.ai/v1/svgtopng' \
--header 'Authorization: Bearer sk-mfYQzy0XTFfz4P16vRE4gFrKK1Nly4TozsMqbbb9PSiJUvFO' \
--header 'Content-Type: application/json' \
--data-raw '{
"svgCode": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 600\"><defs><style>@import url('\''https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&display=swap'\'');text { font-family: '\''Noto Serif SC'\'', serif; }</style></defs><rect width=\"400\" height=\"600\" fill=\"#f0f0f0\"/><text x=\"200\" y=\"50\" font-size=\"24\" font-weight=\"bold\" text-anchor=\"middle\">汉语新解</text><line x1=\"50\" y1=\"70\" x2=\"350\" y2=\"70\" stroke=\"#333\" stroke-width=\"2\"/><text x=\"200\" y=\"110\" font-size=\"36\" font-weight=\"bold\" text-anchor=\"middle\">产品经理</text><text x=\"200\" y=\"140\" font-size=\"16\" text-anchor=\"middle\">Product Manager</text><text x=\"200\" y=\"160\" font-size=\"16\" text-anchor=\"middle\">プロダクトマネージャー</text><text x=\"50\" y=\"220\" font-size=\"18\"><tspan x=\"50\" dy=\"0\">职场生态链中的顶级捕食者,</tspan><tspan x=\"50\" dy=\"30\">以\"用户需求\"为食,</tspan><tspan x=\"50\" dy=\"30\">将其消化成无穷无尽的需求文档。</tspan><tspan x=\"50\" dy=\"30\">擅长用 PPT 构筑空中楼阁,</tspan><tspan x=\"50\" dy=\"30\">用数据魔法使猪飞上天。</tspan><tspan x=\"50\" dy=\"30\">是程序员的噩梦制造机,</tspan><tspan x=\"50\" dy=\"30\">也是公司 vision 的守护神。</tspan></text><rect x=\"50\" y=\"450\" width=\"300\" height=\"100\" fill=\"#ddd\" opacity=\"0.5\"/><circle cx=\"200\" cy=\"500\" r=\"40\" fill=\"#bbb\" opacity=\"0.7\"/><polygon points=\"180,480 220,480 200,520\" fill=\"#999\" opacity=\"0.7\"/><text x=\"200\" y=\"580\" font-size=\"14\" text-anchor=\"middle\" font-style=\"italic\">梦想家与实干家的完美结合体</text></svg>"
}'
Responses
application/json Modified at 2024-09-19 06:35:24