Felo API PlatformFelo API Platform
v0.4.0
OpenAPI 3.1.0

Submit an image generation task

服务器:https://openapi.felo.ai
客户端库

Submit an image generation task

​

Returns HTTP 202 with a persistent task_id. Poll GET /api/v1/images/generations/{task_id}. Flat input or nested input is supported; nested input takes precedence. Callback fields are ignored. Capabilities and input parameters depend on the configured model and channel.

请求头
  • X-Request-Id
    类型: string

    Optional caller request ID echoed back for diagnostics.

  • X-Felo-Channel
    类型: string

    Ordered comma-separated public channel codes. Omit this header to use default; default must be used alone. In wallet mode, default scans the model's effective public channel order in reverse, skips unpublished or unavailable channels, and selects the first available channel's provider. It includes available endpoints from that provider with the same upstream model ID and service tier. Explicit channels are validated in client-specified order; only the first channel's provider group is submitted. No automatic fallback to other providers. Legacy provider headers cannot override channel routing.

请求体·ImageGenerationRequest
必填
application/json

Model-specific input follows the configured public model protocol.

  • model
    类型: string
    必填
  • image_urls
    类型: array string[]
  • input
    类型: object

    Optional nested input; takes precedence over flat input.

    • service_tier
      类型: string | null

      Currently only default (standard) is supported. Omitted, null, aliases and unsupported strings fallback to default; other types return HTTP 400. Configured channels and prices remain unchanged. Text APIs send the provider's standard value; Decisions and generation APIs omit the upstream field.

    • propertyName
      类型: anything
  • n
    类型: integer

    Integer numbers.

  • prompt
    类型: string
  • service_tier
    类型: string | null

    Currently only default (standard) is supported. Omitted, null, aliases and unsupported strings fallback to default; other types return HTTP 400. Configured channels and prices remain unchanged. Text APIs send the provider's standard value; Decisions and generation APIs omit the upstream field.

  • size
    类型: string
  • propertyName
    类型: anything
响应
  • 202
    类型: object · ImageGenerationAccepted

    Task accepted

    • kind
      枚举
      常量:  
      image
      必填
      值
      • image
    • outputs
      类型: array string[]
      必填

      Empty until the task succeeds.

    • status
      枚举
      常量:  
      queued
      必填
      值
      • queued
    • task_id
      类型: string
      必填

      Task id to use for polling.

    application/json
  • 400
    类型: object · GenerationError

    Invalid request (unknown model, mixed input modes, invalid fields)

    OpenAI-compatible error envelope.

    • error
      类型: object
      • message
        类型: string
        必填
      • type
        类型: string 枚举
        必填
        值
        • invalid_request_error
        • server_error
      • code
        类型: string
      • param
        类型: string 可为 null
    application/json
  • 401
    类型: object · GenerationError

    Invalid or missing Felo API key

    OpenAI-compatible error envelope.

    • error
      类型: object
      • message
        类型: string
        必填
      • type
        类型: string 枚举
        必填
        值
        • invalid_request_error
        • server_error
      • code
        类型: string
      • param
        类型: string 可为 null
    application/json
  • 402
    类型: object · GenerationError

    Insufficient balance / billing requirement not met

    OpenAI-compatible error envelope.

    • error
      类型: object
      • message
        类型: string
        必填
      • type
        类型: string 枚举
        必填
        值
        • invalid_request_error
        • server_error
      • code
        类型: string
      • param
        类型: string 可为 null
    application/json
  • 403
    类型: object · GenerationError

    Account not permitted (subscription required or user banned). Disabled models are also rejected before upstream calls. Existing accepted requests and tasks continue.

    OpenAI-compatible error envelope.

    • error
      类型: object
      • message
        类型: string
        必填
      • type
        类型: string 枚举
        必填
        值
        • invalid_request_error
        • server_error
      • code
        类型: string
      • param
        类型: string 可为 null
    application/json
  • 429
    类型: object · GenerationError

    Request or spending limit reached

    OpenAI-compatible error envelope.

    • error
      类型: object
      • message
        类型: string
        必填
      • type
        类型: string 枚举
        必填
        值
        • invalid_request_error
        • server_error
      • code
        类型: string
      • param
        类型: string 可为 null
    application/json
  • 502
    类型: object · GenerationError

    Upstream provider failed

    OpenAI-compatible error envelope.

    • error
      类型: object
      • message
        类型: string
        必填
      • type
        类型: string 枚举
        必填
        值
        • invalid_request_error
        • server_error
      • code
        类型: string
      • param
        类型: string 可为 null
    application/json
  • 503
    类型: object · GenerationError

    Generation service or billing service temporarily unavailable

    OpenAI-compatible error envelope.

    • error
      类型: object
      • message
        类型: string
        必填
      • type
        类型: string 枚举
        必填
        值
        • invalid_request_error
        • server_error
      • code
        类型: string
      • param
        类型: string 可为 null
    application/json
Request Example for post/api/v1/images/generations
curl https://openapi.felo.ai/api/v1/images/generations \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "model": "configured-image-model",
  "prompt": "a cat"
}'
{
  "task_id": "string",
  "status": "queued",
  "kind": "image",
  "outputs": [
    "string"
  ]
}
Submit an image generation task