General usage
Applications API
Completions API
Files API
Knowledge Graphs API
Translation API
Vision API
Completions API
Text generation
POST
/
v1
/
completions
Copy
curl --location --request POST https://api.writer.com/v1/completions \
--header "Authorization: Bearer <token>" \
--header "Content-Type: application/json" \
--data-raw '{"model":"palmyra-x-003-instruct","prompt":"Write me a short SEO article about camping gear","max_tokens":150,"temperature":0.7,"top_p":0.9,"stop":["."],"best_of":1,"random_seed":42,"stream":false}'
Copy
{
"choices": [
{
"text": "Sure! Here's a search engine optimized article about...",
"log_probs": null
}
],
"model": "palmyra-x-003-instruct"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your Writer API key.
Body
application/json
Response
200
application/json
Successful response
The response is of type object
.
Was this page helpful?
Copy
curl --location --request POST https://api.writer.com/v1/completions \
--header "Authorization: Bearer <token>" \
--header "Content-Type: application/json" \
--data-raw '{"model":"palmyra-x-003-instruct","prompt":"Write me a short SEO article about camping gear","max_tokens":150,"temperature":0.7,"top_p":0.9,"stop":["."],"best_of":1,"random_seed":42,"stream":false}'
Copy
{
"choices": [
{
"text": "Sure! Here's a search engine optimized article about...",
"log_probs": null
}
],
"model": "palmyra-x-003-instruct"
}
Assistant
Responses are generated using AI and may contain mistakes.