pydo.async_invoke.create()

Generated on 8 May 2026 from pydo version v0.34.0

Usage

client.async_invoke.create(
    model_id="fal-ai/flux/schnell",
    input={...},
    tags=[...],
)
Returns JSONRaises HttpResponseError

Serverless inference methods can authenticate with a model access key instead of a DigitalOcean API token:

client = Client(token=os.environ.get("MODEL_ACCESS_KEY"))

Description

Generate Image, Audio, or Text-to-Speech Using fal Models. This endpoint starts an asynchronous job and returns a request_id. The job status is QUEUED initially. Use the request_id to poll for the result.

Parameters

model_id string required

Example: fal-ai/flux/schnell

The ID of the model to invoke asynchronously.

input object required

The input parameters for the model invocation. Fields vary by model type.

For image generation models (e.g., fal-ai/flux/schnell, fal-ai/fast-sdxl), use prompt along with optional image parameters like output_format, num_inference_steps, guidance_scale, num_images, and enable_safety_checker.

For audio generation models (e.g., fal-ai/stable-audio-25/text-to-audio), use prompt along with seconds_total to control the duration.

For text-to-speech models (e.g., fal-ai/elevenlabs/tts/multilingual-v2), use text with the content you want converted to speech.

Show child properties
prompt string optional

Example: A futuristic city at sunset

The text prompt describing the desired output. Used for image generation and audio generation models.

text string optional

Example: This text-to-speech example uses DigitalOcean multilingual voice.

The text content to convert to speech. Used for text-to-speech models.

output_format string or null optional

Example: landscape_4_3

The desired output format or aspect ratio for image generation.

num_inference_steps integer or null optional

Example: 4

The number of inference steps to use during image generation. More steps generally produce higher quality output but take longer.

Min: 1

guidance_scale number or null optional

Example: 3.5

Controls how closely the image generation model follows the prompt. Higher values produce output more closely matching the prompt.

num_images integer or null optional

Example: 1

The number of images to generate.

Min: 1

enable_safety_checker boolean or null optional

Example: True

Whether to enable the safety checker for generated content.

seconds_total integer or null optional

Example: 60

The total duration in seconds for generated audio. Used for audio generation models.

Min: 1

tags array of objects or null optional

An optional list of key-value tags to attach to the invocation request for tracking or categorization.

Show child properties
key string required

Example: type

The tag key.

value string required

Example: test

The tag value.

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("MODEL_ACCESS_KEY"))

# Image Generation
resp = client.async_images.generate(
    model_id="fal-ai/flux/schnell",
    prompt="A futuristic city at sunset",
)
print(resp.request_id, resp.status)

# Audio Generation
resp = client.audio.generate(
    model_id="fal-ai/stable-audio-25/text-to-audio",
    prompt="Techno song with futuristic sounds",
    seconds_total=60,
)
print(resp.request_id, resp.status)

# Text-to-Speech
resp = client.audio.speech.create(
    input="This text-to-speech example uses DigitalOcean multilingual voice.",
    model_id="fal-ai/elevenlabs/tts/multilingual-v2",
)
print(resp.request_id, resp.status)

Response Example

Show Response Example
{
  "request_id": "6590784a-ce47-4556-9ff4-53baff2693fb",
  "status": "QUEUED",
  "model_id": "fal-ai/fast-sdxl",
  "created_at": "2026-01-22T19:19:19.112403432Z",
  "started_at": "2019-08-24T14:15:22Z",
  "completed_at": "2019-08-24T14:15:22Z",
  "error": "string"
}

More Information

See /v1/async-invoke in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.