Get fal.ai Model Input/Output Schema
fal_get_model_schemaFetch the OpenAPI schema for any fal.ai model to see its required inputs and output structure.
Instructions
Fetch the OpenAPI schema for a specific fal.ai model, showing exactly which input fields it accepts (names, types, defaults, enums) and what its output looks like. Call this before fal_run_model or fal_submit_request whenever you're unsure of a model's required arguments.
Args:
model_id (string): The fal.ai model id, e.g. "fal-ai/flux-pro/kontext"
response_format ('markdown' | 'json'): Output format (default: markdown)
Returns: For JSON format: the raw OpenAPI document for that model endpoint. For markdown format: a summary of the request/response schemas.
Examples:
Use when: "What parameters does fal-ai/flux-pro/kontext take?" -> model_id="fal-ai/flux-pro/kontext"
Use when: you got a 422 error from fal_run_model and need to see the correct field names
Don't use when: you already know the model's arguments from prior use
Error Handling:
Returns "Not found (404)" if the model_id doesn't exist
Returns "Authentication failed" if FAL_KEY is missing or invalid
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_id | Yes | The fal.ai model/endpoint id, e.g. "fal-ai/flux/dev", "fal-ai/flux-pro/kontext", or "fal-ai/minimax/video-01". Find valid ids with fal_list_models or at https://fal.ai/models. | |
| response_format | No | Output format: 'markdown' for human-readable or 'json' for machine-readable (default: markdown) | markdown |