跳转到主要内容
POST
Create Image

请求规范

  • 方法与路径: POST /apis/v1/htmlcss-to-image/create-image
  • 可用状态: enabled
  • 请求 URL 模板: https://api.aisa.one/apis/v1/htmlcss-to-image/create-image
完整 OpenAPI 定义 有效请求声明(包括认证和引用的 schema):

费用与请求规则

按实际用量收费。 默认请求预估费用:$0.0143 USD。 最终费用以实际用量为准。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
html
string
必填

HTML to render. Set this or url, but not both.

Minimum string length: 1
示例:

"<div class='card'>Hello</div>"

media_type
enum<string>
必填

CSS media type used while rendering: screen or print.

可用选项:
screen
ms_delay
integer
必填

Extra render delay in milliseconds, from 0 to 10000. Zero omits the explicit delay.

必填范围: 1 <= x <= 10000
render_when_ready
enum<boolean>
必填

Wait until the page signals that rendering is ready.

可用选项:
false
additional_header_origins
string[]

Up to 20 unique exact HTTP(S) origins that may also receive headers.

Maximum array length: 20
示例:

Attempt to block common consent banners.

color_scheme
enum<string>

Preferred browser color scheme: light or dark.

可用选项:
light,
dark
css
string

CSS applied to supplied HTML or injected into a captured webpage.

示例:

".card { padding: 24px; }"

dedupe_duration_s
integer

Reuse a matching recent render for this many seconds. Allowed durations depend on the account plan; free accounts accept 0 or 2592000 (30 days).

必填范围: x >= 0
device_scale
number
默认值:2

Device scale factor from 0.1 to 3.

必填范围: 0.1 <= x <= 3
full_screen
boolean
默认值:false

Capture the full scrollable page instead of only the viewport.

google_fonts
string[]

Google Font family names to load while rendering.

示例:
headers
object

HTTP headers sent to the captured page, with at most 20 case-insensitive names.

示例:
include_headers_on_subrequests
boolean
默认值:false

Also include supplied headers on page subrequests.

max_wait_ms
integer

Maximum wait from 500 to 10000 milliseconds for page loading.

必填范围: 500 <= x <= 10000
selector
string

CSS selector for the element to capture.

示例:

"#invoice"

timezone
string

IANA timezone exposed to the rendered page.

示例:

"America/New_York"

transparent_background
boolean
默认值:false

Render a transparent background where supported.

url
string

Absolute, internet-reachable HTTP(S) webpage URL to capture. Set this or html, but not both; use headers for authenticated pages.

示例:

"https://example.com"

viewport_height
integer

Viewport height in pixels. Requires viewport_width.

必填范围: x >= 1
viewport_width
integer

Viewport width in pixels, from 1 to 6000. Requires viewport_height.

必填范围: 1 <= x <= 6000

响应

Tool result data

id
string
必填
url
string
必填