文生图
你可以通过文本提示生成图片,文本提示可以是任何描述性的句子,模型会根据这些描述生成相应的图片:异步生图
画图操作默认是同步的,即请求会等待直到图片生成完成:async 参数并将其设置为 true:
succeed,你就可以获取到生成的图片 URL。
更多画图 API 参数细节,请参考画图 API 手册。Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
"model":"gpt-image-1",
"prompt":"画一只可爱的小猫在草丛中玩耍"
}'
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
"model":"gpt-image-2",
"prompt":"画一只可爱的小猫在草丛中玩耍"
}'
async 参数并将其设置为 true:
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
"model":"gpt-image-2",
"prompt":"画一只可爱的小猫在草丛中玩耍",
"async": true
}'
curl --location --request GET 'https://geekai.co/api/v1/images/{task_id}' \
--header 'Authorization: Bearer $GEEKAI_API_KEY'
succeed,你就可以获取到生成的图片 URL。
更多画图 API 参数细节,请参考画图 API 手册。此页面对您有帮助吗?
