xAI
按实际用量计费
ae_xai
根据文本提示创建最多四张图片,可选择宽高比、分辨率和文件格式。
按实际用量计费
价格说明
| 条件 | 费用 |
|---|---|
| 图片分辨率为1k | 按实际成功生成图片数收费,每张图片60 AE积分。 |
| 图片分辨率为2k | 按实际成功生成图片数收费,每张图片84 AE积分。 |
| 图片分辨率未设置 | 按实际成功生成图片数收费,每张图片60 AE积分。 |
未指定分辨率时按1k计费;每次请求默认生成1张图片。费用根据实际成功生成的图片数量和所选分辨率计算。宽高比、输出格式和同步模式可配置。
工具参数
未传入的可选参数将使用平台默认值。
| 参数 | 类型 | 必填 | 说明 | 默认值 |
|---|---|---|---|---|
request_body | object | 是 | 暂无参数说明。 | — |
request_body.prompt | string | 是 | Text description of the desired image. | — |
request_body.sync_mode | boolean | 否 | If `True`, the media will be returned as a data URI and the output data won't be available in the request history. | false |
request_body.num_images | integer | 否 | Number of images to generate. | 1 |
request_body.resolution | enum (1k | 2k) | 否 | Resolution of the generated image. `1k` for standard resolution, `2k` for high resolution. | 1k |
request_body.aspect_ratio | enum (2:1 | 20:9 | 19.5:9 | 16:9 | 4:3 | 3:2 | 1:1 | 2:3 | 3:4 | 9:16 | 9:19.5 | 9:20 | 1:2) | 否 | Aspect ratio of the generated image. | 1:1 |
request_body.output_format | enum (jpeg | png | webp) | 否 | The format of the generated image. | jpeg |
调用示例
提交任务并查询完成结果
POST
/agent-api/v1/tool/executeX-Api-Key先提交任务,再用返回的 task_id 查询,直至完成。
请求代码request.sh
curl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_xai' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"request_body": {
"aspect_ratio": "9:16",
"num_images": 1,
"output_format": "png",
"prompt": "Vertical 9:16 cinematic still, exterior of a fictional ancient Chinese county yamen at early morning. A weathered dark wooden horizontal plaque hangs above a grey stone doorway, mounted visibly three degrees off level, its surface BLANK with absolutely NO characters, NO calligraphy, NO symbols. Pale plaster wall, grey stone steps, a few sparrows on the lintel edge, soft cold morning light from the left. Restrained earth-tone palette, film grain, shallow depth of field. No text, no watermark, no people, no readable characters anywhere.",
"resolution": "2k"
}
}
}'返回示例response.json
{
"description": "task accepted; poll the result via query_tool with this task_id",
"query_tool": "ae_get_result",
"status": "created",
"task_id": "806dd5d2-ca46-426b-8f1b-8ccbe1dca8b3"
}





