# MoonDreamNext Batch

> MoonDreamNext Batch is a multimodal vision-language model for batch captioning.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/moondream-next/batch`
- **Model ID**: `fal-ai/moondream-next/batch`
- **Category**: vision
- **Kind**: inference
**Tags**: multimodal



## Pricing

- **Price**: $0.0011 per seconds

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`images_data_url`** (`string`, _required_):
  List of image URLs to be processed (maximum 32 images)

- **`prompt`** (`string`, _required_):
  Single prompt to apply to all images
  - Examples: "Describe this image in detail."

- **`max_tokens`** (`integer`, _optional_):
  Maximum number of tokens to generate Default value: `64`
  - Default: `64`
  - Range: `1` to `512`



**Required Parameters Example**:

```json
{
  "images_data_url": "",
  "prompt": "Describe this image in detail."
}
```

**Full Example**:

```json
{
  "images_data_url": "",
  "prompt": "Describe this image in detail.",
  "max_tokens": 64
}
```


### Output Schema

The API returns the following output format:

- **`captions_file`** (`File`, _required_):
  URL to the generated captions JSON file containing filename-caption pairs.

- **`outputs`** (`list<string>`, _required_):
  List of generated captions
  - Array of string



**Example Response**:

```json
{
  "captions_file": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/moondream-next/batch \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "images_data_url": "",
     "prompt": "Describe this image in detail."
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/moondream-next/batch",
    arguments={
        "images_data_url": "",
        "prompt": "Describe this image in detail."
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/moondream-next/batch", {
  input: {
    images_data_url: "",
    prompt: "Describe this image in detail."
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/moondream-next/batch)
- [API Documentation](https://fal.ai/models/fal-ai/moondream-next/batch/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/moondream-next/batch)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
