Getting started
Text and chat completion
Knowledge Graph
Tool calling
Additional capabilities
API Reference
- General usage
- Applications API
- Completions API
- Files API
- Knowledge Graphs API
- Tools API
- Translation API
- Vision API
Completions API
Text generation
Completions API
Text generation
POST
/
v1
/
completions
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}'
{
"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?
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}'
{
"choices": [
{
"text": "Sure! Here's a search engine optimized article about...",
"log_probs": null
}
],
"model": "palmyra-x-003-instruct"
}