# Models translation create

`POST /models/v1/translations` · Rivier · models

One text or a list in another language, keeping or rendering the terms of a term list as given; terms the answer did not honour are named in terms_missed. Runs on a completions route, under the project's limits.

- Scope: models:write
- Graphql: Mutation.modelsTranslationCreate
- Sdk: models.translation.create
- Cli: models translation create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "model": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9._-]{0,39}$",
      "description": "A completions route"
    },
    "text": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 20000
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "minItems": 1,
          "maxItems": 50
        }
      ]
    },
    "source": {
      "type": "string",
      "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"
    },
    "target": {
      "type": "string",
      "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"
    },
    "terms": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "target": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "keep": {
            "type": "boolean"
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "maxItems": 200,
      "description": "A term kept as it is (keep) or always rendered as target"
    },
    "purpose": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,39}$"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "model",
    "text",
    "target"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/models/v1/translations' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "string",
  "text": "string",
  "target": "string"
}'
```
