Legacy
Write
Turns a prompt into finished text. Waits up to 25 seconds, then returns 202 with a status URL if the draft is not ready.
POST
/
v1
/
write
Write
curl --request POST \
--url https://founders-89376--echo-writing-api.us-east.modal.run/v1/write \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Write a short email asking Sam whether Thursday morning works for a call.",
"max_tokens": 1024
}
'import requests
url = "https://founders-89376--echo-writing-api.us-east.modal.run/v1/write"
payload = {
"prompt": "Write a short email asking Sam whether Thursday morning works for a call.",
"max_tokens": 1024
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'Write a short email asking Sam whether Thursday morning works for a call.',
max_tokens: 1024
})
};
fetch('https://founders-89376--echo-writing-api.us-east.modal.run/v1/write', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"request_id": "<string>",
"model": "rl-if100-step020",
"text": "<string>",
"finish_reason": "stop",
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}{
"request_id": "<string>",
"status": "processing",
"status_url": "<string>"
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Headers
Body
application/json
⌘I
Write
curl --request POST \
--url https://founders-89376--echo-writing-api.us-east.modal.run/v1/write \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Write a short email asking Sam whether Thursday morning works for a call.",
"max_tokens": 1024
}
'import requests
url = "https://founders-89376--echo-writing-api.us-east.modal.run/v1/write"
payload = {
"prompt": "Write a short email asking Sam whether Thursday morning works for a call.",
"max_tokens": 1024
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'Write a short email asking Sam whether Thursday morning works for a call.',
max_tokens: 1024
})
};
fetch('https://founders-89376--echo-writing-api.us-east.modal.run/v1/write', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"request_id": "<string>",
"model": "rl-if100-step020",
"text": "<string>",
"finish_reason": "stop",
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}{
"request_id": "<string>",
"status": "processing",
"status_url": "<string>"
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}