Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.focusapi.cn/llms.txt

Use this file to discover all available pages before exploring further.

FocusAPI 支持多种图像能力,具体可用模型与路径以 模型广场 为准。常见形态包括 OpenAI 兼容的 Images API 及部分厂商原生路径。

OpenAI 兼容图像生成(常见)

POST /v1/images/generations

示例

curl https://api.FocusAPI.com/v1/images/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dall-e-3",
    "prompt": "A minimal blue icon of a cloud",
    "n": 1,
    "size": "1024x1024"
  }'
model 替换为平台上架的图片模型 ID。

请求注意点

项目说明
模型名必须与模型广场一致
size / quality部分模型仅支持特定尺寸,以模型文档为准
异步任务部分视频/图像厂商为异步任务,需轮询任务 ID(见模型说明)

错误与限流

  • 余额不足、模型不可用 → 查看响应 body 中的 messageerror 字段
  • 429 限流
  • 生成时间过长 → 524 超时

相关文档