Skip to main content
POST
/
v1
/
completions
Completions
curl --request POST \
  --url https://api.algo-tech.ai/v1/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "deepseek-ai/DeepSeek-R1",
  "prompt": "The sky is",
  "temperature": 1,
  "max_tokens": 2000,
  "stream": true
}'
{
  "id": "<string>",
  "object": "<string>",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": "<any>",
      "finish_reason": "stop"
    }
  ],
  "usage": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Authorization
string
default:Bearer <API_KEY>
required

Bearer authentication header of the form Bearer <API_KEY>, where <API_KEY> is your auth token.

Body

application/json
model
string

The name of the model to use.

Example:

"deepseek-ai/DeepSeek-R1"

prompt
string

The prompt to generate completions for. It can be a single string or an array of strings. It can also be an array of integers or an array of integer arrays, which allows to pass already tokenized prompt. If multiple prompts are specified, several choices with corresponding index will be returned in the output."

Example:

"The sky is"

temperature
number
default:1

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

We generally recommend altering this or top_p but not both.

Required range: 0 <= x <= 2
Example:

1

max_tokens
integer
default:2000

The maximum number of tokens to generate in the completion.

If the token count of your prompt (previous messages) plus max_tokens exceed the model's context length, the behavior is depends on context_length_exceeded_behavior. By default, max_tokens will be lowered to fit in the context window instead of returning an error.

stream
boolean

Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events

Example:

true

Response

OK

id
string

A unique identifier of the response.

object
string

The object type, which is always "chat.completion".

created
integer

The Unix time in seconds when the response was generated.

model
string

The model used for the chat completion.

choices
object[]

The list of chat completion choices.

usage
object