API Reference
Create a text completion
Create a completion using CompletionRequest. Response is CompletionsResponse.
POST
/
v1
/
completions
Create a text completion
curl --request POST \
--url https://api.synapsai.cloud/v1/completions \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"images": "<unknown>",
"audios": "<unknown>",
"videos": "<unknown>",
"max_completion_tokens": 123,
"temperature": 123,
"top_p": 123,
"top_k": 123,
"stream": false,
"stop": [
"<string>"
],
"seed": 123,
"presence_penalty": 123,
"frequency_penalty": 123,
"logit_bias": {},
"logprobs": false
}
'import requests
url = "https://api.synapsai.cloud/v1/completions"
payload = {
"prompt": "<string>",
"images": "<unknown>",
"audios": "<unknown>",
"videos": "<unknown>",
"max_completion_tokens": 123,
"temperature": 123,
"top_p": 123,
"top_k": 123,
"stream": False,
"stop": ["<string>"],
"seed": 123,
"presence_penalty": 123,
"frequency_penalty": 123,
"logit_bias": {},
"logprobs": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "completion",
"created": 123,
"model": "<string>",
"choices": [
{
"text": "<string>",
"index": 123,
"logprobs": 123,
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}Body
application/json
Request body for the text completion endpoint.
Response
200 - application/json
Completions response
Response returned from the text completions endpoint.
⌘I
Create a text completion
curl --request POST \
--url https://api.synapsai.cloud/v1/completions \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"images": "<unknown>",
"audios": "<unknown>",
"videos": "<unknown>",
"max_completion_tokens": 123,
"temperature": 123,
"top_p": 123,
"top_k": 123,
"stream": false,
"stop": [
"<string>"
],
"seed": 123,
"presence_penalty": 123,
"frequency_penalty": 123,
"logit_bias": {},
"logprobs": false
}
'import requests
url = "https://api.synapsai.cloud/v1/completions"
payload = {
"prompt": "<string>",
"images": "<unknown>",
"audios": "<unknown>",
"videos": "<unknown>",
"max_completion_tokens": 123,
"temperature": 123,
"top_p": 123,
"top_k": 123,
"stream": False,
"stop": ["<string>"],
"seed": 123,
"presence_penalty": 123,
"frequency_penalty": 123,
"logit_bias": {},
"logprobs": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "completion",
"created": 123,
"model": "<string>",
"choices": [
{
"text": "<string>",
"index": 123,
"logprobs": 123,
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}