m2m100-1.2b
Translation • MetaMultilingual encoder-decoder (seq-to-seq) model trained for Many-to-Many multilingual translation
| Model Info | |
|---|---|
| Terms and License | link ↗ | 
| More information | link ↗ | 
| Batch | Yes | 
| Unit Pricing | $0.34 per M input tokens, $0.34 per M output tokens | 
Usage
Workers - TypeScript
  export interface Env {  AI: Ai;}
export default {  async fetch(request, env): Promise<Response> {
    const response = await env.AI.run(      "@cf/meta/m2m100-1.2b",      {        text: "I'll have an order of the moule frites",        source_lang: "english", // defaults to english        target_lang: "french",      }    );
    return new Response(JSON.stringify(response));  },} satisfies ExportedHandler<Env>;Python
  import requests
API_BASE_URL = "https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/"headers = {"Authorization": "Bearer {API_TOKEN}"}
def run(model, input):    response = requests.post(f"{API_BASE_URL}{model}", headers=headers, json=input)    return response.json()
output = run('@cf/meta/m2m100-1.2b', {  "text": "I'll have an order of the moule frites",  "source_lang": "english",  "target_lang": "french"})
print(output)curl
  curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/meta/m2m100-1.2b  \    -X POST  \    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"  \    -d '{ "text": "Ill have an order of the moule frites", "source_lang": "english", "target_lang": "french" }'Parameters
* indicates a required field
Input
-  
0object-  
textstring required min 1The text to be translated
 -  
source_langstring default enThe language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified
 -  
target_langstring requiredThe language code to translate the text into (e.g., 'es' for Spanish)
 
 -  
 -  
1object-  
requestsarray requiredBatch of the embeddings requests to run using async-queue
-  
itemsobject-  
textstring required min 1The text to be translated
 -  
source_langstring default enThe language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified
 -  
target_langstring requiredThe language code to translate the text into (e.g., 'es' for Spanish)
 
 -  
 
 -  
 
 -  
 
Output
-  
0object-  
translated_textstringThe translated text in the target language
 
 -  
 -  
1object-  
request_idstringThe async request id that can be used to obtain the results.
 
 -  
 
API Schemas
The following schemas are based on JSON Schema
{    "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"            ]        }    ]}{    "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."                }            }        }    ]}Was this helpful?
- Resources
 - API
 - New to Cloudflare?
 - Directory
 - Sponsorships
 - Open Source
 
- Support
 - Help Center
 - System Status
 - Compliance
 - GDPR
 
- Company
 - cloudflare.com
 - Our team
 - Careers
 
- © 2025 Cloudflare, Inc.
 - Privacy Policy
 - Terms of Use
 - Report Security Issues
 - Trademark