diff --git a/README.md b/README.md
index daad3d7..2883ab4 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,9 @@ Free and Open Source Machine Translation API, entirely self-hosted. Unlike other
## API Examples
+
+### Plain Text
+
Request:
```javascript
@@ -36,6 +39,33 @@ Response:
}
```
+### HTML
+
+Request:
+
+```javascript
+const res = await fetch("https://libretranslate.com/translate", {
+ method: "POST",
+ body: JSON.stringify({
+ q: 'Hello!',
+ source: "en",
+ target: "es",
+ format: "html"
+ }),
+ headers: { "Content-Type": "application/json" }
+});
+
+console.log(await res.json());
+```
+
+Response:
+
+```javascript
+{
+ "translatedText": "¡Hola!"
+}
+```
+
## Install and Run
You can run your own API server in just a few lines of setup!
@@ -136,7 +166,6 @@ You can pass application arguments directly to Gunicorn via:
gunicorn --bind 0.0.0.0:5000 'wsgi:app(api_keys=True)'
```
-
## Manage API Keys
LibreTranslate supports per-user limit quotas, e.g. you can issue API keys to users so that they can enjoy higher requests limits per minute (if you also set `--req-limit`). By default all users are rate-limited based on `--req-limit`, but passing an optional `api_key` parameter to the REST endpoints allows a user to enjoy higher request limits.
diff --git a/app/app.py b/app/app.py
index 19bb846..8576996 100644
--- a/app/app.py
+++ b/app/app.py
@@ -267,9 +267,14 @@ def create_app(args):
name: format
schema:
type: string
- example: html or text
+ enum: [text, html]
+ default: text
+ example: text
required: false
- description: The format of the source text
+ description: >
+ Format of source text:
+ * `text` - Plain text
+ * `html` - HTML markup
- in: formData
name: api_key
schema: