API reference
Create a chat completion
Send messages and get Prose’s reply. With stream: true the response is server-sent events in OpenAI’s chat.completion.chunk format, ending with data: [DONE]. Replies start in about a second; see Streaming.
POST
/
v1
/
chat
/
completions
Create a chat completion
curl --request POST \
--url https://api.slashy.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "echo",
"messages": [
{
"role": "user",
"content": "Write a short email asking Sam whether Thursday morning works for a call."
}
]
}
'import requests
url = "https://api.slashy.com/v1/chat/completions"
payload = {
"model": "echo",
"messages": [
{
"role": "user",
"content": "Write a short email asking Sam whether Thursday morning works for a call."
}
]
}
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({
model: 'echo',
messages: [
{
role: 'user',
content: 'Write a short email asking Sam whether Thursday morning works for a call.'
}
]
})
};
fetch('https://api.slashy.com/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "echo",
"choices": [
{
"index": 123,
"message": {
"role": "assistant",
"content": "<string>",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"system_fingerprint": null
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}Authorizations
Body
application/json
Prose's own field (send it with extra_body in OpenAI SDKs): writing for Prose to match the voice of, your own or anyone else's. A string that is only a link is read for you (an article, or a LinkedIn or X post); any other string is the text itself. Each reference keeps up to 600 words. See Match a voice with references.
Maximum array length:
5- string
- object
Minimum string length:
1Response
The completion, or a stream of chunks when stream is true.
⌘I
Create a chat completion
curl --request POST \
--url https://api.slashy.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "echo",
"messages": [
{
"role": "user",
"content": "Write a short email asking Sam whether Thursday morning works for a call."
}
]
}
'import requests
url = "https://api.slashy.com/v1/chat/completions"
payload = {
"model": "echo",
"messages": [
{
"role": "user",
"content": "Write a short email asking Sam whether Thursday morning works for a call."
}
]
}
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({
model: 'echo',
messages: [
{
role: 'user',
content: 'Write a short email asking Sam whether Thursday morning works for a call.'
}
]
})
};
fetch('https://api.slashy.com/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "echo",
"choices": [
{
"index": 123,
"message": {
"role": "assistant",
"content": "<string>",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"system_fingerprint": null
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>",
"param": "<string>"
}
}