---
title: m2m100-1.2b · Cloudflare Workers AI docs
description: Multilingual encoder-decoder (seq-to-seq) model trained for Many-to-Many multilingual translation
source_url:
  html: https://patricia-pcx17119-l7-overrides.preview.developers.cloudflare.com/workers-ai/models/m2m100-1.2b/index.md
  md: https://patricia-pcx17119-l7-overrides.preview.developers.cloudflare.com/workers-ai/models/m2m100-1.2b/
---

![Meta logo](https://developers.cloudflare.com/_astro/meta.DVkn7hgg.svg)

# m2m100-1.2b

Translation • Meta

@cf/meta/m2m100-1.2b

Multilingual encoder-decoder (seq-to-seq) model trained for Many-to-Many multilingual translation

| Model Info | |
| - | - |
| Terms and License | [link](https://github.com/facebookresearch/fairseq/blob/main/LICENSE) |
| More information | [link](https://github.com/facebookresearch/fairseq/tree/main/examples/m2m_100) |
| Batch | Yes |
| Unit Pricing | $0.34 per M input tokens, $0.34 per M output tokens |

## Usage

## Parameters

\* indicates a required field

### Input

* `0 `object

  * `text * `string min 1

    The text to be translated

  * `source_lang `string default en

    The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified

  * `target_lang * `string

    The language code to translate the text into (e.g., 'es' for Spanish)

* `1 `object

  * `requests * `array

    Batch of the embeddings requests to run using async-queue

    * `items `object

      * `text * `string min 1

        The text to be translated

      * `source_lang `string default en

        The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified

      * `target_lang * `string

        The language code to translate the text into (e.g., 'es' for Spanish)

### Output

* `0 `object

  * `translated_text `string

    The translated text in the target language

* `1 `object

  * `request_id `string

    The async request id that can be used to obtain the results.

## API Schemas

The following schemas are based on JSON Schema

* Input

  ```json
  {
      "type": "object",
      "oneOf": [
          {
              "properties": {
                  "text": {
                      "type": "string",
                      "minLength": 1,
                      "description": "The text to be translated"
                  },
                  "source_lang": {
                      "type": "string",
                      "default": "en",
                      "description": "The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified"
                  },
                  "target_lang": {
                      "type": "string",
                      "description": "The language code to translate the text into (e.g., 'es' for Spanish)"
                  }
              },
              "required": [
                  "text",
                  "target_lang"
              ]
          },
          {
              "properties": {
                  "requests": {
                      "type": "array",
                      "description": "Batch of the embeddings requests to run using async-queue",
                      "items": {
                          "type": "object",
                          "properties": {
                              "text": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "The text to be translated"
                              },
                              "source_lang": {
                                  "type": "string",
                                  "default": "en",
                                  "description": "The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified"
                              },
                              "target_lang": {
                                  "type": "string",
                                  "description": "The language code to translate the text into (e.g., 'es' for Spanish)"
                              }
                          },
                          "required": [
                              "text",
                              "target_lang"
                          ]
                      }
                  }
              },
              "required": [
                  "requests"
              ]
          }
      ]
  }
  ```

* Output

  ```json
  {
      "type": "object",
      "contentType": "application/json",
      "oneOf": [
          {
              "properties": {
                  "translated_text": {
                      "type": "string",
                      "description": "The translated text in the target language"
                  }
              }
          },
          {
              "type": "object",
              "contentType": "application/json",
              "title": "Async response",
              "properties": {
                  "request_id": {
                      "type": "string",
                      "description": "The async request id that can be used to obtain the results."
                  }
              }
          }
      ]
  }
  ```
